From collectibles to cars, buy and sell all kinds of items on eBay
home | pay | site map
Shop for itemsSell your itemTrack your eBay activitiesLearn, connect, and stay informed-for business and for funGet help, find answers and contact Customer SupportAdvanced Search
Home > Listing Index > Games > Board representation (chess)

Games - Board representation


In computer chess software developers must choose a data structure to represent chess positions. This is called the board representation. The choice made will affect the the entire software project.

Requirements

What exactly for is chess position anyway? It's more than just the the two to sixteen pieces on the board.

  • Which side is next to move?
  • Status of the three turn repitition draw rule.
  • Status of the 50-move draw rule.
  • Is black or white permanently disqualified to castle?
  • Is an En-passant capture possible and where?
Every other aspect of the game state is determined by the pieces on the board.

Types

Array Based

One of the simplest ways to represent a board is to create an 8x8 two-dimensional array (or, equivalently, a 64 element one-dimensional array). Each array element would identify what piece or pawn occupied the given square, or alternatively, if the square is empty. A common encoding is to consider 0 as empty, positive as white, and negative as black, e.g., white knight +1, black knight -1, white bishop +2, and so on.

One problem with this approach is that knight moves must be carefully examined to make sure they do not go "off the board". One solution is to use a 12x12 array instead, with the outer edges filled with nonsense blocking pieces; this means that knight moves do not have to implement special edge-checking code.

Better memory usage can be achieved with a 10x12 array, which provides the same functionalities as a 12x12 one by overlapping the leftmost and rightmost edge files (which are marked as off-the board). Some chess engines use 16x16 arrays to improve the speed of the rank and file number conversion and allow some special coding tricks for attacks etc.

0x88 Method

Special array that is double sized. Illegal squares can be found by using a bitwise mask of 88 base 16. See Hyatt's website for an explanation (link below).
Implementations
  • Open source 0x88 engine rated at about 2200 ELO.
=== Bitboard
=== The most advanced board representation is the bitboard. A bitboard is a 64-bit sequence of bits (0 or 1), which indicates the absence or presence (false or true) of some state about each place on the board. A board position can then be represented using a series of bitboards. For example, a series of bitboards for each piece type or pawn, for each side, can represent the board position. See the Bitboard
article.

[ Visit the complete Wikipedia entry for Board representation (chess) ]


Searches on eBay

Some related entries: Podtacular | Destination Games | Outer World Investigation Agency | Alternanthera | Adam Logan | Spaceships of EVE Online | Arco-flagellation | Taxicab geometry | Hane Yasumasa | Latias | Pool hall

eBay Pulse | eBay Reviews | eBay Stores | Half.com | Kijiji | PayPal | Popular Searches | ProStores | Rent.com | Shopping.com
Australia | Austria | Belgium | China | France | Germany | India | Italy | Spain | United Kingdom

About eBay | Announcements | Security Center | Policies | Site Map | Help