readme: update and minor fixes
This commit is contained in:
parent
53a96f8787
commit
94bd4ec01c
|
@ -77,10 +77,11 @@ TODO
|
||||||
----
|
----
|
||||||
|
|
||||||
- [X] Support time constraints
|
- [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)
|
- [X] Precompute some pieces moves, maybe (done for knights)
|
||||||
- [ ] Transposition table that does not actually slows search down
|
- [ ] Transposition table that does not actually slows search down
|
||||||
- [ ] Check Zobrist hashes for previous point
|
- [ ] Check Zobrist hashes for previous point
|
||||||
- [X] Actual bitboard
|
- [X] Actual bitboard
|
||||||
- [ ] Some kind of move ordering could be great
|
- [ ] Some kind of move ordering could be great
|
||||||
- [ ] Multithreading (never)
|
- [ ] Multithreading (never)
|
||||||
|
- [ ] Avoid 3-fold repetitions when winning
|
||||||
|
|
|
@ -439,7 +439,7 @@ impl Board {
|
||||||
/// combination of squares either empty or occupied by an enemy
|
/// combination of squares either empty or occupied by an enemy
|
||||||
/// piece they can reach.
|
/// 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(
|
fn get_blockable_rays(
|
||||||
&self,
|
&self,
|
||||||
square: Square,
|
square: Square,
|
||||||
|
|
12
src/rules.rs
12
src/rules.rs
|
@ -97,7 +97,7 @@ fn get_piece_moves(
|
||||||
match piece {
|
match piece {
|
||||||
PAWN => {
|
PAWN => {
|
||||||
board.get_pawn_progresses(square, color)
|
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),
|
KING => board.get_king_rays(square, color),
|
||||||
BISHOP => board.get_bishop_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)));
|
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);
|
let all_wh_moves = get_piece_moves(&mut b, &mut gs, E1, WHITE);
|
||||||
assert_eq!(all_wh_moves.len(), 2);
|
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]
|
#[test]
|
||||||
|
|
Reference in a new issue