![]() | This article is rated Start-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||
|
Zobrist hashing was originally invented for computer chess and is the most popular hash method there. For chess you need 13 different values (for 6 piece types for each side, or an empty square) at each square. In addition it is best to hash in the castling and en-passent status as well. All this makes it a bit more complicated than for go, but still quite manageable. There are the same benefits, in that it is very efficient to incrementally update the hash value after making a move: only the squares affected need their contributuitions recalculated rather than the whole board. 198.142.44.32 00:37, 23 March 2007 (UTC)
The text says:
Zobrist hashing starts by randomly generating bitstrings for each possible element of a board game, i.e. for each combination of a piece and a position (in the game of chess, that's 12 pieces × 64 board positions, or 14 if a king that may still castle and a pawn that may capture en passant are treated separately)
I believe that's incorrect. There are 10 different pieces that can be anywhere in the board (5 for each side). The pawns can be in any of (64-16) possible places, because they can't be at the first or last row. A white pawn that can capture en passant can only be in one of eight positions, and same for a black pawn, not in the whole 64 positions. A white king that may still castle must be in its original position, and there's no mention of rooks that may still castle, for which there is also one additional position for each. So the actual total is (5×64+1×(64-16)+1×8+1+2)×2. -- pgimeno ( talk) 14:51, 19 July 2014 (UTC)
The pseudocode is uncited, and almost certainly original art. I propose deleting it, if such citation is not forthcoming. Sbalfour ( talk) 15:18, 24 September 2019 (UTC)
Besides the pseudocode, in two sections (which is original art and must go), the entire article rambles... the one paragraph presentation in Tabulation hashing#History is a very concise and very accurate presentation. Maybe we can dispose of this article altogether and just redirect the page to that section. See also Hash function#Zobrist hashing - we could also merge it there. We need to get it out of our heads that the encyclopedia is a how-to manual. We describe the algorithm, we don't code it. Sbalfour ( talk) 15:34, 24 September 2019 (UTC)