2048.html
changeset 62 a8e4d8a808c1
parent 61 eed17c93d420
child 63 251c39718d67
equal deleted inserted replaced
61:eed17c93d420 62:a8e4d8a808c1
    49       padding: 0;
    49       padding: 0;
    50     }
    50     }
    51     .report > .name {
    51     .report > .name {
    52       font-weight: bold;
    52       font-weight: bold;
    53     }
    53     }
    54     div.ai {
    54     div.ai, div.settings {
    55       border: 1px red solid;
    55       border: 1px red solid;
    56       margin-top: 20px;
    56       margin-top: 20px;
    57       padding: 2px;
    57       padding: 2px;
    58       position: relative;
    58       position: relative;
    59       background-color: cornsilk;
    59       background-color: cornsilk;
    67     button.ai {
    67     button.ai {
    68       position: absolute;
    68       position: absolute;
    69       left: 1em;
    69       left: 1em;
    70       top: -1em;
    70       top: -1em;
    71     }
    71     }
    72     div.ai > div.option {
    72     button#statistic {
       
    73       display: inline-block;
       
    74       float: left;
       
    75       margin: 3px 4px;
       
    76     }
       
    77     div.ai > div.option, div.setting {
    73       display: inline-block;
    78       display: inline-block;
    74       float: left;
    79       float: left;
    75       margin: 1px 4px;
    80       margin: 1px 4px;
    76       padding: 2px;
    81       padding: 2px;
    77       border: 1px solid tan;
    82       border: 1px solid tan;
    78       border-radius: 4px;
    83       border-radius: 4px;
    79     }
    84     }
    80     div.ai > div.option > input.positive {
    85     div.ai > div.option > input.positive, div.settings > div.setting > input {
    81       text-align: right;
    86       text-align: right;
    82       max-width: 4em;
    87       max-width: 4em;
    83       margin-right: 2px;
    88       margin-right: 2px;
    84     }
    89     }
    85     .clearfix {
    90     .clearfix {
   220     </div>
   225     </div>
   221   </div>
   226   </div>
   222 
   227 
   223   <div id="report-area" class="area">
   228   <div id="report-area" class="area">
   224     <h1>Reports</h1>
   229     <h1>Reports</h1>
   225     <div class="report" class="area">
   230     <div class="settings">
       
   231       <div class="setting"><input type="text" id="count-limit" value="10"> times</div>
       
   232       <div class="setting">limit to <input type="text" id="time-limit" value="10"> sec</div>
       
   233       <button id="statistic">Start</button>
       
   234       <div class="clearfix"></div>
       
   235     </div>
       
   236     <div class="report">
   226       <div class="name">next max score</div>
   237       <div class="name">next max score</div>
   227       <table>
   238       <table>
   228         <tr>
   239         <tr>
   229           <th>Max</th>
   240           <th>Max</th>
   230           <th>Count</th>
   241           <th>Count</th>
   611         ui.ai.current.cleanup();
   622         ui.ai.current.cleanup();
   612       ui.ai.moveToTop(aiDom);
   623       ui.ai.moveToTop(aiDom);
   613       ui.ai.current = ui.ai.algList[aiDom.id](aiDom);
   624       ui.ai.current = ui.ai.algList[aiDom.id](aiDom);
   614     }
   625     }
   615 
   626 
       
   627 
       
   628     ////////////////////////////////////////////////////////////////
       
   629     // Reports and statistic.
       
   630 
       
   631     function statistic() {
       
   632       
       
   633     }
       
   634 
       
   635     var statisticBtn = document.getElementById('statistic');
       
   636     statisticBtn.addEventListener("click", statistic);
       
   637 
       
   638 
       
   639     ////////////////////////////////////////////////////////////////
       
   640     // Initialise game.
       
   641 
   616     ui.brdEngine = BoardArr2d; // TODO make user selectable
   642     ui.brdEngine = BoardArr2d; // TODO make user selectable
   617 
   643 
   618     if (localStorage.val2048) {
   644     if (localStorage.val2048) {
   619       try {
   645       try {
   620         ui.board.val2048Dom.checked = JSON.parse(localStorage.val2048);
   646         ui.board.val2048Dom.checked = JSON.parse(localStorage.val2048);