user3468: I am writing a C++ chess engine and I am looking for magic numbers for Little-Endian Rank-File Mapping bitboards to generate moves for sliding pieces.
The rival chess website gives magic numbers but not for the same board mapping.
The chess programming wiki gives some of the best magic numbers so far but is not exhaustive.
At the end I am looking for four things:

occupancy mask for each square
magic number for each square
magic shifts for each square
moves database array for each square

So I can use the following code to find the moves of the Rook on C3 (for instance):
bbBlockers = bbAllPieces & occupancyMaskRook[C3]

databaseIndex = (int)((bbBlockers * magicNumberRook[C3]) >> rookMagicShifts[C3])

bbMoveSquares = magicMovesRook[C3][databaseIndex] & ~bbFriendlyPieces


user825: This is a very well known problem in chess programming. You should consider use the numbers generated by Pradyumna Kannan. Dr Kannan had kindly produced open-source the magic numbers. It is being used by Crafty and a few other chess engines including my own.
You can read more by google "Crafty magic number".
I've prepared a zipped file for you here. This is the same files being used in the SmallChess chess engine app. Please read the documentation. Basically, you'll need to call Rmagic(square, occupancy) for rooks and Bmagic(square, occupancy) for bishops. You can XOR those into a queen mask.

3468: <p>I am writing a C++ chess <a href="https://github.com/RomainGoussault/Deepov">engine</a> and I am looking for magic numbers for <a href="https://chessprogramming.wikispaces.com/Square+Mapping+Considerations#LittleEndianRankFileMapping">Little-Endian Rank-File Mapping</a> bitboards to generate moves for sliding pieces.</p>

<p>The rival chess <a href="http://www.rivalchess.com/magic-bitboards/">website</a> gives magic numbers but not for the same board mapping.</p>

<p>The chess programming wiki gives <a href="https://chessprogramming.wikispaces.com/Best+Magics+so+far">some of the best magic numbers so far</a> but is not exhaustive.</p>

<p>At the end I am looking for four things:</p>

<ul>
<li>occupancy mask for each square</li>
<li>magic number for each square</li>
<li>magic shifts for each square</li>
<li>moves database array for each square</li>
</ul>

<p>So I can use the following <a href="http://www.rivalchess.com/magic-bitboards/">code</a> to find the moves of the Rook on C3 (for instance):</p>

<pre><code>bbBlockers = bbAllPieces &amp; occupancyMaskRook[C3]

databaseIndex = (int)((bbBlockers * magicNumberRook[C3]) &gt;&gt; rookMagicShifts[C3])

bbMoveSquares = magicMovesRook[C3][databaseIndex] &amp; ~bbFriendlyPieces
</code></pre>
 825: <p>This is a very well known problem in chess programming. You should consider use the numbers generated by Pradyumna Kannan. Dr Kannan had kindly produced open-source the magic numbers. It is being used by Crafty and a few other chess engines including my own.</p>

<p>You can read more by google "Crafty magic number".</p>

<p>I've prepared a zipped file for you <a href="http://smallchess.com/MagicMoves.zip">here</a>. This is the same files being used in the SmallChess chess engine app. Please read the documentation. Basically, you'll need to call <em>Rmagic(square, occupancy)</em> for rooks and <em>Bmagic(square, occupancy)</em> for bishops. You can XOR those into a queen mask.</p>
