CS241: Implementing a game tree
- Administrivia - Conflict between 363Y and 451... will move 363Y...
- Programming trick: holding the details at arm's length for as long as possible.
- lab
- Writing
boolean gameOver()
for Board, sometimes written Board:gameOver() -- perhaps there are 7 cases?
- no empty squares
- row win for X
- col win for X
- diag win for X
- row win for O
- col win for O
- diag win for O
Or... perhaps only 2?
- The board is full
- Somebody won (Xwin() || Owin()...)
- Board representation
- The board itself -- 2D array of... what?
- Whose turn -- boolean? char? int? Turn?
- ...and... how to represent a move? Row/col? Move?
- What if the tree won't fit in memory?
- Making the Board representation smaller
- Storing less Boards (by eliminating duplicates)
- Storing already stored Boards in a HashMap