Commit graph

11 commits

Author SHA1 Message Date
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
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
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
9601a5657a Make all modules at least 'pub(crate)' 2024-04-01 12:21:33 +01:00
d268db38c1 Add magic bitboard generation 2024-04-01 12:21:33 +01:00
f1cdec2b5e Add magic mask generation 2024-04-01 12:21:33 +01:00