ai.js
changeset 28 caf0be6d7e68
parent 27 8f96d09a4d94
child 29 30a09d50ae21
equal deleted inserted replaced
27:8f96d09a4d94 28:caf0be6d7e68
    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     }