Ahah! Found another major bug! Make sure you change to what I wrote in the post above and also make sure you change the line
at the end of the minimax function toCode:return evalVal;
You were accidentally sending back the evalVal which will always be the last move the function looked at, NOT the best value! Try this and see how much it helps.Code:if (mode==MAXIMIZE) return max; else return min;