Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Extending Checks

Author: Uri Blass

Date: 12:52:17 09/11/04

Go up one level in this thread


On September 11, 2004 at 15:08:20, Stuart Cracraft wrote:

>On September 11, 2004 at 11:37:23, Harald Lüßen wrote:
>
>>On September 11, 2004 at 00:05:06, Rick Bischoff wrote:
>>
>>>You already count your legal moves through the loop-- that is how you
>>>determine mates, right?
>>
>>No, not in my engine. I detect the mate after I tried all
>>moves. When there was no legal move and I am in check I return
>>the mate_score - ply. (Or draw score when not in check.)
>
>I do it this way.
>
>>
>>And I do not count or even generate all moves before I try
>>the first one. Instead I start with the hash move, then
>>generate, pre-sort and try good capture moves, then killers
>>then normal moves and the rest. If there is a beta cut at the
>
>I generate all moves first and then check the hash move's presence
>in there, sort it to the top, then search the first move.
>
>I tried not generating all moves first, just making the hash move
>as long as my legal-move checker routine for a single move said
>it was okay on the current board and I experienced a slowdown.
>I need to do more work in this area since avoiding the movegen
>is a no-brainer and should result in a speedup, meaning I might
>have another hash move bug, possibly fixed by some other work I'm
>doing.
>
>>first legal move, how can I know that this was the only legal
>>move? Should I really try to generate and legal-test all
>
>No way.Have to gen all moves and make/unmake/checkifincheck
>each unless there is some really different software floating about.
>Ah just had a thought. See next.
>
>>other moves in this case (until one other is found) to detect
>>this situation and then do the beta cut move again, one ply
>>extended? May be it will no longer cause a fail high then.
>>This is why my single move extension is disabled.
>
>It certainly would make sense for me to at least try at the top,
>after the initial movegen, to do make/unmake/checkifincheck for
>all moves and simply break out of the loop if >1 are found legal,
>prior to all other activity. It should go quickly, maybe a few
>make/unmake's at most. That is the way to do it and keep it cheap.


No
That way may be faster than your very slow way of doing it(you may make and
unmake  half of the moves instead of making and unmaking all of them but it is
still slow.

The way to do it cheap is  to have a legal move generator (at least when the
king is in check).

make unmake is an expensive job.

I wonder how many moves you need to try after 1.e4 d6 2.Bb5+ in order to find
more than one legal moves.

I suspect that you will find a lot of illegal moves like a6 or a5 before you
find 2 legal moves.

Uri



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.