ai.js
changeset 135 935a500cea3b
parent 126 e634761d0432
child 136 4a143572b9d2
equal deleted inserted replaced
134:5b772474bf17 135:935a500cea3b
   335             if (brd.atCorner(max))
   335             if (brd.atCorner(max))
   336                 score += cfg.cornerBonus;
   336                 score += cfg.cornerBonus;
   337         if (cfg.edgeBonus > 0)
   337         if (cfg.edgeBonus > 0)
   338             if (brd.atEdge(max))
   338             if (brd.atEdge(max))
   339                 score += cfg.edgeBonus;
   339                 score += cfg.edgeBonus;
   340         if (cfg.freeBonus > 0)
   340     }
   341             score += cfg.freeBonus * brd.free();
   341     if (cfg.freeBonus > 0)
   342     }
   342         score += cfg.freeBonus * brd.free();
   343     return score;
   343     return score;
   344 }
   344 }
   345 ai.expectimax.prototype.analyse = function(brd) {
   345 ai.expectimax.prototype.analyse = function(brd) {
   346     var origBrd = new this.brdEngine(brd);
   346     var origBrd = new this.brdEngine(brd);
   347     var nextBrd = new this.brdEngine();
   347     var nextBrd = new this.brdEngine();