Skip to content

Commit

Permalink
Player 1 and player 2 alternate moving first
Browse files Browse the repository at this point in the history
  • Loading branch information
Casper-Guo committed Jul 29, 2024
1 parent f3f0bd9 commit e8bb1c0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tournament.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,14 @@ def main(
else combinations_with_replacement(player_classes, 2)
)
for player1, player2 in iterator:
for _ in range(num_games):
game = Game(player1(), player2(), board_seed)
for i in range(num_games):
white_player, black_player = player1, player2
if i >= num_games // 2:
white_player, black_player = player2, player1

game = Game(white_player(), black_player(), board_seed)
if game.play():
# player1 wins
# white wins
num_wins[str(game.player1)][str(game.player2)] += 1
else:
if player1 != player2:
Expand Down

0 comments on commit e8bb1c0

Please sign in to comment.