Allow IA choose any direction in case when all move lead to game over.
Disable debug outpuut.
--- a/ai.js Sun Oct 19 01:13:42 2014 +0300
+++ b/ai.js Sun Oct 19 01:16:11 2014 +0300
@@ -472,7 +472,7 @@
ai.survive.prototype.analyse = function(brd2d) {
var origBrd = new this.brdEngine(brd2d);
var nextBrd = new this.brdEngine();
- var bestW = -1;
+ var bestW = -2;
var bestDir;
var freeCnt = origBrd.freeCnt();
if (freeCnt >= this.cfg.freeCells)
@@ -481,7 +481,6 @@
var dir = ai.dirs[i];
if (origBrd[dir](nextBrd)) {
var w = this.evalFn(nextBrd, 1);
- console.log("dir: %s, w: %d", dir, w);
if (w > bestW) {
bestW = w;
bestDir = dir;