Commit graph

14 commits

Author SHA1 Message Date
a9268ad194 [position] Add move tracking to Position
Create a new MoveRecord struct that tracks the move (aka ply) and irreversible
board properties. This should make it easier to unmake moves in the future.
2025-05-23 10:00:20 -07:00
05c62dcd99 [position] Remove CastleEvaluationError from this crate
It moved to board.
2025-05-23 09:58:29 -07:00
dbca7b4f88 [position, board] Move castle, movement, and sight modules to the board crate
Nothing about this code depends on Position, so push it down to a lower layer.
2025-05-21 10:08:59 -07:00
7c9c5484ba [position, board] Remove a bunch of dead code 2025-05-20 19:29:39 -07:00
0c1863acb9 [board, core, moves, position] Implement castling
Implement a new method on Position that evaluates whether the active color can castle
on a given wing of the board. Then, implement making a castling move in the position.

Make a new Wing enum in the core crate to specify kingside or queenside. Replace the
Castle enum from the board crate with this one. This caused a lot of churn...

Along the way fix a bunch of tests.

Note: there's still no way to actually make a castling move in explorer.
2025-05-19 16:50:30 -07:00
a78526befa [position] Move make_move to its own module: position::make_move
Rework sight.rs and add a new module, movement.rs, to calculate piece sight and
movement. I discovered during this process that "sight" and "movement" are different
because pawns (in particular) can move in ways that don't follow their sight lines.
The routines in the movement module account for this, but also pass through to the
sight routines for other pieces.
2025-05-18 08:12:10 -07:00
091cc99cb3 WIP 2025-05-08 17:37:51 -07:00
f96fa79dc1 [position] Remove fen.rs 2024-07-13 08:14:33 -07:00
d668091d0d Replace uses of types in r#move with types from the moves package types 2024-02-25 09:52:40 -08:00
36db46ac18 Move position::tests → testing
Expand information printed in assert_move_list
2024-02-25 09:20:45 -08:00
f4e57d7d6c [position] Implement all the example positions from Peter Ellis Jones' blog post
https://peterellisjones.com/posts/generating-legal-chess-moves-efficiently/
2024-02-03 15:16:00 -08:00
8aa5dacfc8 Initial implementation of CheckingPieces and Position::checking_pieces() 2024-01-30 08:53:13 -08:00
cd3cb82192 Add an assert_move_list! macro to help with verifying move lists 2024-01-29 14:46:41 -08:00
220da08727 Directly rename board -> position 2024-01-28 09:56:57 -08:00
Renamed from board/src/lib.rs (Browse further)