- const mvEval =
- ["1-0", "0-1"].includes(score)
- ? (score == "1-0" ? 1 : -1) * maxeval
- : (score == "1/2" ? 0 : initEval);
+ let mvEval = 0;
+ if (["1-0", "0-1"].includes(score))
+ mvEval = (score == "1-0" ? 1 : -1) * maxeval;
+ else if (score == "*")
+ // Add small fluctuations to avoid dropping pieces always on the
+ // first square available.
+ mvEval = initEval + 0.05 - Math.random() / 10;