Author: Koundinya Veluri
Date: 00:21:59 10/03/03
Go up one level in this thread
On October 02, 2003 at 13:56:07, Tord Romstad wrote:
>On October 02, 2003 at 13:34:15, Anthony Cozzie wrote:
>
>>If I understand it correctly, implementing the BM extension in Zappa would go
>>like so (pseudoish):
>>
>> do_null_search();
>> rb->null_threat = rb->best_move;
>> if(ply >= 2 && m_f_loc((rb-2)->null_threat) == m_f_loc(rb->null_threat))
>> trigger_extension();
>
>Yes, something like that, assuming that rb->best_move contains the move
>that refuted the null move, and that the function m_f_loc() returns the
>'target' of the move.
>
>This is a simplified version of my code:
>
> if(ok_to_do_null_move()) {
> make_null_move();
> null_value = -search(-gamma+1, depth-(R+1)*PLY);
> unmake_null_move();
> if(null_value >= gamma) return null_value;
>
> /* Botvinnik-Markoff extension */
> if(null_value < margin) {
> ThreatMove[Ply] = CurrentMove[Ply+1];
> if((To(ThreatMove[Ply])==To(CurrentMove[Ply-2]) &&
> To(ThreatMove[Ply-2])==From(CurrentMove[Ply-2])) ||
> (To(ThreatMove[Ply]) != To(CurrentMove[Ply-2]) &&
> To(ThreatMove[Ply]) == To(ThreatMove[Ply-2])))
> bm_ext = 1; /* Trigger Botvinnik-Markoff extension */ }
> else ThreatMove[Ply] = 0; }}
>
>Tord
I have a doubt. I didn't understand directly where your To(?)==To(??) stuff came
from so I tried to do it myself using Sergei's explanation. This is what I got:
// If the piece that was being threatened two plies ago has moved
if(To(ThreatMove[Ply - 2]) == From(CurrentMove[Ply - 2]))
{
// Then if the threat move here is capturing the piece that moved
if(To(ThreatMove(Ply)) == To(CurrentMove(Ply - 2)))
trigger;
}
// If the piece that was being threatened two plies ago hasn't moved
else
{
// Then if the theat move here is capturing the same piece as the
// threat move two plies ago
if(To(ThreatMove(Ply)) == To(ThreatMove(Ply - 2)))
trigger;
}
I used a capture as an example but it may not be a capture. Rewriting the above
to the way you had it written, I got this:
if( To(ThreatMove[Ply - 2]) == From(CurrentMove[Ply - 2]) &&
To(ThreatMove(Ply)) == To(CurrentMove(Ply - 2))
||
To(ThreatMove[Ply - 2]) != From(CurrentMove[Ply - 2]) &&
To(ThreatMove(Ply)) == To(ThreatMove(Ply - 2)) )
{
trigger;
}
Three of the lines are the same as what you had, but there is a difference.
While you wrote:
( To(ThreatMove[Ply]) == To(CurrentMove[Ply - 2]) && ... ) ||
( To(ThreatMove[Ply]) != To(CurrentMove[Ply - 2]) && ... )
I got:
( To(ThreatMove[Ply - 2]) == From(CurrentMove[Ply - 2]) && ... ) ||
( To(ThreatMove[Ply - 2]) != From(CurrentMove[Ply - 2]) && ... )
I got the same thing for the left side of ||, but for the right side what I got
is different. I think the expression:
To(ThreatMove[Ply]) != To(CurrentMove[Ply - 2]
is irrelevant to determining the validity of:
To(ThreatMove[Ply]) == To(ThreatMove[Ply - 2])
In your code could you explain what the right side of the or operator means? I
don't understand it. I am not sure if what I got is correct but it makes sense
to me.
Regards,
Koundinya
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.