Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: piece list possibilities

Author: Bruce Moreland

Date: 12:04:14 07/08/98

Go up one level in this thread



On July 08, 1998 at 14:58:25, Dan Newman wrote:

>I have tried doubly linked piece lists in the past (especially
>for heavy weight piece structs).  You just disconnect the piece
>when it's captured (lots of moving pointers about) and stuff a
>pointer to it onto a stack.  When you undo the move, the piece
>still has its linked list pointers set, so it knows where it
>belongs in the piece list--very easy to put it back in the
>same place.  The biggest hit I suppose is in make() and undo()
>where all that pointer copying is done.

I do this a doublly linked list, but I use a dead bit.

I only have to check the dead bit when I'm iterative through a piece list.  This
doesn't make the code look bad at all.

At one point it was more efficient for me to do this than it was to fiddle with
the pointers, but I'm not sure now, since it seems like I have lot of these
iteration loops lying around.

bruce



This page took 0.01 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.