Jump to content

  • Log In with Google      Sign In   
  • Create Account

Killer moves heuristic question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 patishi   Members   -  Reputation: 212

Like
0Likes
Like

Posted 09 September 2013 - 06:00 PM

My killer moves implementation is usually consists of 2 killers for each depth.  whenever a new move cause a cut off, i check if it is != from the main killer move, and if it is ,I switch the main and secondary killer and than place the new move instead of the main killer.  

The code is like this: 

 

void insertKiller(int depth,int killer){
    if(killersTable[depth][0] == -2){     //The killers table is initiated with -2..indicates that no moves yet inserted.   here i check if the main killer move  
        killersTable[depth][0] = killer;    // is occupied, and if not i just insert the move to the first position. 
    }
    else{     // if there is already a move in that certain depth, i check if it is different from the one in the first position, and if it is, i do the switching 
        if(killer != killersTable[depth][0]){
            killersTable[depth][1] = killersTable[depth][0];
            killersTable[depth][0] = killer;
        }
    }
}
 
 
My question is ,when i try to play the second killer in a certain position, and it causes a cut off,  do i need to replace it with the first killer (the main killer)   or should i just keep it placed in it's original position (the second position)  
I hope my question is clear,  my english is not the best :)


Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 13331

Like
0Likes
Like

Posted 09 September 2013 - 07:45 PM

My first thought is that yes, you should promote the second killer to first killer if it produces a beta cutoff. But the correct answer to this type of question is always "test it both ways".

#3 patishi   Members   -  Reputation: 212

Like
0Likes
Like

Posted 09 September 2013 - 09:42 PM

Thank you! 



#4 Álvaro   Crossbones+   -  Reputation: 13331

Like
0Likes
Like

Posted 10 September 2013 - 02:37 AM

By the way, couldn't you simplify your code like this?
void insertKiller(int depth,int killer){
    if(killer != killersTable[depth][0]){
        killersTable[depth][1] = killersTable[depth][0];
        killersTable[depth][0] = killer;
    }
}
I think that takes care of every case...

#5 patishi   Members   -  Reputation: 212

Like
0Likes
Like

Posted 11 September 2013 - 09:47 PM

Yeah..you are right :)   thx!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS