In game.py there exists the following code in the play() function:
# Check if the game has been won
if self.referee.is_game_over(self.board):
winner = self.player
If we add functionality to RulesetInterface via the Referee's declare_winner() function, we can have it return the winner based on the end-game conditions of the board.
Benefits:
Allows us to alter Rule #4 of our game criteria ("if no player can make a legal move, they lose")
Allows us to implement the graph coloring game with minimal changes to our code base
Drawbacks:
More code to implement for each new game (shouldn't be too much extra)
In
game.py
there exists the following code in theplay()
function:If we add functionality to
RulesetInterface
via the Referee'sdeclare_winner()
function, we can have it return the winner based on the end-game conditions of the board.Benefits:
Drawbacks: