The code inside game.py's play() method is functional but unsatisfactory. Specifically in regards to determining a winner.
Currently, there are two cases where a winner can be declared:
The current player made an illegal move, meaning the opponent wins
The current player made a move that put the board into an end-game state, meaning the player wins
The declare_winner() method from the referee is called once the game is over. This may be able to be rewritten to be cleaner, as declare_winner()must execute at the end of the game, but should not attempt to update the winner of the game if case 1 triggered the end of the game.
This may extend to editing the code inside referee.py's declare_winner() method as well. That method should also update the winner and loser's win and loss counters, respectively. To do this, it must know who the winner and loser are.
The code inside
game.py
'splay()
method is functional but unsatisfactory. Specifically in regards to determining a winner.Currently, there are two cases where a winner can be declared:
The
declare_winner()
method from thereferee
is called once the game is over. This may be able to be rewritten to be cleaner, asdeclare_winner()
must execute at the end of the game, but should not attempt to update thewinner
of the game if case 1 triggered the end of the game.This may extend to editing the code inside
referee.py
'sdeclare_winner()
method as well. That method should also update the winner and loser'swin
andloss
counters, respectively. To do this, it must know who the winner and loser are.