A B C D G I M N P R S T U W _

A

AbstractBoardGame - class AbstractBoardGame.
AbstractBoardGame implements common methods to TicTacToe and Gomoku
AbstractBoardGame() - Constructor for class AbstractBoardGame
 
assert(boolean) - Method in class AbstractBoardGame
 
AssertionException - exception AssertionException.
All Exception classes look like this.

B

BoardGame - interface BoardGame.
Interface for TicTacToe and Gomoku.

C

checkWinner(int, int) - Method in class AbstractBoardGame
New algorithm needed for larger boards.
currentPlayer() - Method in class AbstractBoardGame
 
currentPlayer() - Method in interface BoardGame
 

D

doGomokuTests() - Static method in class TestDriver
 
doTicTacToeTests() - Static method in class TestDriver
 

G

GameDriver - class GameDriver.
 
GameDriver() - Constructor for class GameDriver
 
get(int, int) - Method in class AbstractBoardGame
Needed by Runner
get(int, int) - Method in interface BoardGame
 
getCol(String) - Method in class AbstractBoardGame
 
getRow(String) - Method in class AbstractBoardGame
 
Gomoku - class Gomoku.
Class to enforce rules of Gomoku.
Gomoku(Player, Player) - Constructor for class Gomoku
Gomoku is similar to TicTacToe, except it is played on a 19x19 Go board, and the winner must get 5 in a row.

I

init(int, int, int, Player, Player) - Method in class AbstractBoardGame
Generic initialization for BoardGame.
inRange(int, int) - Method in class AbstractBoardGame
 
inRange(int, int) - Method in interface BoardGame
 
isNobody() - Method in class Player
By convention, a Player without a mark is nobody!

M

main(String[]) - Static method in class GameDriver
 
main(String[]) - Static method in class TestDriver
 
mark() - Method in class Player
 
move(BoardGame) - Method in class Player
 
move(String, char) - Method in class AbstractBoardGame
Called by the current player during an update().
move(String, char) - Method in interface BoardGame
 

N

name() - Method in class Player
 
notOver() - Method in class AbstractBoardGame
The game is not over as long as there is no winner and somebody can still make a move ...
notOver() - Method in interface BoardGame
 

P

Player - class Player.
Manage interaction with user.
Player() - Constructor for class Player
Special constructor for the Player representing nobody.
Player(char) - Constructor for class Player
The normal contructor to use:
Player(char, BufferedReader) - Constructor for class Player
Constructor to specify an alternative source of moves (e.g., a test case StringReader).
Player(char, String) - Constructor for class Player
Special constructor to make a Player that plays a fixed set of moves from a String.
playGame(BoardGame) - Static method in class GameDriver
 
playGame(BoardGame, boolean) - Static method in class GameDriver
 

R

readChar() - Static method in class GameDriver
 
run(int, int) - Method in class Runner
A Runner runs in some direction (dcol,drow) as far as it can, as long as the pieces on the Board are the same as the home square.
Runner - class Runner.
Helper class to find winning scores for BoardGame.
Runner(BoardGame, int, int) - Constructor for class Runner
This class does not have any interesting contracts.

S

set(int, int, char) - Method in class AbstractBoardGame
set() and get() translate between chess coordinates and array indices.
setWinner(char) - Method in class AbstractBoardGame
Look up which player is the winner, and set _winner accordingly.
squaresLeft() - Method in class AbstractBoardGame
 
squaresLeft() - Method in interface BoardGame
 
swapTurn() - Method in class AbstractBoardGame
 

T

test() - Method in class AbstractBoardGame
Some generic tests for both TicTacToe and Gomoku.
test() - Method in interface BoardGame
 
TestDriver - class TestDriver.
Test Driver for TicTacToe.
TestDriver() - Constructor for class TestDriver
 
testGame(BoardGame, String, int) - Static method in class TestDriver
Run a game with simulated input for X and Y, and check that the winner is as expected.
TicTacToe - class TicTacToe.
Class to enforce rules of TicTacToe.
TicTacToe(Player, Player) - Constructor for class TicTacToe
 
toString() - Method in class AbstractBoardGame
A plain ascii representation of the game, mainly for debugging purposes.

U

update() - Method in class AbstractBoardGame
Ask the current player to make a move.
update() - Method in interface BoardGame
 

W

winner() - Method in class AbstractBoardGame
 
winner() - Method in interface BoardGame
 

_

_cols - Variable in class AbstractBoardGame
 
_gameState - Variable in class AbstractBoardGame
 
_player - Variable in class AbstractBoardGame
 
_rows - Variable in class AbstractBoardGame
 
_squaresLeft - Variable in class AbstractBoardGame
 
_turn - Variable in class AbstractBoardGame
 
_winner - Variable in class AbstractBoardGame
 
_winningScore - Variable in class AbstractBoardGame
 

A B C D G I M N P R S T U W _