Share this post

Link to post

Share on other sites

There are probably other problems with your code, but about your specific question, why are you restricting the use of the move to situations where entry.flag is EXACT? If a move was good enough to give you a beta cut in the past, that's good enough to try it first.

There is another problem that makes your code incorrect, unless there is something I am not seeing: You should first check if (value > alpha), update currentBest and alpha, and only then check for a beta cut. Otherwise, whenever a beta cut happens alpha and currentBest have the wrong value.