Skip to content

Board Representation

Nick Slerts edited this page Dec 30, 2015 · 6 revisions

###Boards

  • bitboards
  • long datatype (64 bits)
    • each bit represents a board square
    • 0 = top left, 63 = bottom right
    • each 1 represents either
      • a piece is present at that location
      • a square that exists as part of a mask

###Pieces

  • white: wP, wN, wB, wR, wQ, wK
  • black: bP, bN, bB, bR, bQ, bK
    • P = pawn
    • N = knight
    • B = bishop
    • R = rook
    • Q = queen
    • K = king

###Generation

  • Start with string array and have function create corresponding bitboards
  • function should take string array board representation along with all bitboards
    • or maybe bit boards should be global to class?
    • pieces in string array are converted to 1s in corresponding bitboard
      • I think logic crazy's understanding of substring is wrong, if I understand his code properly he's producing 65 bit strings where the 1 bit is off to the left by a single bit and then converting them to a long. Need to confirm though.
      • easiest way to overcome is to just pass a substring of the first 64 bits. I believe the 65th bit will always be a 0 which shouldn't effect the outcome.
      • I think I was thinking about this wrong, since long is 64bit length just need to ensure adding extra 0s won't cause an overflow. if not then 64bit cutoff occurs automatically
Clone this wiki locally