major algo improvements again
This commit is contained in:
31
src/game.rs
31
src/game.rs
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user