Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: piece list possibilities

Author: Dan Newman

Date: 13:29:54 07/08/98

Go up one level in this thread


On July 08, 1998 at 15:04:14, Bruce Moreland wrote:

>
>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

Yeah, it doesn't look bad at all, and if you clean up the list
at the start of each search there shouldn't be too many dead
pieces to skip.

My biggest problem is that I never have been able to envision
the entire chess program at once.  That is, I generally think
"what do I need to implement the move generator" and come up
with various data structures/algorithms to do that, and then
I generally hit make/undo next, and so on.  At some point along
the line I say "dang, it would be really nice if I'd done it
this other way"--but usually that's too late.  (And if I had,
something else would no doubt be less than well supported.)
I end up commited to a scheme which gives really fast move
generation but doesn't support in-check detection or eval very
well, etc.  I think I may be getting better with practice
though...

-Dan.



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.