Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a test to play 5 moves into a game with Stockfish playing both sides #4

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

andreisavu
Copy link
Owner

@andreisavu andreisavu commented Aug 22, 2024

Add a test to play 5 moves into a game with Stockfish playing both sides.

  • Add test_chess_five_moves function in tests/test_chess.py
  • Configure Stockfish for fast moves (10s of ms per move at most) using set_option method
  • Use a loop to play 5 moves, updating the board and Stockfish position after each move
  • Assert that the board's fullmove number is 6 after 5 moves

For more details, open the Copilot Workspace session.

Add a test to play 5 moves into a game with Stockfish playing both sides.

* Add `test_chess_five_moves` function in `tests/test_chess.py`
* Configure Stockfish for fast moves (10s of ms per move at most) using `set_option` method
* Use a loop to play 5 moves, updating the board and Stockfish position after each move
* Assert that the board's fullmove number is 6 after 5 moves

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/andreisavu/chess-codegen?shareId=XXXX-XXXX-XXXX-XXXX).
* **Configure Stockfish**: Use `update_engine_parameters` to set "Threads" to 1 and "Minimum Thinking Time" to 10
* **Play 5 moves**: Use a loop to play 5 moves, updating the board and Stockfish position after each move
* **Assertion**: Check that the board's fullmove number is 6
@andreisavu
Copy link
Owner Author

Add test function to play 5 moves with Stockfish

  • Configure Stockfish: Use update_engine_parameters to set "Threads" to 1 and "Minimum Thinking Time" to 10
  • Play 5 moves: Use a loop to play 5 moves, updating the board and Stockfish position after each move
  • Assertion: Check that the board's fullmove number is 6

@andreisavu
Copy link
Owner Author

Fix the test to assert that the board's fullmove number is 3

@andreisavu andreisavu merged commit 4ab8fbf into main Aug 22, 2024
2 checks passed
@andreisavu andreisavu deleted the add-test branch August 22, 2024 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant