Move logic changes
This commit is contained in:
@@ -8,12 +8,6 @@ struct Move {
|
||||
/// `j` position of move
|
||||
j: usize,
|
||||
|
||||
/// how many pieces are captured by this move
|
||||
captured: usize,
|
||||
|
||||
/// Turn this move was made on
|
||||
color: Piece,
|
||||
|
||||
/// [`Board`] state after move is made
|
||||
board: Board,
|
||||
|
||||
@@ -116,11 +110,9 @@ impl FutureMoves {
|
||||
// because we use [`Board::what_if`] later and we want to reduce calls to [`Board::propegate_from_dry`]
|
||||
Board::all_positions()
|
||||
.flat_map(|(i, j)| board.what_if(i, j, color).map(|x| (i, j, x)))
|
||||
.map(|(i, j, (new_board, captured))| Move {
|
||||
.map(|(i, j, new_board)| Move {
|
||||
i,
|
||||
j,
|
||||
captured,
|
||||
color,
|
||||
board: new_board,
|
||||
winner: new_board.game_winner(color),
|
||||
parent,
|
||||
@@ -251,7 +243,7 @@ pub struct ComplexAgent {
|
||||
|
||||
impl ComplexAgent {
|
||||
pub const fn new(color: Piece) -> Self {
|
||||
const MAX_DEPTH: usize = 7;
|
||||
const MAX_DEPTH: usize = 8;
|
||||
Self {
|
||||
color,
|
||||
future_moves: FutureMoves::new(color, MAX_DEPTH),
|
||||
|
||||
Reference in New Issue
Block a user