Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Edited Grammatical Mistake - This Should Make Much More Sense

Author: Russell Reagan

Date: 22:52:18 09/01/02

Go up one level in this thread


On September 01, 2002 at 19:15:39, Kip Werking wrote:

>Let me give another example to illustrate my point.  Imagine a knight that has
>all possible 8 moves available.  Instead of running a Knight::PossibleMoves
>function that looked at all 8 squares every time the board changed, couldn't you
>have a function that said: "Hey, if the knight didn't move:
>
>1. check to see if the king moved into pinning the knight, if so set all of the
>knights possible moves to 0 (but remember what they were in case the king moves
>again)
>2. check to see if a same-color piece moved onto one of the knights possible
>moves, if so subtract that move from the possible list
>
>Wouldn't this be much faster than checking all 8 possible squares at every board
>along the game tree?

There are a lot of special cases that you must consider when using an approach
like this. I considered using an approach like this a long time ago, but I chose
to use the classic move generator since the approach you described will take a
very long time to implement it 100% correct, be very hard work tracking down
every single special case, and be very error prone because of all of the stuff
you have to keep up with. Even if you can get it working correctly, there's no
guarentee that it's going to be faster. If it is, it's only a constant speedup
anyway, and constant speedups will only make minute differences when compared to
the exponential speed ups that other improvements offer (most notably, forward
pruning).

It seems like an awful lot of work to implement it, even if you get a gain in
speed. There are a lot of other areas in a chess program, and even if your move
generator is 200% faster than any other move generator out there, you will still
be slower than the faster searchers because they have highly optimized
everything else in their search and evaluation.

But as another poster said, it is interesting.

Russell



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.