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

Constructor Summary
Runner(BoardGame game, int col, int row)
           
 
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
 

Constructor Detail

Runner

public Runner(BoardGame game,
              int col,
              int row)
Parameters:
game - the associated BoardGame
col - the column of the last position played
row - the row of the last position played
Method Detail

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.