# HG changeset patch # User Oleksandr Gavenko # Date 1410344770 -10800 # Node ID 3d56325d7002a28aae34951638aa722c74197901 # Parent 16b711a81a16a8e183bdc06410f14eb0dab5280d Rename AI. diff -r 16b711a81a16 -r 3d56325d7002 2048.html --- a/2048.html Tue Sep 09 21:18:31 2014 +0300 +++ b/2048.html Wed Sep 10 13:26:10 2014 +0300 @@ -144,7 +144,7 @@

AIs

-
+
bling random
@@ -478,8 +478,8 @@ ui.ai = {}; ui.ai.current = null; ui.ai.algList = { - "ai-random": function() { - return new ai.random(ui.brdEngine); + "ai-blind-random": function() { + return new ai.blindRandom(ui.brdEngine); }, "ai-blind-cycle": function(aiDom) { var cfg = {}; diff -r 16b711a81a16 -r 3d56325d7002 ai.js --- a/ai.js Tue Sep 09 21:18:31 2014 +0300 +++ b/ai.js Wed Sep 10 13:26:10 2014 +0300 @@ -13,10 +13,10 @@ // Random AI. //////////////////////////////////////////////////////////////// -ai.random = function(brdEngine) { +ai.blindRandom = function(brdEngine) { this.brdEngine = brdEngine; } -ai.random.prototype.analyse = function(brd) { +ai.blindRandom.prototype.analyse = function(brd) { var origBrd = new this.brdEngine(brd); while (true) { var rnd = Math.floor(Math.random()*4); @@ -25,7 +25,7 @@ } } /* Mark that next board will be unrelated to previous, so any stored precompution can be cleared. */ -ai.random.prototype.cleanup = function() { } +ai.blindRandom.prototype.cleanup = function() { }