Author: Daniel Mehrmannn
Date: 06:00:12 05/04/05
Go up one level in this thread
On May 04, 2005 at 01:37:06, Volker Böhm wrote:
>On May 03, 2005 at 17:08:58, Daniel Mehrmannn wrote:
>
>>On May 03, 2005 at 13:51:35, Kevin K wrote:
>>
>>> quiesce(int alpha, int beta) {
>>> int score = eval();
>>> if (score >= beta) return score;
>>> for (each capturing move m) {
>>> make move m;
>>> score = -quiesce(-beta,-alpha);
>>> unmake move m;
>>> if (score >= alpha) {
>>> alpha = score;
>>> if (score >= beta) break;
>>> }
>>> }
>>> return score;
>>> }
>>>I found this from http://www.ics.uci.edu/~eppstein/180a/990204.html
>>>But there is no code which takes care of escaping from check.
>>>Where do I have to put code which handles escaping from check in Qsearch?
>>
>>light version:
>>
>> quiesce(int alpha, int beta) {
>>
>> SideInCheck = in_check();
>> if (SideInCheck) {
>> genAllMoves();
>> } else {
>> /* StandPat CutOff */
>> int score = eval();
>> if (score >= beta) return score;
>> genCaptures();
>> }
>>
>> for (each capturing move m) {
>> make move m;
>> score = -quiesce(-beta,-alpha);
>> unmake move m;
>> if (score >= alpha) {
>> alpha = score;
>> if (score >= beta) break;
>> ^^^^^^ ?????
>>
>
> must be return beta;
>>
>
>
>No it must not be return beta. The break leads to an exit of the for loop and
>thus to a return score. Returning the value >= beta is "fail soft", returning
>the value == beta is fail hard.
>
>Greetings Volker
Of course you're right, but its definely wrong for a beginner !
daniel
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.