From 2ca1a9df39c2d6331160e6ccb50ab2f9bb677e66 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 13 Jan 2025 18:05:00 +0200 Subject: hw(AI/4): Fix depth limit being off by one --- Year 4/Artificial Intelligence/hw04/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Year 4/Artificial Intelligence/hw04/src/main.rs b/Year 4/Artificial Intelligence/hw04/src/main.rs index 933083b..a6704a0 100644 --- a/Year 4/Artificial Intelligence/hw04/src/main.rs +++ b/Year 4/Artificial Intelligence/hw04/src/main.rs @@ -140,7 +140,7 @@ fn player_move(board: &mut [[Tile; 3]; 3]) { } fn computer_move(board: &mut [[Tile; 3]; 3], turn: i32) { - let (_, x, y) = minimax(board, 9 - turn, i32::MIN, i32::MAX, true); + let (_, x, y) = minimax(board, 8 - turn, i32::MIN, i32::MAX, true); println!("Computer move: {x} {y}"); board[x][y] = Tile::O; } -- cgit v1.3.1-23-gd82d