Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: about the meaning of unmake in the discussion of the need to unmake move

Author: Bo Persson

Date: 04:34:33 09/05/03

Go up one level in this thread


On September 05, 2003 at 07:11:20, Uri Blass wrote:

>Does unmake means doing the opposite calculation
>that were done in make?
>
>I assume that makemove updates the hashkey(and the pawn hashkey).
>Does unmake move update the same information again to its previous
>value or does the program remember it in an array.
>
>If it remembers it in an array then there is something that it does
>not unmake.
>I am interested to know if there is more information that unmake does not unmake
>except hash keys.

Some things are "one-way" and can not be undone, like castling and en-passant
status. They have to be saved. The hash key is possible to "undo", but maybe it
is cheaper to copy it, beacuse it will be written to anyway at each ply.

>
>I have both a global varaible zob and an array zobkey[1000]
>when I assume not more than 1000 plies in a game.
>
>I think that only now I understand a good reason to get rid of the global
>varaible zob like Hyatt suggested me long time ago.
>If I get rid of it then it means that I do not need to do
>zob=zobkey[hply] in my undo move.
>
>I should have a local varaible zob only in my makemove.
>It was not possible in the past because my makemove called some functions
>that updated zob.

Global variables can be a problem for optimizing compilers, because it is hard
to track their (potential) updates. Often local variables are easier to handle.

BTW, tracking the value of global variables is hard not only for compilers. :-)



Bo Persson



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.