dannyhammer / TwoPlayerGames

Undergraduate research into the mechanics of simple two-player games.
3 stars 2 forks source link

Add functionality to RulesetInterface to aid in declaring a winner #86

Closed dannyhammer closed 3 years ago

dannyhammer commented 3 years ago

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:

Drawbacks: