Commit graph

99 commits

Author SHA1 Message Date
Bruno BELANYI 87258c1084 Add 'ChessBoard::checkers' 2022-07-30 12:38:45 +02:00
Bruno BELANYI 168d9e69ab Test for opponent being in check during validation 2022-07-30 12:38:45 +02:00
Bruno BELANYI f13d44b8e3 Add 'Bitboard::has_more_than_one' 2022-07-30 12:38:45 +02:00
Bruno BELANYI cb3b1ee745 Check kings' position in 'ChessBoard::is_valid' 2022-07-30 12:38:45 +02:00
Bruno BELANYI 934597d63d Add 'Bitboard::try_into_square' 2022-07-30 12:38:45 +02:00
Bruno BELANYI 024a41fa18 Use unchecked conversion in 'BitboardIterator 2022-07-30 12:38:45 +02:00
Bruno BELANYI eefa707c07 Silence useless clippy warnings
Those warnings are either explicitly accounted for in the code, or make
the code look worse if fixed.
2022-07-30 12:38:45 +02:00
Bruno BELANYI 2e410ba104 Make use of assignment operators for 'Bitboard' 2022-07-30 12:38:45 +02:00
Bruno BELANYI a6e8ac06b6 Add dummy 'magic::moves' module for build script
Since I'm am doing something quite *weird*, by writing a build script
that makes use of the module I am generating code for, I need to ensure
that it compiles both without the generated code, and with it.

So this dummy implementation of the module ensures that the code will
keep compiling in both cases, and panics if any of the functions that
depend on generated code are called during the build script execution.
2022-07-30 12:38:45 +02:00
Bruno BELANYI 99129e453c Make use of 'ChessBoard::default' in tests 2022-07-30 12:38:45 +02:00
Bruno BELANYI 9cddda7478 Implement 'Default' for 'ChessBoard' 2022-07-30 12:38:45 +02:00
Bruno BELANYI b5bb613b5e Test 'ChessBoard::{do,undo}_move' machinery 2022-07-30 12:38:45 +02:00
Bruno BELANYI 0cefb05017 Add FEN board parsing 2022-07-30 12:38:45 +02:00
Bruno BELANYI fb0e289fa0 Add 'ChessBoard::is_valid' 2022-07-30 12:38:45 +02:00
Bruno BELANYI 384f361da2 Add 'ChessBoard' 2022-07-30 12:38:45 +02:00
Bruno BELANYI f633c6e224 Mark'Error' as non-exhaustive
This simplifies semantic versionning constraints.
2022-07-30 12:38:45 +02:00
Bruno BELANYI 08ff8db0ac Add 'Error::InvalidPosition' variant 2022-07-30 12:38:45 +02:00
Bruno BELANYI 76577718d8 Add FEN castling rights parsing 2022-07-30 12:38:45 +02:00
Bruno BELANYI 7df442e03c Add FEN piece type parsing 2022-07-30 12:38:45 +02:00
Bruno BELANYI dba4d94e35 Add FEN en-passant target square parsing 2022-07-28 20:28:45 +02:00
Bruno BELANYI 6f0e2f732b Add FEN side to move parsing 2022-07-28 20:28:45 +02:00
Bruno BELANYI 611e12c033 Add 'Color::third_rank' 2022-07-28 20:28:45 +02:00
Bruno BELANYI dde5b69f81 Add 'FromFen' trait 2022-07-28 20:28:45 +02:00
Bruno BELANYI 7e23cb8f77 Introduce 'Error' enum 2022-07-28 20:28:45 +02:00
Bruno BELANYI 8102b08cf0 Add 'CastleRights::with_{king,queen}_side' 2022-07-28 20:28:45 +02:00
Bruno BELANYI e7e5927902 Add 'Move' 2022-07-28 20:28:45 +02:00
Bruno BELANYI 80e3ace8fc Add '*Assign' operators to 'Bitboard' 2022-07-27 23:36:54 +02:00
Bruno BELANYI 02d48fe526 Remove all useless 'allow(unused)' 2022-07-27 23:36:54 +02:00
Bruno BELANYI 915244b238 Add 'rerun-if-changed' directives to build script 2022-07-27 23:36:54 +02:00
Bruno BELANYI d2c61a81b5 Make use of generated move tables 2022-07-27 23:36:54 +02:00
Bruno BELANYI bd43535192 Move naive move generation into sub-module 2022-07-27 23:36:53 +02:00
Bruno BELANYI 8289204e4b Generate magic tables with build script 2022-07-27 23:36:53 +02:00
Bruno BELANYI d2eda07036 Make all modules at least 'pub(crate)' 2022-07-27 23:36:53 +02:00
Bruno BELANYI 0222ec4c2d Add 'Color::iter' 2022-07-27 23:36:53 +02:00
Bruno BELANYI d97e7d646e Move 'Magic' into 'seer::movegen::magic' 2022-07-27 23:36:53 +02:00
Bruno BELANYI 7dbe48ad23 Add '# Safety' section to 'unsafe fn' doc 2022-07-25 16:42:46 +02:00
Bruno BELANYI 2eb7e4c8ef Allow some clippy warnings 2022-07-25 16:42:46 +02:00
Bruno BELANYI 1a0aa5fddb Remove superfluous 'format!' call 2022-07-25 16:42:46 +02:00
Bruno BELANYI a04b1f3a42 Add magic bitboard generation 2022-07-25 16:42:46 +02:00
Bruno BELANYI 3f00c6d1fc Make 'Magic' fields 'pub(crate)' 2022-07-25 16:42:46 +02:00
Bruno BELANYI 5bee69c38e Add 'flake check' stage to CI
Now that the 'pre-commit' is in another stage, add this one back in.
2022-07-25 16:42:46 +02:00
Bruno BELANYI ae1c3322d5 Remove 'pre-commit' check from flake
Since trying to run it results into a failure due to 'clippy' trying to
fetch the network inside the build sandbox, remove it from the 'checks'
for now, but do keep it around for its 'shellHook'.
2022-07-25 16:41:27 +02:00
Bruno BELANYI c8d7c17711 Fix pre-commit check in CI
Now that we have actual dependencies, we need to run 'pre-commit run'
outside of the build sandbox.
2022-07-25 16:36:44 +02:00
Bruno BELANYI 7a120cee83 Add 'random' dependency 2022-07-24 16:34:12 +02:00
Bruno BELANYI acbbfc7c8b Add magic mask generation 2022-07-24 16:34:12 +02:00
Bruno BELANYI 6b0563b1bd Add 'Magic' type 2022-07-24 16:34:12 +02:00
Bruno BELANYI 847e18dac1 Add naive pawn move generation 2022-07-24 16:34:12 +02:00
Bruno BELANYI dbe3539a66 Add naive rook move generation 2022-07-22 10:37:12 +02:00
Bruno BELANYI 5101d8c285 Add naive bishop move generation 2022-07-22 10:37:12 +02:00
Bruno BELANYI 76f3c41110 Add naive knight move generation 2022-07-22 10:37:12 +02:00