Anonymous avatar Anonymous committed 73d8e03

詳細な試合状況を表示するようにした

Comments (0)

Files changed (2)

       <input type="button" onclick="run()" value="Run" />
     </div>
     <div>
-        <ul id="result">
-        </ul>
+        <p id="status"></p>
+        <p id="result"></p>
     </div>
 </body>
 </html>
 };
 
 function run() {
-	$('#result').html('Start');
+	$('#status').text('Game Start!');
 
 	var start_player = 1;
 	var default_remaing_flag = 10;
 }
 
 function play(player_no, remaing_flag){
+	$p = $('<p>player_no:'+ player_no + ' play! Remaing Flag is '+ remaing_flag +'</p>');
+  $('#status').append($p);
   var player = palyerlist[player_no];
 	exec(player, remaing_flag, function(result){
     remaing_flag -= result;
+    $p.append(' => '+ remaing_flag );
     console.log('result:' + result + ', remaing_flag:' + remaing_flag);
     if(remaing_flag <= 0){
       $('#result').html('player_no:'+ player_no + 'Lose. Game End.');
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.