I read about Looking for Magics for Magic Bitboard, they mentioned the method "Feeding in Randoms".
As I understand, this method works like this:
label RETRY;
magic = random();//trial
for (all cases of current square: from first case to last case)
{
if (magic fails at any case)
go to label RETRY;//and error
}
//Passed all cases -> success! now we have the magic for square 1, 63 more squares to go
The author said
On my Core Duo 2.8 GHz, it takes less than a second to find magic numbers for rooks and bishops for all squares
If we successfully get magic numbers with this "Randoms" method, why not just save the magic numbers to disk and load it from disk instead of running the "Feeding in Randoms" code every time at startup (that the author cares about how fast this method, isn't it faster just read the magic from disk instead of trial and error with random. If load from disk, it doesn't matter if the method takes whole day to find magic)?
Maybe I misunderstand something about this. So I want to ask Why have to find magic instead of just loading from disk?