Commit graph

65 commits

Author SHA1 Message Date
54d2e78954 Add '*Assign' operators to 'Bitboard' 2024-04-01 12:21:33 +01:00
4de41a5544 Remove all useless 'allow(unused)' 2024-04-01 12:21:33 +01:00
be506747f8 Tighten item visibilities 2024-04-01 12:21:33 +01:00
6feca16b61 Add 'BitboardIterator::new' 2024-04-01 12:21:33 +01:00
9cf5fc3852 Add bitboard-based move generation 2024-04-01 12:21:33 +01:00
8fe444c59a Expose magic bitboard generation to parent module 2024-04-01 12:21:33 +01:00
6cc0380b02 Add 'MagicMoves' 2024-04-01 12:21:33 +01:00
fd3da78224 Make 'Magic' 'pub(crate)' 2024-04-01 12:21:33 +01:00
01966d1015 Add missing derives to 'Magic' 2024-04-01 12:21:33 +01:00
2254830ddc Move 'Magic' to 'wizardry' submodule 2024-04-01 12:21:33 +01:00
a4fd4f5cc4 Move naive move generation into sub-module 2024-04-01 12:21:33 +01:00
9601a5657a Make all modules at least 'pub(crate)' 2024-04-01 12:21:33 +01:00
5b56fcfcda Add 'Color::iter' 2024-04-01 12:21:33 +01:00
d268db38c1 Add magic bitboard generation 2024-04-01 12:21:33 +01:00
3410ba518e Make 'Magic' fields 'pub(crate)' 2024-04-01 12:21:33 +01:00
f1cdec2b5e Add magic mask generation 2024-04-01 12:21:33 +01:00
55d9780156 Add 'Magic' type 2024-04-01 12:21:33 +01:00
3eb140b757 Add naive pawn move generation 2024-04-01 12:21:33 +01:00
b1a460a580 Add naive rook move generation 2024-04-01 12:21:33 +01:00
f7fc30227a Add naive bishop move generation 2024-04-01 12:21:33 +01:00
0c4b011386 Add naive knight move generation 2024-04-01 12:21:33 +01:00
064846a4fd Add naive king move generation 2024-04-01 12:21:33 +01:00
7ccca5a593 Remove spurious links in 'Square' documentation 2024-04-01 12:21:33 +01:00
a4952376a1 Remove spurious links in 'Bitboard' documentation 2024-04-01 12:21:33 +01:00
34b9c18ca5 Add 'Bitboard::iter_powerset' 2024-04-01 12:21:33 +01:00
1ea4cd0ea4 Add 'Piece' enum 2024-04-01 12:21:33 +01:00
42126e1c88 Add 'NUM_VARIANTS' constant to all 'board' enums 2024-04-01 12:21:33 +01:00
3f93417092 Consistently use 'Self' type in 'impl' blocks 2024-04-01 12:21:33 +01:00
568c369683 Fix typo in 'board::Color' documentation 2024-04-01 12:21:33 +01:00
f405246127 Add 'Color::slide_board_with_blockers' 2024-04-01 12:21:33 +01:00
6e871dbfe6 Improve 'board::BitboardIterator'
* Accurate 'size_hint'.
* Exact size.
* Fused iterator (keeps returning 'None' after returning 'None' once).
2024-04-01 12:21:33 +01:00
c571b53840 Add 'Color::{forward,backward}_direction' 2024-04-01 12:21:33 +01:00
04ef282815 Add 'CastleRights::unmoved_rooks' 2024-04-01 12:21:33 +01:00
96b9e0f6d7 Add 'CastleRights::without_{king,queen}_side' 2024-04-01 12:21:33 +01:00
d8e003ef94 Add 'CastleRights::has_{king,queen}_side' 2024-04-01 12:21:33 +01:00
688b624dd1 Add 'CastleRights' enum 2024-04-01 12:21:33 +01:00
3553428bb9 Add 'Color' enum 2024-04-01 12:21:33 +01:00
ffaad7b7d4 Rename 'board::direction{s,}' 2024-04-01 12:21:33 +01:00
a6f4e7e686 Statically assert zero-cost invariants
Since some or all of those invariants will come in handy to ensure we
use as little memory as possible, to maximize the speed of the move
generation later on.
2024-04-01 12:21:33 +01:00
accbbef64e Add 'static_assert' macro 2024-04-01 12:21:33 +01:00
c6916cc21a Add 'Bitboard::{LIGHT,DARK}_SQUARES 2024-04-01 12:21:33 +01:00
5a9f0db1b9 Make use of 'Bitboard::is_empty' 2024-04-01 12:21:33 +01:00
63058f6c4a Add 'Bitboard::is_empty' 2024-04-01 12:21:33 +01:00
eba64a98d4 Add 'Direction::slide_{square,board}' 2024-04-01 12:21:33 +01:00
5ef6e545f3 Add 'Bitboard::{ANTI_,}DIAGONAL' 2024-04-01 12:21:33 +01:00
21eecbdac9 Add 'Direction::move_square' 2024-04-01 12:21:33 +01:00
be3a8030a7 Add 'Direction::iter_{rook,bishop,royalty,knight}' 2024-04-01 12:21:33 +01:00
d03e251050 Add 'Direction::move_board'
Encapsulates the way to move a piece on a board, avoiding the need to
mask and shift by hand.
2024-04-01 12:21:33 +01:00
c95d7f078a Add 'board::Direction' enum 2024-04-01 12:21:33 +01:00
8e2b7c1714 Use 'Square::index' in 'Square::{file,rank}_index' 2024-04-01 12:21:33 +01:00