major algo improvements again

This commit is contained in:
2025-02-08 14:14:05 -05:00
parent 41bc93276e
commit 325ac75c31
3 changed files with 38 additions and 4 deletions

View File

@@ -67,8 +67,37 @@ impl Game {
println!("{}", self);
// Check if the game is over
// TODO! what if the board isn't full, but one player cannot win as
// they don't have any moves to play?
// Example::
// Player 1 placed at (1, 0)
// Players: Complex Agent (□) and Manual Agent (■)
// 0 1 2 3 4 5 6 7
// -----------------
// 0|□|□|□|□|□|□|□|□|
// -----------------
// 1|■|■|■|□|□|□| |□|
// -----------------
// 2|■|■|□|■|□|□|□|□|
// -----------------
// 3|■|■|□|□|■|□|□|□|
// -----------------
// 4|■|■|□|□|■|□|□|□|
// -----------------
// 5|□|□|■|□|■|□|□|□|
// -----------------
// 6| |□|□|□|□|□|□|□|
// -----------------
// 7| | | |■|■| |■| |
// -----------------
// White Score: 17
// Black Score: 40
// (depth: 5) possible board states: 0
// thread 'main' panicked at src/complexagent.rs:139:9:
// ComplexAgent didn't make a move
if self.board.game_over() {
// end the game
break;
}