Commit graph

11 commits

Author SHA1 Message Date
Bruno BELANYI 52772167a6 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 22:20:39 +01:00
Bruno BELANYI 02768b6d96 Remove all useless 'allow(unused)' 2024-04-01 22:20:39 +01:00
Bruno BELANYI af421a9452 Tighten item visibilities 2024-04-01 22:20:39 +01:00
Bruno BELANYI 459b878342 Expose magic bitboard generation to parent module 2024-04-01 22:20:39 +01:00
Bruno BELANYI 2bdfbbf467 Add 'MagicMoves' 2024-04-01 22:20:39 +01:00
Bruno BELANYI d519cfb817 Make 'Magic' 'pub(crate)' 2024-04-01 22:20:39 +01:00
Bruno BELANYI 25494700d7 Add missing derives to 'Magic' 2024-04-01 22:20:39 +01:00
Bruno BELANYI 028c4543e7 Move 'Magic' to 'wizardry' submodule 2024-04-01 22:20:39 +01:00
Bruno BELANYI 23d01d4d3f Make all modules at least 'pub(crate)' 2024-04-01 22:20:39 +01:00
Bruno BELANYI 066d442823 Add magic bitboard generation 2024-04-01 22:20:39 +01:00
Bruno BELANYI 1951db0720 Add magic mask generation 2024-04-01 22:20:39 +01:00