Ejemplo n.º 1
0
 def play(self):
     self.board = Board()
     self.rounds = 0
     self.player1.set_position(1)
     self.player2.set_position(2)
     while not self.victory():
         self.player1.new_round()
         self.player2.new_round()
         self.play_round()
         self.rounds += 1
     if StandardRules.p1_victory(self.board):
         self.player1.win()
         self.player2.lose()
     else:
         self.player1.lose()
         self.player2.win()
Ejemplo n.º 2
0
 def victory(self):
     return StandardRules.p1_victory(
         self.board) or StandardRules.p2_victory(self.board)