Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Move Make/Unmake Questions

Author: Angrim

Date: 14:46:08 07/16/99

Go up one level in this thread


On July 15, 1999 at 10:28:24, Dan Homan wrote:


>One idea I had was just doing a bit-shift to undo moves.  The idea
>is that a square on my board would be an int (or perhaps int64), but only
>the first 4 bits would store piece/color information.  Then I could
>store 8 (or 16) "states" for a given square - all in order of how they
>occurred in the tree.  My unmake move would just be a bit-shift on the
>appropriate squares.
Since you would have to keep track of which squares had changed at each ply
so that you could do bit shifts on them, might as well store in the same
place what the old values of these squares were.  Given this info you
can skip storeing all those old states in the board, and make your
board 8(or 16) times smaller.  Smaller board -> less memory access and
better cache locality.  Of course, this wouldn't be as much fun :)

Oh, and note that doing a bitshift on one of those squares would require
reading 4(or 8) bytes from ram, then writeing it back.

>I would welcome any other ideas people have for making a fast "unmake"
>routine.
>
> - Dan
Personally, I use "memcpy", I've tested unmakemove and it wasn't detectably
faster with MY board representation.  Your results may and likely will differ.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.