Author: Leen Ammeraal
Date: 09:48:10 10/28/03
Go up one level in this thread
On October 28, 2003 at 12:27:18, Gopi wrote:
>On October 28, 2003 at 10:26:27, Leen Ammeraal wrote:
>
>>On October 28, 2003 at 09:45:47, Gopi wrote:
>>
>>>In search() function in tscp we are checking if(ply&&reps()) return 0;
>>>Can anyone explain actually what is done please? Thanks.
>>
>>This means the same as
>>
>> if (ply != 0 && reps() != 0) return 0;
>>
>>You should also know that the function reps is not called
>>if ply is zero. So the above is also equivalent with
>>
>> if (ply != 0)
>> { if (reps() != 0) return 0;
>> }
>>
>>Without looking at the whole program code,
>>I suppose that reps is a function that checks whether
>>there is a repetition of moves. I hope this helps.
>>
>>Leen
>
>So even if reps() returns 1 does this condition (ie if(ply&&reps())) return 0 ?
>But only when there is 50 same moves the condition should return 0 right?
I am not very familiar with tscp, but I suppose you should read the code
as follows:
If ply is nonzero, we look if there is a repetition of positions
in the previous moves. If so, reps returns a nonzero
value, possibly 1, indicating 'true'. (Remember, in C the value
0 means 'false' and any nonzero value 'true'.) Then the evaluation
function should return 0. This not a logical but rather a numerical value,
indicating that a continuation of the game in this way will lead to a draw.
I don't think this is related to the 50 moves rule.
Leen
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.