|
Algorithm Development Kit 1.0 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectalgs.model.problems.tictactoe.model.Player
algs.model.problems.tictactoe.model.RandomPlayer
public class RandomPlayer
Randomly makes moves given the logic of the TicTacToe variation.
| Field Summary |
|---|
| Fields inherited from class algs.model.problems.tictactoe.model.Player |
|---|
logic, mark, OMARK, score, XMARK |
| Constructor Summary | |
|---|---|
RandomPlayer(char mark)
Construct a Random player who determines a move randomly from available open cells. |
|
| Method Summary | |
|---|---|
IGameMove |
decideMove(IGameState state)
Randomly make a move based upon the available logic of the game. |
java.util.Collection<IGameMove> |
validMoves(IGameState state)
Return the valid moves for this player given the game state. |
| Methods inherited from class algs.model.problems.tictactoe.model.Player |
|---|
eval, getMark, getOpponentMark, hashCode, logic, logic, score, score, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RandomPlayer(char mark)
mark - Mark to be used for the player.| Method Detail |
|---|
public IGameMove decideMove(IGameState state)
decideMove in class Playerstate - Current board state
public java.util.Collection<IGameMove> validMoves(IGameState state)
validMoves in interface IPlayervalidMoves in class Playerstate - Current game state position
|
Algorithm Development Kit 1.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||