Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Design: what would your objects be?

Author: Sven Reichard

Date: 02:50:28 07/03/02

Go up one level in this thread


On July 03, 2002 at 05:37:11, Daniel Clausen wrote:
> <snip>  But for example when it comes
>to generating moves, I don't use a dynamic (or at least bounds-checking)
>move-list. I assume you do that, Sven. :)

std::list<SmartPointer<Move> >; // :-))

... actually, the SmartPointer class has a different name, but I'll change that
today.

> <snip>
>(b) Class Game
>Has Board as a member variable, along with other information about a played
>game. For example it contains information about time limit for both sides and
>player names. It also contains a move list, which contains all played moves so
>far. (therefore you can undo a move on a game-object, but not on a board-object)

That's a GameRecord in my case. About the undoing: Whoever does a move has to
take it back, too (during the search). I.e.,

Move m;
m->makeOn(game);
// ...
m->takeBackOn(game);

 I guess this causes the current bug (the position after the search is different
from before).

Sven.
>Sargon



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.