Fix: code in wrong scope.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 24 Sep 2014 22:55:49 +0300
changeset 135 935a500cea3b
parent 134 5b772474bf17
child 136 4a143572b9d2
Fix: code in wrong scope.
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) {