Changes

Jump to: navigation, search

Pieces

169 bytes removed, 12:38, 29 June 2021
no edit summary
There are six types of pieces for each side, in total twelve different men. Since only one piece may occupy one [[Squares|square]] at a time, one usually expands the range of piece codes with the Nil-Piece aka empty square, often encoded as zero. Depending on the [[Board Representation|board representation]], some programmers introduce an artificial blocking piece, which surrounds the embedded [[8x8 Board|8x8 boards]] inside a [[10x12 Board|10x12 board]] for cheaper off the board tests in offset [[Move Generation|move generation]].
For cheaper extraction, most programmers prefer distinct coding of piece-types and the color of piece. Quite common is to use three bits to encode the piece-type plus one bit or [[General Setwise Operations#TheTwosComplement|Two's Complement]] (not recommend for languages with zero based array indices, like [[C]], [[Cpp|C++]] or [[Java]]) for the color.
Other programs distinguish not only piece-type and color, but enumerate all 32 pieces from their [[Initial Position|initial position]], which label or code does not change during the course of a game (even after a possible [[Promotions|promotion]] of a pawn) and might be one-to-one associated with the bit-position of a 32-bit [[Piece-Sets|piece set]], and/or are used to index a [[Piece-Lists|piece list]] containing the current [[Squares|square]] the piece resides on.
</pre>
==<span id="Unicode"></span>Unicode==
===Symbols===[https://en.wikipedia.org/wiki/Chess_symbols_in_Unicode Chess symbols] in [https://en.wikipedia.org/wiki/Unicode Unicode] <ref>, see also the [https://commons.wikimedia.org/wiki/File:Chess_Pieces_Sprite.svg Chess pieces[2D Graphics Board#Unicode|Unicode Board]] originally by User:Cburnett in a sprite image for use in computer applications, September 25, 2014, [https://en.wikipedia.org/wiki/Wikimedia_Commons Wikimedia Commons]</ref>:
{| class="wikitable"

Navigation menu