A E F G H I L M P S T

A

applyMove(Move) - Method in class GameState
Constructs and returns a new game state obtained from this game state by applying the given Move object to this GameState.

E

equals(Object) - Method in class GameState
Compares the specified object to this game state for equality.
equals(Object) - Method in class Move
Compares the specified object to this move for equality.

F

fx - Variable in class Move
x-coordinate of square from which piece is being moved, or -1 if new piece is just being placed on the board.
fy - Variable in class Move
y-coordinate of square from which piece is being moved, or -1 if new piece is just being placed on the board.

G

GameRules - class GameRules.
An object of this class describes the rules for a particular variation of movable tic-tac-toe, specifically, the moves that are possible from a given state, and whether a given state is a win for one of the players.
GameRules(int[][]) - Constructor for class GameRules
Constructs a GameRules object in which legal moves are defined by the given array of 4-tuples.
GameRules(String) - Constructor for class GameRules
Constructs a GameRules object for a game whose legal moves are stored in the file game_id.rules.
GameState - class GameState.
An object of this class represents the state of the game, including the current board position (accessible using the square method) and whose turn it is (accessible using the turn method).
GameState() - Constructor for class GameState
Constructs a new game state with no pieces on the board, and +1's turn.
GameState(int[][], int) - Constructor for class GameState
Constructs a new game state with pieces on board as specified by squares; the player whose turn it is is specified by turn.
getNextMove(GameState) - Method in interface Player
Returns the move selected to be played next from the given game state gs.

H

hashCode() - Method in class GameState
Returns the hash code for this game position.

I

isLegal(GameState, Move) - Method in class GameRules
Tests whether the given game state and the move from it are legal according to the game rules.
isWin(GameState) - Method in class GameRules
Returns +1 if player +1 has won in the given game state, -1 if player -1 has won, and 0 if no one has won.

L

legalMoves(GameState) - Method in class GameRules
Returns an array of all possible legal moves from the given game state.

M

Move - class Move.
An object of this class represents a move that could be applied to a game state.
Move(int, int) - Constructor for class Move
Constructs a move representing placing a new game piece at position tx,ty.
Move(int, int, int, int) - Constructor for class Move
Constructs a move representing moving a game piece from fx,fy to tx,ty.

P

Player - interface Player.
Specifies the interface that all players must adhere to.

S

square(int, int) - Method in class GameState
Returns the contents of square x,y on the current board position.

T

toLongString(int) - Method in class GameState
Produces a multi-line string description of the GameState object indented indentBy spaces.
toString() - Method in class GameState
Produces a one line string description of the GameState object.
toString() - Method in class Move
Produces a description of this Move object.
turn() - Method in class GameState
Returns the player (+1 or -1) whose turn it is.
tx - Variable in class Move
x-coordinate of square to which piece is being moved.
ty - Variable in class Move
y-coordinate of square to which piece is being moved.

A E F G H I L M P S T