chess:programming:polyglot_book_format:piece
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
chess:programming:polyglot_book_format:piece [2022/01/11 13:39] – peter | chess: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: | + | **Piece** is part of the [[Chess: |
- | ---- | + | It is the exclusive or of entries from the **RANDOM_PIECE** sub-array, one for each piece on the board. |
- | + | ||
- | **Piece** | + | |
The offset of the entry in **RANDOM_PIECE** corresponding to a piece is computed as follows: < | The offset of the entry in **RANDOM_PIECE** corresponding to a piece is computed as follows: < | ||
- | piece_offset=64*Piece_Type+8*Rank+File; | + | piece = 64 * Piece_Type + 8 * Rank + File; |
</ | </ | ||
---- | ---- | ||
- | **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| | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | " | + | |
<code cpp> | <code cpp> | ||
Line 41: | Line 29: | ||
</ | </ | ||
+ | ---- | ||
+ | |||
+ | **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: | [[Chess: |
chess/programming/polyglot_book_format/piece.1641908391.txt.gz · Last modified: 2022/01/11 13:39 by peter