tictactoe
Class Runner
java.lang.Object
|
+--tictactoe.Runner
- public class Runner
- extends java.lang.Object
Helper class to find winning scores for BoardGame.
A Runner runs across a BoardGame, starting at the
position last played, and searches for a winning score.
- Version:
- 1.6 1999-02-04
- Author:
- Oscar.Nierstrasz@acm.org
Method Summary |
int |
run(int dcol,
int drow)
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. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Runner
public Runner(BoardGame game,
int col,
int row)
- Parameters:
game
- the associated BoardGamecol
- the column of the last position playedrow
- the row of the last position played
run
public int run(int dcol,
int drow)
throws AssertionException
- 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.
Then it runs in the opposite direction, and
returns the total score.