Answers.Body: <p>Stockfish (<a href="https://stockfishchess.org/download/" rel="nofollow noreferrer">https://stockfishchess.org/download/</a>) is open source and uses magic bitboards.<br />
  Crafty (<a href="https://craftychess.com/" rel="nofollow noreferrer">https://craftychess.com/</a>) uses bitboards and is heavily commented.
  There are other using bitboards, but these two are the best.</p>
  <p>Hopefully this helps.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-06T20:36:19.550Z
Answers.LastActivityDate: 2021-01-06T20:36:19.550Z
Answers.UserDisplayName: Mike Jones
Body: <p>I am writing a C++ chess engine based on the magic bitboard, where ordering for bitboards is from LSB to MSB in Little-Endian Rank-File mapping. I'd like to have a 6x64 dimension 2D array for all possible attack sets for each piece on every square to save time during program execution.</p>
  <p>Is there a resource that has these bitboards already defined so that I don't have to spend several hours constructing them manually, or is there a way to generate the attack sets with a program?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-01-07T03:40:20.737Z
Comments.Text: @user253751 I'm having trouble figuring out a closed form formula that gives me a number (that I can use for an attack map bitboard) given a position and piece type. If there's a simple way to do this, I'd love to learn how.
Comments.UserDisplayName: Noah43554
Tags: <engines><software><bitboard>
Title: How do I find bitboard attack maps non-manually?
ThreadText: # How do I find bitboard attack maps non-manually?
  
  (Asked by: username_0 on 2021-01-06)
  
  I am writing a C++ chess engine based on the magic bitboard, where ordering for bitboards is from LSB to MSB in Little-Endian Rank-File mapping. I'd like to have a 6x64 dimension 2D array for all possible attack sets for each piece on every square to save time during program execution.
  
  Is there a resource that has these bitboards already defined so that I don't have to spend several hours constructing them manually, or is there a way to generate the attack sets with a program?
  
  **Tags:** engines, software, bitboard
  
  > **Comments:**
  > **username_0**: @user253751 I'm having trouble figuring out a closed form formula that gives me a number (that I can use for an attack map bitboard) given a position and piece type. If there's a simple way to do this, I'd love to learn how.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-01-06. Score: 0 | Accepted answer
  
  Stockfish (<https://stockfishchess.org/download/>) is open source and uses magic bitboards.  
  Crafty (<https://craftychess.com/>) uses bitboards and is heavily commented.
  There are other using bitboards, but these two are the best.
  
  Hopefully this helps.
  
  
  ---
  
  