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/11 13:39] 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:Key|Key]]+**Piece** is part of the [[Chess:Programming:Polyglot Book Format:Key|Key]].
  
----- +It is the exclusive or of entries from the **RANDOM_PIECE** sub-array, one for each piece on the board.
- +
-**Piece** 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 **RANDOM_PIECE** corresponding to a piece is computed as follows: <code> The offset of the entry in **RANDOM_PIECE** corresponding to a piece is computed as follows: <code>
-piece_offset=64*Piece_Type+8*Rank+File;+piece = 64 * Piece_Type + 8 * Rank + File;
 </code> </code>
  
 ---- ----
  
-**Rank** and **File** are counted from 0 to 7: +**Piece_Type** is encoded as:
- +
-^Square^File^Rank^ +
-|a1|0|0| +
-|h1|7|0| +
-|a8|0|7| +
-|h8|7|7| +
- +
----- +
- +
-"Piece_Type" is encoded as:+
  
 <code cpp> <code cpp>
Line 41: 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.1641908391.txt.gz · Last modified: 2022/01/11 13:39 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki