No description
Find a file
Eryn Wells eb6f2000a9 [board, moves, position] Implement KingMoveGenerator
Implement a move generator that emits moves for the king(s) of a particular color.
There will, of course, only ever be one king per side in any valid board, but
this iterator can (in theory) handle multiple kings on the board. This iterator
is almost entirely copypasta of the SliderMoveGenerator. The major difference is
castling.

Castle moves are emitted by a helper CastleIterator type. This struct collects
information about whether the given color can castle on each side of the board
and then emits moves for each side, if indicated.

Do some light refactoring of the castle-related methods on Board to accommodate
this move generator. Remove the dependency on internal state and rename the
"can_castle" method to color_can_castle.

In order to facilitate creating castling moves without relying on Board, remove
the origin and target squares from the encoded castling move. Code that makes
a castling move already looks up castling parameters to move the king and rook to
the right squares, so encoding those squares was redundant. This change
necessitated some updates to position.

Lastly, bring in a handful of unit tests courtesy of Claude. Apparently, it's my
new best coding friend. 🙃
2025-05-26 23:37:33 -07:00
bitboard [bitboard, board, core, moves] Implement SliderMoveGenerator 2025-05-26 17:41:43 -07:00
board [board, moves, position] Implement KingMoveGenerator 2025-05-26 23:37:33 -07:00
core [bitboard, board, core, moves] Implement SliderMoveGenerator 2025-05-26 17:41:43 -07:00
doc Move Notes and ChessPieces docs to a doc directory 2024-01-22 19:27:08 -08:00
explorer [explorer] Remove the unused starting command; add aliases to make (m) and place (p) 2025-05-21 08:27:15 -07:00
moves [board, moves, position] Implement KingMoveGenerator 2025-05-26 23:37:33 -07:00
position [board, moves, position] Implement KingMoveGenerator 2025-05-26 23:37:33 -07:00
.gitignore Ignore the target/ directory 2023-12-19 11:13:41 -08:00
Cargo.lock [explorer, moves, core] Improve error handling in explorer 2025-05-19 14:18:31 -07:00
Cargo.toml Empty board package 2024-04-25 09:32:27 -07:00
ChessFriend.code-workspace Visual Studio Code workspace 2024-02-11 10:22:33 -07:00
Makefile WIP 2025-05-08 17:37:59 -07:00