- Remove unused std::fmt::Write import
- Refer to the piece! macro with $crate (I didn't know this was legal??)
- Remove the doc comments on Position::flags
- Remove {set,clear}_player_has_right_to_castle_flag
- Remove an extraneous local variable from Position::place_piece()
The Builder enables cleanly building a BitBoard out of squares.
The macro lets you create a BitBoard from a simple list of coordinates:
bitboard!(A1, B2, C3, D4, …)
Add a new Sight trait, implemented by PlacedPiece. The implementation of this
trait produces a BitBoard representing the squares visible to the placed piece.
- ASCIIDisplay → format a type using ASCII only characters
- UnicodeDisplay → format a type using any Unicode characters
- FENDisplay → format a type for inclusion in a FEN string
This macro implements a tiny DSL for creating Pieces and PlacedPieces.
"White King" → Piece::new(Color::White, Shape::King)
"White King on E4" → PlacedPiece::new(Piece::new(Color::White, Shape::King), Square::E4)
Define some constants in Square that refer to the starting positions of the two
kings, and the target castling squares. Then implement the following methods that
use those constants to determine if a move is a castle.
- Move::is_kingside_castle()
- Move::is_queenside_castle()
- Move::is_castle()
These checks only apply to King moves, and if the king is moving from and to
specific squares.
Implement a bishop move generator using the "classical" approach.
This approach walks each ray to find blockers and then masks out friendly pieces.
This is not efficient compared to other approaches, but it's much easier to implement.
Implement a bishop move generator using the "classical" approach.
This approach walks each ray to find blockers and then masks out friendly pieces.
This is not efficient compared to other approaches, but it's much easier to implement.
Implement a rook move generator using the "classical" approach.
This approach walks each ray to find blockers and then masks out friendly pieces.
This is not efficient compared to other approaches, but it's much easier to implement.
This bit scanner iterates populated bits in a BitBoard from the trailing (least-significant) end.
Rename BitScanner → LeadingBitScanner.
Factor implementation of these two into a macro.
Clean up iterator returned by BitBoard::occupied_squares
Implement BitBoard::occupied_squares_trailing
While implementing these move generators, I realized I was duplicating a lot of code. So, I started thinking about how to do less of that. I create a MoveGeneratorInternal trait that these move generators implement. This trait provides default implementations of several methods.
I also discovered that I needed a way to keep track of move sets per piece for each kind (shape) of piece. The new move generators, and the generators still to come, can now keep track of moves per piece separately in MoveSet instances.