readme: update and minor fixes

This commit is contained in:
dece 2020-06-28 19:53:11 +02:00
parent 53a96f8787
commit 94bd4ec01c
3 changed files with 14 additions and 3 deletions

View file

@ -77,10 +77,11 @@ TODO
----
- [X] Support time constraints
- [ ] Unmake mechanism instead of allocating nodes like there is no tomorrow
- [X] Unmake mechanism instead of allocating nodes like there is no tomorrow
- [X] Precompute some pieces moves, maybe (done for knights)
- [ ] Transposition table that does not actually slows search down
- [ ] Check Zobrist hashes for previous point
- [X] Actual bitboard
- [ ] Some kind of move ordering could be great
- [ ] Multithreading (never)
- [ ] Avoid 3-fold repetitions when winning

View file

@ -439,7 +439,7 @@ impl Board {
/// combination of squares either empty or occupied by an enemy
/// piece they can reach.
///
/// If `protection` is true, consider friend pieces in rays as well.
/// If `protection` is true, include friend pieces in rays as well.
fn get_blockable_rays(
&self,
square: Square,

View file

@ -97,7 +97,7 @@ fn get_piece_moves(
match piece {
PAWN => {
board.get_pawn_progresses(square, color)
| board.get_pawn_captures(square, color)
| board.get_pawn_captures(square, color)
}
KING => board.get_king_rays(square, color),
BISHOP => board.get_bishop_rays(square, color),
@ -541,6 +541,16 @@ mod tests {
assert!(!is_illegal(&mut b, &mut gs, &mut Move::new(E1, F1)));
let all_wh_moves = get_piece_moves(&mut b, &mut gs, E1, WHITE);
assert_eq!(all_wh_moves.len(), 2);
let mut b = Board::new_empty();
let mut gs = GameState::new();
// Pin a pawn with an enemy bishop.
b.set_square(E1, WHITE, KING);
b.set_square(F2, WHITE, PAWN);
b.set_square(H4, BLACK, BISHOP);
assert!(is_illegal(&mut b, &mut gs, &mut Move::new(F2, F3)));
assert!(is_illegal(&mut b, &mut gs, &mut Move::new(F2, F4)));
}
#[test]