2048.html
changeset 103 54dfc3b4e7d3
parent 102 6c057ac86c97
child 104 47d42234dd5c
equal deleted inserted replaced
102:6c057ac86c97 103:54dfc3b4e7d3
   701           cfg[optDoms[i].name] = 1;
   701           cfg[optDoms[i].name] = 1;
   702           continue;
   702           continue;
   703         }
   703         }
   704         cfg[optDoms[i].name] = val;
   704         cfg[optDoms[i].name] = val;
   705       }
   705       }
       
   706       var optDoms = aiDom.querySelectorAll("div.option > input[type='checkbox']");
       
   707       for (var i = 0; i < optDoms.length; i++) {
       
   708         cfg[optDoms[i].name] = optDoms[i].checked;
       
   709       }
   706       return cfg;
   710       return cfg;
   707     }
   711     }
   708     ui.ai.cfgTitle = function(aiName) {
   712     ui.ai.cfgTitle = function(aiName) {
   709       var title = JSON.stringify(ui.ai.parseCfg(document.getElementById(aiName))).replace(":", ": ", "g").replace(",", "\n", "g");
   713       var title = JSON.stringify(ui.ai.parseCfg(document.getElementById(aiName))).replace(":", ": ", "g").replace(",", "\n", "g");
   710       title = title.substr(1);
   714       title = title.substr(1);
   719       "ai-blind-weight-random": function(aiDom) {
   723       "ai-blind-weight-random": function(aiDom) {
   720         var cfg = ui.ai.parseCfg(aiDom);
   724         var cfg = ui.ai.parseCfg(aiDom);
   721         return new ai.BlindWeightRandom(ui.brdEngine, cfg);
   725         return new ai.BlindWeightRandom(ui.brdEngine, cfg);
   722       },
   726       },
   723       "ai-blind-cycle": function(aiDom) {
   727       "ai-blind-cycle": function(aiDom) {
   724         var cfg = {};
   728         var cfg = ui.ai.parseCfg(aiDom);
   725         cfg.clockwise = aiDom.querySelectorAll("input[name='clockwise']")[0].checked;
       
   726         cfg.whilePossible = aiDom.querySelectorAll("input[name='whilePossible']")[0].checked;
       
   727         return new ai.BlindCycle(ui.brdEngine, cfg);
   729         return new ai.BlindCycle(ui.brdEngine, cfg);
   728       },
   730       },
   729       "ai-one-step-ahead": function(aiDom) {
   731       "ai-one-step-ahead": function(aiDom) {
   730         var cfg = ui.ai.parseCfg(aiDom);
   732         var cfg = ui.ai.parseCfg(aiDom);
   731         return new ai.OneStepAhead(ui.brdEngine, cfg);
   733         return new ai.OneStepAhead(ui.brdEngine, cfg);