User Tools

Site Tools


chess:programming:magic_bitboards:calculate_magic_numbers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
chess:programming:magic_bitboards:calculate_magic_numbers [2021/10/27 23:31] – [Determine Magic Numbers] peterchess:programming:magic_bitboards:calculate_magic_numbers [2021/10/28 00:00] (current) – [Determine Magic Numbers] peter
Line 98: Line 98:
   * **magic** is the random 64-bit number.   * **magic** is the random 64-bit number.
     * At this time this is done by trial-and-error, as no known formula to provide a perfect solution.     * At this time this is done by trial-and-error, as no known formula to provide a perfect solution.
 +      * It is just luck/probability that a number is found that happens to calculate unique indices for unique MoveBoards.
     * Ideally no gaps should be between each index, i.e. a perfect hash.     * Ideally no gaps should be between each index, i.e. a perfect hash.
  
Line 106: Line 107:
     * The MoveBoard are just stored at the index calculated by these pre-programmed good magics.     * The MoveBoard are just stored at the index calculated by these pre-programmed good magics.
  
 +  * While this example of the Rook at e4 has 1024 BlockerBoards, each of which has a corresponding MoveBoard, you may end up storing less than 1024 MoveBoards.
 +    * For two different BlockerBoards that have the same MoveBoard, the magic could calculate two different indices or it could calculate the same index for both.
 +    * As long as the MoveBoards are the same, it is okay for the index to collide. 
  
 </WRAP> </WRAP>
chess/programming/magic_bitboards/calculate_magic_numbers.1635377495.txt.gz · Last modified: 2021/10/27 23:31 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki