| 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.RequirementsWhat exactly for is chess position anyway? It's more than just the the two to sixteen pieces on the board.
TypesArray BasedOne 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 MethodSpecial 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
[ 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 |
| Copyright © 1995-2005 eBay Inc. All Rights Reserved. Designated trademarks and brands are the property of their respective owners. Use of this Web site constitutes acceptance of the eBay User Agreement and Privacy Policy. |
eBay official time |