equal
deleted
inserted
replaced
50 ai.blindCycle.prototype.analyse = function(brd) { |
50 ai.blindCycle.prototype.analyse = function(brd) { |
51 var origBrd = new this.brdEngine(brd); |
51 var origBrd = new this.brdEngine(brd); |
52 this.prevDir = this.prevDir || 0; |
52 this.prevDir = this.prevDir || 0; |
53 if (!this.cfg.untilPossible) |
53 if (!this.cfg.untilPossible) |
54 this.prevDir = this.nextDir(this.prevDir); |
54 this.prevDir = this.nextDir(this.prevDir); |
55 console.log(this.prevDir); |
|
56 while (true) { |
55 while (true) { |
57 if (origBrd[ai.blindCycle.canDirs[this.prevDir]]()) |
56 if (origBrd[ai.blindCycle.canDirs[this.prevDir]]()) |
58 return ai.blindCycle.dirs[this.prevDir]; |
57 return ai.blindCycle.dirs[this.prevDir]; |
59 this.prevDir = this.nextDir(this.prevDir); |
58 this.prevDir = this.nextDir(this.prevDir); |
60 } |
59 } |