# HG changeset patch # User Oleksandr Gavenko # Date 1411588549 -10800 # Node ID 935a500cea3b1cf133dda8abcffa425c9d477509 # Parent 5b772474bf17b100fb85126326e0ef05b7a97a15 Fix: code in wrong scope. diff -r 5b772474bf17 -r 935a500cea3b ai.js --- a/ai.js Wed Sep 24 22:35:35 2014 +0300 +++ b/ai.js Wed Sep 24 22:55:49 2014 +0300 @@ -337,9 +337,9 @@ if (cfg.edgeBonus > 0) if (brd.atEdge(max)) score += cfg.edgeBonus; - if (cfg.freeBonus > 0) - score += cfg.freeBonus * brd.free(); } + if (cfg.freeBonus > 0) + score += cfg.freeBonus * brd.free(); return score; } ai.expectimax.prototype.analyse = function(brd) {