changeset 135:935a500cea3b

Fix: code in wrong scope.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Wed, 24 Sep 2014 22:55:49 +0300
parents 5b772474bf17
children 4a143572b9d2
files ai.js
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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) {