Null move
Posted: 11 Feb 2008, 18:37
This is my null move implementation
but i dont get all his potential
What do you think about this ...?
Another idea is this
but i dont get all his potential
- Code: Select all
//-------------------------------------------------------------------
//NULL MOVE PRURING
//-------------------------------------------------------------------
int R;
int aux100;
#ifdef OPTION_NULL
R=4;
if (!(tipo_before&TIPO_NULL))
if (!(tipo&TIPO_CHECK))
if (eval(alfa,beta)>beta)
{
turn^=TURN;
aux100=mov100;
mov100=0;
ev=-alfabeta(-beta,-alfa,depth-R,ply+1,tipo|TIPO_NULL);
mov100=aux100;
turn^=TURN;
if (setb[Id]&th_stop)
{
arbol.borra_nivel();
return 0;//STOP!!!
}
if (ev>=beta)
{
if (ev>5) return (-alfabeta (-beta,-alfa,depth-5,ply+1,tipo));
if (ev>=APP_MAX_VAL) return APP_MAX_VAL;
return ev;
}
if (ev<APP_MIN_VAL) tipo|=TIPO_NULL_TH;
}
#endif
What do you think about this ...?
Another idea is this
- Code: Select all
#ifdef OPTION_NULL2
if (!(tipo_anterior&TIPO_NULL))
if (depth>5)
{
arbol.nuevo_nivel();
if (turno)
{
gencap_b ();
genmov_b ();
genund_b ();
}
else
{
gencap_n ();
genmov_n ();
genund_n ();
}
if (dim()==0)
{
arbol.borra_nivel();
if (turno==BLANCO)
{
if (jaqueb(lsb(rb)))
return MIN_VAL+ply;
return 0;
}
if (turno==NEGRO)
{
if (jaquen(lsb(rn)))
return MIN_VAL+ply;
return 0;
}
}
if ((turno==BLANCO)&&(jaquen(lsb(rb))==0)||(turno==NEGRO )&&(jaquen(lsb(rn))==0))
{
int max_null=MIN_VAL;
for (int i=0;i<dim();i++)
{
R=5;
turno^=BLANCO;
aux100=mov100; //NULL MOVE ES IRREVERSIBLE!?
mov100=0; //NULL MOVE ES IRREVERSIBLE!?
ev=-alfabeta(-beta,1-beta,depth-R,ply+1,tipo|TIPO_NULL);
mov100=aux100; //NULL MOVE ES IRREVERSIBLE!?
turno^=BLANCO;
if (ev>max_null) max_null=ev;
}
if (max_null<alfa)
{
arbol.borra_nivel();
return max_null;
}
}
arbol.borra_nivel();
}
#endif