# HG changeset patch # User Oleksandr Gavenko # Date 1413670571 -10800 # Node ID e6a4bc888b72641a6f5bb9350e942663d8b609e9 # Parent 1f8df90bd338a31a95226cf201c3cc2358d00299 Allow IA choose any direction in case when all move lead to game over. Disable debug outpuut. diff -r 1f8df90bd338 -r e6a4bc888b72 ai.js --- 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;