Commit graph

5 commits

Author SHA1 Message Date
bf2bccbc7d [board] Implement PositionBuilder::from_position
Create a PositionBuilder from a Position.
2024-01-22 08:12:55 -08:00
dbbf2d4c46 [board] Implement ply and full move counters on Position
Pipe these numbers through the Builders
2024-01-21 15:10:04 -08:00
f90ea2d1be [board] Add a test for capturing en passant; fix the bugs
I wrote a test for capturing en passant that revealed some bugs. Cool!

Implement the missing part of move validation that checks for an en passant move.
Implement PositionBuilder::to_move() to set player_to_move.

The most difficult part of this fix was finding the logic error in
Move::is_en_passant(). Instead of checking for non-zero, check for equality against
the en passant flag value. Checking for non-zero was causing this method to return
true in the double push case.
2024-01-21 11:21:37 -08:00
fa1c6b452e [board] Remove BoardSide enum; use Castle everywhere
Move Castle to a castle module inside the move module.
Implement into_index() on Castle to turn it into a usize.
2024-01-21 10:38:50 -08:00
4a5ae8ec59 [board] Move position builders into a builders module
Move PositionBuilder to position_builder.rs and export it from the builders module.
2024-01-21 09:20:03 -08:00
Renamed from board/src/position/builders.rs (Browse further)