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 :)
I hope my question is clear, my english is not the best :)