Commit 1ffbe5ab authored by Brady James Garvin's avatar Brady James Garvin
Browse files

Fixed spelling error propagated by autocomplete.

parent c4f228ee
...@@ -145,19 +145,19 @@ export default class PruningEngine extends Engine { ...@@ -145,19 +145,19 @@ export default class PruningEngine extends Engine {
} }
_tiebreakByInfall(moves) { _tiebreakByInfall(moves) {
let bestIndicies = []; let bestIndices = [];
let bestInfall = -Infinity; let bestInfall = -Infinity;
for (let index = moves.length; index--;) { for (let index = moves.length; index--;) {
const infall = this._getInfall(moves[index]); const infall = this._getInfall(moves[index]);
if (infall > bestInfall) { if (infall > bestInfall) {
bestIndicies = []; bestIndices = [];
bestInfall = infall; bestInfall = infall;
} }
if (infall >= bestInfall) { if (infall >= bestInfall) {
bestIndicies.push(index); bestIndices.push(index);
} }
} }
const index = bestIndicies[Math.floor(Math.random() * bestIndicies.length)]; const index = bestIndices[Math.floor(Math.random() * bestIndices.length)];
const bestMove = moves[index]; const bestMove = moves[index];
moves[index] = moves[0]; moves[index] = moves[0];
moves[0] = bestMove; moves[0] = bestMove;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment