Changes

Jump to: navigation, search

8x8 Board

1 byte removed, 03:17, 20 February 2021
no edit summary
The '''8x8 Board''' as basic square-centric board representation is either a two-dimensional [[Array|array]] of [[Byte|bytes]] (or integers), containing [[Pieces|piece]] and empty square codes, indexed by [[Files|file]] and [[Ranks|rank]] index, or more commonly a one-dimensional array indexed by a [[Squares|square]] in a 0..63 range which combines rank or file indices in three consecutive bits each <ref>[http://www.craftychess.com/hyatt/boardrep.html Chess board representations] by [[Robert Hyatt]]</ref> .
Such a board representation is often used redundantly in [[Bitboards|bitboard]] programs to answer the question which piece (if any) resides on a square efficiently. It has to deal with [[Square Mapping Considerations|square mapping]] accordantly.
 
=Alternatives=
As a lone board representation, the 8x8 board has some efficiency issues with [[Move Generation|move generation]] related to off the board test. Therefore more common are approaches dealing with that, that is [[10x12 Board|10x12 board]] with surrounding ranks and files, and [[Vector Attacks]] with its cheap test and unique square difference property with respect to [[Distance|distance]] and [[Direction|direction]] <ref>[[Fritz Reul]] ('''2009'''). ''New Architectures in Computer Chess''. Ph.D. Thesis, ''2 Non-Bitboard Architectures''</ref>. In ''Games Playing with Computers'', 1972 <ref>[http://www.chilton-computing.org.uk/acl/literature/books/gamesplaying/p003.htm Chapter 3: Board Games - 3.1 CHESS] from [[Alex Bell]] ('''1972'''). ''[http://www.chilton-computing.org.uk/acl/literature/books/gamesplaying/overview.htm Games Playing with Computers]''. [https://en.wikipedia.org/wiki/Allen_%26_Unwin Allen & Unwin], ISBN-13: 978-0080212227</ref> , [[Alex Bell]] introduced an array of 65 squares, where the purpose of square 65 (always empty) is to detect pawns capturing outside the board by a table driven move generator.
=Programming=
==Banksia==
[[Banksia]] uses only one vector <ref>https://github.com/nguyenpham/Banksia/blob/master/src/base/base.h Banksia - base.h</ref>:
 
<pre>
std::vector<Piece> pieces;
The vector is initialized <ref>https://github.com/nguyenpham/Banksia/blob/master/src/chess/chess.cpp Banksia - chess.cpp</ref>:
 
<pre>
Piece empty(PieceType::empty, Side::none);
}
</pre>
 
 
=Alternatives=
As a lone board representation, the 8x8 board has some efficiency issues with [[Move Generation|move generation]] related to off the board test. Therefore more common are approaches dealing with that, that is [[10x12 Board|10x12 board]] with surrounding ranks and files, and [[Vector Attacks]] with its cheap test and unique square difference property with respect to [[Distance|distance]] and [[Direction|direction]] <ref>[[Fritz Reul]] ('''2009'''). ''New Architectures in Computer Chess''. Ph.D. Thesis, ''2 Non-Bitboard Architectures''</ref>. In ''Games Playing with Computers'', 1972 <ref>[http://www.chilton-computing.org.uk/acl/literature/books/gamesplaying/p003.htm Chapter 3: Board Games - 3.1 CHESS] from [[Alex Bell]] ('''1972'''). ''[http://www.chilton-computing.org.uk/acl/literature/books/gamesplaying/overview.htm Games Playing with Computers]''. [https://en.wikipedia.org/wiki/Allen_%26_Unwin Allen & Unwin], ISBN-13: 978-0080212227</ref> , [[Alex Bell]] introduced an array of 65 squares, where the purpose of square 65 (always empty) is to detect pawns capturing outside the board by a table driven move generator.

Navigation menu