User Tools

Site Tools


chess:programming:polyglot_book_format:piece

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
chess:programming:polyglot_book_format:piece [2022/01/10 14:50] peterchess:programming:polyglot_book_format:piece [2022/01/11 13:55] (current) peter
Line 1: Line 1:
 ====== Chess - Programming - Polyglot Book Format - Piece ====== ====== Chess - Programming - Polyglot Book Format - Piece ======
  
-See [[Chess:Programming:Polyglot Book Format:Position|Position]]+**Piece** is part of the [[Chess:Programming:Polyglot Book Format:Key|Key]].
  
-**Piece** is the exclusive or of entries from RandomPiece, one for each piece on the board.+It is the exclusive or of entries from the **RANDOM_PIECE** sub-array, one for each piece on the board.
  
-The offset of the entry in RandomPiece corresponding to a piece is computed as follows+The offset of the entry in **RANDOM_PIECE** corresponding to a piece is computed as follows<code> 
- +piece = 64 * Piece_Type + 8 * Rank File;
-<code> +
-offset_piece=64*kind_of_piece+8*row+file;+
 </code> </code>
  
-"row" and "file" are counted from 0 to 7. With this convention one has+----
  
-^Square^File^Rank^ +**Piece_Type** is encoded as:
-|a1|0|0| +
-|h1|7|0| +
-|a8|0|7| +
-|h8|7|7| +
- +
- +
-"kind_of_piece" is encoded as follows +
- +
-|black pawn    0 +
-|white pawn    1 +
-|black knight +
-|white knight +
-|black bishop +
-|white bishop +
-|black rook    6 +
-|white rook    7 +
-|black queen   8 +
-|white queen   9 +
-|black king   10 +
-|white king   11+
  
 <code cpp> <code cpp>
Line 51: Line 29:
 </code> </code>
  
 +----
 +
 +**Rank** and **File** are counted from 0 to 7:
 +
 +^Square^File^Rank^
 +|a1|0|0|
 +|h1|7|0|
 +|a8|0|7|
 +|h8|7|7|
 +
 +----
  
 [[Chess:Programming:Polyglot Book Format:Piece|Piece]] [[Chess:Programming:Polyglot Book Format:Piece|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