Skip to content

Commit

Permalink
More efficient choice of first move
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkZH committed Jan 4, 2025
1 parent 5da652e commit e441ef6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test_bot/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class TrivialEngine:

def play(self, board: chess.Board, limit: chess.engine.Limit, ponder: bool) -> chess.engine.PlayResult:
"""Choose the first legal move."""
return chess.engine.PlayResult(list(board.legal_moves)[0], None)
return chess.engine.PlayResult(next(iter(board.legal_moves)), None)

def quit(self) -> None:
"""Do nothing."""
Expand Down

0 comments on commit e441ef6

Please sign in to comment.