From 73d24e7748f9dbe4b601795fdbfeb8631a32c119 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Thu, 30 Jan 2025 16:33:10 -0500 Subject: [PATCH] stuff --- src/complexagent.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/complexagent.rs b/src/complexagent.rs index f726633..b77575a 100644 --- a/src/complexagent.rs +++ b/src/complexagent.rs @@ -1,5 +1,3 @@ -use std::collections::HashMap; - use crate::{ agent::Agent, board::{Board, BOARD_SIZE}, @@ -49,20 +47,20 @@ impl Move { } } -fn problem_space(board: &Board, piece: Piece) -> Vec { +fn problem_space(board: &Board, color: Piece) -> Vec { (0..BOARD_SIZE) .flat_map(|i| { (0..BOARD_SIZE) .map(|j| (i, j)) .collect::>() }) - .flat_map(|(i, j)| board.what_if(i, j, piece).map(|x| (i, j, x))) - .map(|(i, j, (b, c))| Move { + .flat_map(|(i, j)| board.what_if(i, j, color).map(|x| (i, j, x))) + .map(|(i, j, (board, captured))| Move { i, j, - captured: c, - color: piece, - board: b, + captured, + color, + board, next_move: Vec::new(), }) .collect()