PieceLists
Home * Board Representation * Piece-Lists
[ Paul Klee - Birds Swooping Down and Arrows [1] Piece-Lists,
lists or arrays of all up to 32 pieces (including pawns and king) on the board. Likely, type and color of pieces are associated by a certain index range or disjoint lists or arrays. Each element of the list or array for each particular piece associates the square occupied by this piece.
New Architecture
As elaborated in his thesis New Architectures in Computer Chess, Chapter 2 Non-Bitboard Architectures [3], Fritz Reul keeps disjoint piece lists in his 32-bit program Loop Leiden, even disjoint lists for bishops with different square color, for multiple loops per piece-type and ray-directions for sliding pieces with compact loop bodies with piece specific code, for instance the blocker loops in capture generation. For an efficient incremental update in making and unmaking moves with from- and to-coordinates, an index board - like the common piece board, indexed by those square coordinates - keeps piece-type relative indíces to the appropriate piece lists. The following sample demonstrates how rooks are traversed and how the data structure concerning a single move list of white rooks is updated after making and then unmaking two consecutive moves.
Declaration
Piece List Traversal
The piece list traversal for instance in move generation is straight forward or backward.
Forward
Backward
Incremental Update
Incremental update is demonstrated by making Rb5-b8, Ra8xb8 concerning the white rook list and index board, ignoring the black lists and piece array. Since removing a captured piece is done by copying the last piece of the list to fill the gap of the removed piece, but inserting in unmake is done by appending at the end of the list, the piece list of one piece-type may be shuffled in “random” order, yielding in changed move ordering and SEE rarely producing different results, since pieces like rook and knight may traversed in different order.
Make Moves
Unmake Moves
Linked Lists
Some programs apply linked lists instead of arrays for an efficient removal and insertion of pieces while making or unmaking captures. Sample declaration and code was proposed by Daniel Shawul in CCC [4].
See also
Publications
- Dietrich Prinz (1952). Robot Chess. Research, Vol. 6, reprinted 1988 in Computer Chess Compendium
- Alex Bell (1972). Games Playing with Computers. Allen & Unwin, ISBN-13: 978-0080212227
- Peter Jennings (1976). MicroChess, a Chess playing program for the 6502 Microcomputer. pdf, Courtesy of Peter Jennings, The Computer History Museum
- Fritz Reul (2009). New Architectures in Computer Chess. Ph.D. Thesis, pdf
Forum Posts
1994 …
- Speed up UpdatePieceList by Vincent Diepeveen, gnu.chess, April 18, 1994
- piece list possibilities by Tom Kerrigan, CCC, July 07, 1998
- is the “dead bit” a good idea? by Tom Kerrigan, CCC, July 20, 1998
2000 …
- Re: C or C++ for Chess Programming? by Dan Newman, CCC, August 23, 2000
- “Piece List” - Administration? by Axel Grüttner, CCC, March 03, 2003
- Two questions for bitboard experts by Tord Romstad, Winboard Forum, November 06, 2004 » Bitboards, In Between
- Piece-list representation by Alessandro Scotti, Winboard Forum, July 17, 2005
- Piece List questions by Andrew Short, CCC, September 04, 2008
2010 …
- GetSmallestAttacker() in 16x12 board representation by metax, CCC, January 17, 2010 » Static Exchange Evaluation
- Re: Is there such a thing as branchless move generation? by Daniel Shawul, CCC, June 10, 2012
- Fast lookup of pieces for move generation without bitboards by Shawn Chidester, CCC, September 10, 2015
- PieceLists ? by Mahmoud Uthman, CCC, February 10, 2017
- piece lists advantage with bit-boards? by Mahmoud Uthman, CCC, December 24, 2018
Re: piece lists advantage with bit-boards? by Ronald de Man, CCC, December 26, 2018 » Stockfish, asmFish
2020 …
- PieceList in older versions of Glaurung Chess Engine by shahil4242, CCC, June 19, 2021 » Glaurung
Re: PieceList in older versions of Glaurung Chess Engine by Tord Romstad, CCC, June 19, 2021
External Links
- Chapter 3: Board Games - 3.1 CHESS from Alex Bell (1972). Games Playing with Computers. Allen & Unwin, ISBN-13: 978-0080212227
References
- ↑ Paul Klee - Birds Swooping Down and Arrows, 1919, [1] Wikimedia Commons, Metropolitan Museum of Art
- ↑ Peter Jennings (1976). MicroChess, a Chess playing program for the 6502 Microcomputer. pdf, Courtesy of Peter Jennings, The Computer History Museum
- ↑ Fritz Reul (2009). New Architectures in Computer Chess. Ph.D. Thesis, Chapter 2 Non-Bitboard Architectures
- ↑ Re: Is there such a thing as branchless move generation? by Daniel Shawul, CCC, June 10, 2012