def game_over(self):
""" Determine if the game is over
Used by the engine to determine when to finish the game.
A game is over when there are no players remaining, or a single
winner remaining.
"""
if len(self.remaining_players()) < 1:
self.cutoff = 'extermination'
return True
elif len(self.remaining_players()) == 1:
self.cutoff = 'lone survivor'
return True
elif self.game_won() == DRAW:
self.cutoff = "Board full"
return True
elif self.game_won() != EMPTY:
self.cutoff = "Game won"
return True
elif self.count_active() < 1:
self.cutoff = "No more moves"
return True
else: return False
评论列表
文章目录