chess:programming:polyglot_book_format:piece

This is an old revision of the document!


Chess - Programming - Polyglot Book Format - Piece

See Position

Piece is the exclusive or of entries from RandomPiece, one for each piece on the board.

The offset of the entry in RandomPiece corresponding to a piece is computed as follows.

offset_piece=64*kind_of_piece+8*row+file;

“row” and “file” are counted from 0 to 7. With this convention one has

SquareFileRank
a100
h170
a807
h877

“kind_of_piece” is encoded as follows

  constexpr int BlackPawn   = 0;
  constexpr int WhitePawn   = 1;
  constexpr int BlackKnight = 2;
  constexpr int WhiteKnight = 3;
  constexpr int BlackBishop = 4;
  constexpr int WhiteBishop = 5;
  constexpr int BlackRook   = 6;
  constexpr int WhitekRook  = 7;
  constexpr int BlackQueen  = 8;
  constexpr int WhiteQueen  = 9;
  constexpr int BlackKing   = 10;
  constexpr int WhiteKing   = 11;
  constexpr int None        = 12;

Piece

chess/programming/polyglot_book_format/piece.1641826215.txt.gz · Last modified: 2022/01/10 14:50 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki