affiche boats
This commit is contained in:
parent
3fcf4f0ce5
commit
5c554be7ae
|
@ -64,12 +64,11 @@ function battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShi
|
||||||
//debug
|
//debug
|
||||||
//alert(xhr.responseText);
|
//alert(xhr.responseText);
|
||||||
try{
|
try{
|
||||||
var grids = JSON.parse(this.responseText);
|
var grids = JSON.parse(xhr.responseText);
|
||||||
for( var player=1; player <= 2 ; player ++){
|
for( var player=1; player <= 2 ; player ++){
|
||||||
for (var y=0; y < grids[player].count ; y++){
|
for (var y=0; y < grids[player].count ; y++){
|
||||||
for (var x=0; x < grids[player][y].count ; x++){
|
for (var x=0; x < grids[player][y].count ; x++){
|
||||||
if (grids[player][y][x] == "1"){
|
if (grids[player][y][x] == "1"){
|
||||||
alert('bot' + player + '-' + y + '-' + x);
|
|
||||||
document.getElementById( 'bot' + player + '-' + y + '-' + x).className="shipOn";
|
document.getElementById( 'bot' + player + '-' + y + '-' + x).className="shipOn";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user