js debug output

This commit is contained in:
gnieark 2015-12-15 20:47:25 +01:00
parent f45994ebda
commit 145ab319f5

View File

@ -66,6 +66,10 @@ function battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShi
try{ try{
var grids = JSON.parse(xhr.responseText); var grids = JSON.parse(xhr.responseText);
for( var player=1; player <= 2 ; player ++){ for( var player=1; player <= 2 ; player ++){
var p=createElem("p");
p.innerHTML='Reponse joueurs:'xhr.responseText;
document.getElementById('logs').appendChild(p);
for (var y=0; y < grids[player].length ; y++){ for (var y=0; y < grids[player].length ; y++){
for (var x=0; x < grids[player][y].length ; x++){ for (var x=0; x < grids[player][y].length ; x++){
if (grids[player][y][x] == 1){ if (grids[player][y][x] == 1){