Beispiel #1
0
 def check_win(self, game):
     c = check_win(game)
     if not c:
         return
     game['done'] = c
     p1, p2 = self.participants(game)
     p1, p2 = self.players[p1], self.players[p2]
     p1['total'] += 1
     p2['total'] += 1
     if c == ' ':
         return
     winner, loser = (p1, p2) if c == 'x' else (p2, p1)
     winner['won'] += 1
     loser['lost'] += 1
Beispiel #2
0
 def check_win(self, game):
     c = check_win(game)
     if not c:
         return
     game['done'] = c
     p1, p2 = self.participants(game)
     p1, p2 = self.players[p1], self.players[p2]
     p1['total'] += 1
     p2['total'] += 1
     if c == ' ':
         return
     winner, loser = (p1, p2) if c == 'x' else (p2, p1)
     winner['won'] += 1
     loser['lost'] += 1
Beispiel #3
0
 def check(f, size=3, inarow=3):
     return utils.check_win({'field': f, 'size': size, 'inarow': inarow})