tictactoe
Class GameDriver
java.lang.Object
|
+--tictactoe.GameDriver
- public class GameDriver
- extends java.lang.Object
Instantiates a plain ASCII version of TicTacToe or Gomoku.
- Version:
- 2.0 1999-03-26
- Author:
- Oscar.Nierstrasz@acm.org
Method Summary |
static void |
main(java.lang.String[] args)
Queries the user whether to instantiate TicTacToe or Gomoku. |
static void |
playGame(BoardGame game)
Plays an instantiated BoardGame in verbose mode
(i.e., printing every board state). |
static void |
playGame(BoardGame game,
boolean verbose)
Plays a game until it is over by repeatedly asking the current Player to move. |
static char |
readChar()
Helper method to get a character from the standard input. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
GameDriver
public GameDriver()
main
public static void main(java.lang.String[] args)
- Queries the user whether to instantiate TicTacToe or Gomoku.
playGame
public static void playGame(BoardGame game)
- Plays an instantiated BoardGame in verbose mode
(i.e., printing every board state).
readChar
public static char readChar()
- Helper method to get a character from the standard input.
playGame
public static void playGame(BoardGame game,
boolean verbose)
- Plays a game until it is over by repeatedly asking the current Player to move.
Can also be used in silent mode to run a test suite.
- Parameters:
game
- the game to playverbose
- boolean flag to print game state if true