Author: Tord Romstad
Date: 01:18:10 10/03/03
Go up one level in this thread
On October 03, 2003 at 03:21:59, Koundinya Veluri wrote: >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; >} You are 100% right. I made a mistake when trying to simplify my code before posting. Your code above is precisely what I actually have in my program. :-) Tord
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.