jordanbray / chess

A rust library to manage chess move generation
https://jordanbray.github.io/chess/
MIT License
234 stars 54 forks source link

Bug in MoveGen when setting a mask #21

Closed s-arash closed 5 years ago

s-arash commented 5 years ago

Looks like MoveGen misses moves when a mask is set. Here is my test code:

let board = Board::from_str("r1bqkb1r/pp3ppp/5n2/2ppn1N1/4pP2/1BN1P3/PPPP2PP/R1BQ1RK1 w kq - 0 9").unwrap();

let mut capture_moves = MoveGen::new_legal(&board);
let targets = *board.color_combined(!board.side_to_move());
capture_moves.set_iterator_mask(targets);

for m in capture_moves{
    print!("{}, ", m);
}

It only prints this move:

f4e5,
jordanbray commented 5 years ago

This is resolved in 3.1.1.