Talk:Board representation (computer chess)

message: I don't buy the foll:
By use of a jump table, adding the piece value to the program counter can go directly to the code to generate moves for this type of piece on this square. Although the program is longer than for a conventional move generation methods, no checks for the edge of the board are required, and no moves off the board are considered, increasing move generation speed. Modern CPU caches allow code relevant to the current position to be cached, giving move generation times of a few clock cycles per position. —Preceding unsigned comment added by  (talk • contribs) 
: What don't you buy exactly? Each piece is checked separately with code like this (on the ARM):
:*ANDS R0, Rmask, Rn, LSL #4*(column-1)
:*BNE piece_found_on_square_row_column
:(this is written out 64 times, once for each square, with early exit tests for Rn=0)
:Rmask = 15<<28
:n = row number (using registers R1 to R8)
:column is in the range 1-8.
: The destination for the BNE is:
: .piece_in_R0_found_on_square_row_column
: ADD table, base, #row*8+column
: LDR PC, [table, R0, LSR #26]
:The destination branch caused by the final LDR is to a piece of code which knows which piece has been found (which is also in R0), whether it is black or white (sign bit from ANDS) and what square it is (table offset is to this square). All it has to do is generate the moves for a known piece in a known position. As the board is stored in registers, this only takes a few cycles too, but that's another story. Stephen B Streater 17:39, 19 May 2006 (UTC)
replies: text:  I buy most of it, and in fact I've seen it done that way, but I don't buy the part about "a few clock cycles per position". And in fact, the point about code caching is pretty irrelevant - even without a switch statement (which is exactly what is beign described) other schemes can easily work with cached instructions. 64.174.34.250 17:55, 20 April 2007 (UTC)
thread_title: Old talk

message: I would LOVE to have sources for defining a chess position or state from a qualified source.  —Preceding unsigned comment added by Fulldecent (talk • contribs) 23:43, 11 May 2010 (UTC)
replies: text: I think the opening paragraph is different now, but to answer your concern - the elements of a chess position are either self-evident, i.e. a board with pieces on it, or they follow directly from the rules of chess. Certain state, like the player on move, castling privileges, enpassant capture and 50-move rule are invisible state that depend on the history of the game, so must be abstracted and explicitly stated.  A source for the rules of the game can be any book on chess; the final arbitor would be the FIDE Laws of Chess Handbook. Sbalfour (talk) 13:30, 10 May 2019 (UTC)
thread_title:  Sources for opening paragraph 

message: This concerns the Array Based section. I see no way using a 12x12 array could possibly be beneficial. Perhaps my problem is that I don't understand why checking that a "move is on the board" is expensive. Seems like that should be a very straight forward computation. I think this deserves clarification, but I'm not sure how to do that... --Danielx (talk) 08:53, 7 March 2011 (UTC)
replies: text: The reason is that the over sized array allows all possible moves to be enumerated without checking each one first to see if it is off the board.  This removes what in effect are a couple of array bounds checks for the row and column of each potential move generated.  It is always necessary to look at the square you are attempting to move to since you can't capture a piece of your own color, so marking the squares that are off the board to avoid row and column checks saves work.  The idea is very similar to that of a sentinel value.  In tight loops these can achieve savings of nearly 50%.  The article should explain this better.  If someone can find a good source we could use it to improve the explanation.  Quale (talk) 04:24, 8 March 2011 (UTC)
replies: text:  And 10x10 would suffice, except for knight moves, which is why 12x12 is used.  Bubba73 You talkin' to me? 20:23, 12 January 2012 (UTC)
replies: text: And actually 10x12 is sufficient as the sentinel squares off the ends of the rows on left and right can overlap.  I added an ancient reference to this technique which was widely understood in 1977.  A while later I realized that this is explained in a fair amount of detail on the Hyatt web page.  That page has been in the references for the article for a long time, but it wasn't cited directly for that claim.  The Hyatt page could provide a reference for a few other claims in the article as well. Quale (talk) 09:26, 15 January 2012 (UTC)
thread_title:  Why 12x12 array? 

message: If you want to be complete you should include the graphical representation:
In chess playing programs, a visual representation of the board can be presented to the user via the screen or printed off.  This representation is considered the most user friendly, but cannot be used for calculating the next move.  Some programs feature a 3D visual representation.
I would add this myself, but would want to hear "that is a good idea" first. 69.168.144.138 (talk) 01:24, 24 September 2011 (UTC)
thread_title:  missing representation 

message: What do you think about renaming this article as above --178.208.207.204 (talk) 20:00, 12 January 2012 (UTC)
replies: text: I think that's an excellent idea.  Quale (talk) 09:28, 15 January 2012 (UTC)
thread_title:  Rename to Board representaion (computer chess)? 

message: We've got a hodge-podge of concepts thrown into this article: data structures for representing board positions in computer automatons that play chess; UI formats (FEN) for recording and communicating game positions; and data compression techniques (Huffman) for digitizing chess positions.  FEN is covered adequately in the Chess article - maybe all we need here is a hatnote to that.  Digitizing chess positions isn't a significantly involved issue that it couldn't be relegated to a footnote in the Huffman coding article; it's certainly not enough at this point for it's own article, but it's kind of a wart here.  I'm going to be bold and restructure this article before I do any work on it. Sbalfour (talk) 17:54, 17 September 2019 (UTC)
thread_title:  Hodge-podge