47f532cd09
fixup! Use 'ChessBoardBuilder' in validation tests
ci/woodpecker/manual/check Pipeline failed
2024-04-01 22:12:26 +01:00
4f1d2f7320
fixup! Use 'ChessBoardBuilder' in validation tests
2024-04-01 22:12:26 +01:00
27d5bb49b1
Add tests for en-passant validation
2024-04-01 21:57:18 +01:00
ba275c8875
Validate en-passant square's rank in 'ChessBoard'
2024-04-01 21:57:18 +01:00
3787149f04
Move FEN-related tests to its module
2024-04-01 21:36:25 +01:00
fe1e773717
Move 'FromFen' for 'ChessBoard' into 'fen' module
2024-04-01 21:34:01 +01:00
8b7a70b2f0
Use 'ChessBoardBuilder' in 'FromFen'
...
This will allow taking this *out* of the module, now that we don't need
to reach into the internals of 'ChessBoard'.
2024-04-01 21:32:02 +01:00
14c58a60a8
Add 'From<InvalidError>' for 'FenError'
2024-04-01 21:31:36 +01:00
1d47f29178
Use 'ChessBoardBuilder' in validation tests
...
The various tests for overlapping can't be triggered with the builder
API, so those have stayed unchanged.
2024-04-01 21:20:20 +01:00
8962fd90f4
Add 'ChessBoardBuilder'
2024-04-01 21:19:55 +01:00
bce690d363
Use 'ChessBoard::validate' in tests
...
This makes the test more explicit and exact in what they're testing.
2024-04-01 20:43:05 +01:00
4b13bd9a0b
Fix 'ChessBoard' validation test
...
It wasn't actually testing the right thing due to the typo...
2024-04-01 20:43:05 +01:00
90a9ac0f7a
Add validation error detail in 'FenError'
2024-04-01 20:43:05 +01:00
4098f188ce
Add 'ChessBoard::validate'
2024-04-01 20:43:05 +01:00
5ddab6af0e
Add 'chess_board::InvalidError'
2024-04-01 20:43:05 +01:00
c3a9a55be1
Move 'ChessBoard' to its own sub-folder
2024-04-01 19:56:48 +01:00
009cb44eab
Check all piece counts in 'ChessBoard::is_valid'
2024-04-01 19:44:24 +01:00
ea301659c0
Check for invalid pawns in 'ChessBoard::is_valid'
2024-04-01 19:11:37 +01:00
afa0172f6a
Add 'print-board' GDB command
2024-04-01 14:53:09 +01:00
9056747448
Add 'Bitboard.at' in GDB utils
2024-04-01 14:38:26 +01:00
905cca4576
Add convenience 'Square' constructor in GDB utils
2024-04-01 14:37:39 +01:00
66fff65a55
Add 'CastleRights' GDB pretty-printing
2024-04-01 13:59:41 +01:00
a1065baff5
Pre-generate the magic bitboard seeds
...
My naive RNG implementation takes about ~40 seconds to generate the
magic bitboards for both bishops and rooks (or ~1 second in release
mode).
If we pre-generate the seeds, we can instead make it ~instantaneous.
The self-modifying code is inspired by matklad [1].
[1]: https://matklad.github.io/2022/03/26/self-modifying-code.html
2024-04-01 13:59:41 +01:00
2ab1f363ea
Add 'ChessBoard::checkers'
2024-04-01 13:59:41 +01:00
eb53e27f9d
Test for opponent being in check during validation
2024-04-01 13:59:41 +01:00
b75136f7d6
Use 'ChessBoard::occupancy'
2024-04-01 13:59:41 +01:00
23a4e857a0
Add 'ChessBoard::occupancy'
2024-04-01 13:59:41 +01:00
c115e357e1
Check kings' position in 'ChessBoard::is_valid'
2024-04-01 13:59:41 +01:00
aaab439764
Add 'TryInto<Square>' for 'Bitboard'
2024-04-01 13:59:41 +01:00
0d8feca6b1
Test 'ChessBoard::{do,undo}_move' machinery
2024-04-01 13:59:41 +01:00
fb78e03656
Add FEN board parsing
...
Unfortunately, given that I *don't* want to expose all the `ChessBoard`
fields to the rest of the crate, this implementation will have to live
alongside its module instead of inside `crate::fen`...
2024-04-01 13:59:41 +01:00
2e1b732996
Add 'ChessBoard::is_valid'
2024-04-01 13:59:41 +01:00
4b2eb4604f
Add 'FenError::InvalidPosition' variant
2024-04-01 13:59:41 +01:00
63380cabbc
Implement 'Default' for 'ChessBoard'
2024-04-01 13:59:41 +01:00
22de0785fa
Add 'ChessBoard::{,un}do_move'
2024-04-01 13:59:41 +01:00
5a9b3a7d97
Add 'ChessBoard'
2024-04-01 13:59:41 +01:00
bbf5149f71
Add FEN castling rights parsing
2024-04-01 13:59:41 +01:00
4ed3105111
Add FEN piece type parsing
2024-04-01 13:59:41 +01:00
3ab73a08d8
Add FEN en-passant target square parsing
2024-04-01 13:59:41 +01:00
8866c35423
Add FEN side to move parsing
2024-04-01 13:59:41 +01:00
e8a7825215
Introduce 'FenError' enum
2024-04-01 13:59:41 +01:00
43fb428749
Add 'FromFen' trait
2024-04-01 13:59:41 +01:00
a26c532015
Add 'Move' GDB pretty-printing
2024-04-01 13:59:41 +01:00
e1a1532872
Add 'Piece' GDB pretty-printing
2024-04-01 13:59:41 +01:00
1a71854589
Add 'Rank' GDB pretty-printing
2024-04-01 13:59:41 +01:00
ca68ccf92c
Add 'File' GDB pretty-printing
2024-04-01 13:59:41 +01:00
a7ed24c752
Add 'Color' GDB pretty-printing
2024-04-01 13:59:41 +01:00
ddc8ecc474
Add 'Move'
2024-04-01 12:21:33 +01:00
856c3a873d
Deny warnings in 'clippy' pre-commit hook
2024-04-01 12:21:33 +01:00
19d0e1bd34
Add 'Bitboard::has_more_than_one'
2024-04-01 12:21:33 +01:00