2048.html
changeset 36 a18fc2601ce8
parent 35 3d56325d7002
child 37 fe75d168a605
--- a/2048.html	Wed Sep 10 13:26:10 2014 +0300
+++ b/2048.html	Wed Sep 10 14:49:28 2014 +0300
@@ -73,6 +73,14 @@
       display: inline-block;
       float: left;
       margin: 1px 4px;
+      padding: 2px;
+      border: 1px solid tan;
+      border-radius: 4px;
+    }
+    div.ai > div.option > input.int {
+      text-align: right;
+      max-width: 4em;
+      margin-rght: 2px;
     }
     .clearfix {
       clear: both;
@@ -148,6 +156,23 @@
         <button class="ai">enable</button>
         <h5>bling random</h5>
       </div>
+      <div class="ai" id="ai-blind-weight-random">
+        <button class="ai">enable</button>
+        <h5>bling weight random</h5>
+        <div class="option">
+          <input type="text" name="left" class="int" pattern="[0-9]*" value="1"/> left weight
+        </div>
+        <div class="option">
+          <input type="text" name="right" class="int" pattern="[0-9]*" value="1"/> right weight
+        </div>
+        <div class="option">
+          <input type="text" name="up" class="int" pattern="[0-9]*" value="1"/> up weight
+        </div>
+        <div class="option">
+          <input type="text" name="down" class="int" pattern="[0-9]*" value="1"/> down weight
+        </div>
+        <div class="clearfix"></div>
+      </div>
       <div class="ai" id="ai-blind-cycle">
         <button class="ai">enable</button>
         <h5>blind cycle</h5>
@@ -481,6 +506,14 @@
       "ai-blind-random": function() {
         return new ai.blindRandom(ui.brdEngine);
       },
+      "ai-blind-weight-random": function(aiDom) {
+        var cfg = {};
+        cfg.left = aiDom.querySelectorAll("input[name='left']")[0].value;
+        cfg.right = aiDom.querySelectorAll("input[name='right']")[0].value;
+        cfg.up = aiDom.querySelectorAll("input[name='up']")[0].value;
+        cfg.down = aiDom.querySelectorAll("input[name='down']")[0].value;
+        return new ai.blindWeightRandom(ui.brdEngine);
+      },
       "ai-blind-cycle": function(aiDom) {
         var cfg = {};
         cfg.clockwise = aiDom.querySelectorAll("input[name='clockwise']")[0].checked;