Well, you still would have to consider null move as irreversible. You do not want the losing side to be able to 'refute' two consecutive null moves of the winning side by retracting his previous move to create a 'repetition'.Karatorian wrote:Except, in shogi there are no irreversable moves ^_^
Look at it this way then: Storing and comparing the full game state (e.g. mailbox board + holdings) is quite expensive, requiring looping over the board once for every compare. Compressing the position to some much smaller signature, which does not have to be unique (and indeed cannot be, when it small enough) provided that the chance for confusion is acceptably low, speeds up the comparison process enormously. But such a non-unique signature is by defenition a hash key.I know that, I was just wondering, since my engine doesn't have much use for hashing, if I could avoid it completely.
Even calculating a Zobrist hash key for each new positon from scratch is about as expensive as doing a comparison between uncompressed boards (just a memory fetch plus one add/XOR/compare per square), and cheaper if you take the storing in the history list into account. So even with a single comparison you would earn back the time for calculating the key by shrinking the comparison time to the time it would otherwise take you to compare a single board square (or perhaps a group of 4 squares).
But of course the Zobrist hash can be calculated differentially, so that the time to do that almost shrinks to nothing as well. So it is really an extreme speedup of the repetition-detection process. Of course you can avoid it, but why would you want to avoid speed-up?
