Fix typo.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Tue, 09 Sep 2014 20:00:45 +0300
changeset 29 30a09d50ae21
parent 28 caf0be6d7e68
child 30 1d19768ca71d
Fix typo.
ai.js
--- a/ai.js	Tue Sep 09 19:54:11 2014 +0300
+++ b/ai.js	Tue Sep 09 20:00:45 2014 +0300
@@ -36,7 +36,7 @@
 ai.blindCycle = function(brdEngine, cfg) {
     this.brdEngine = brdEngine;
     this.cfg = cfg || {};
-    this.cfg.untilPossible = this.cfg.untilPossible || false;
+    this.cfg.whilePossible = this.cfg.whilePossible || false;
     this.cfg.clockwise = this.cfg.clockwise || false;
 }
 ai.blindCycle.dirs = ["left", "down", "right", "up"];
@@ -50,7 +50,7 @@
 ai.blindCycle.prototype.analyse = function(brd) {
     var origBrd = new this.brdEngine(brd);
     this.prevDir = this.prevDir || 0;
-    if (!this.cfg.untilPossible)
+    if (!this.cfg.whilePossible)
         this.prevDir = this.nextDir(this.prevDir);
     while (true) {
         if (origBrd[ai.blindCycle.canDirs[this.prevDir]]())