fix js
This commit is contained in:
parent
b7fcc83cb0
commit
67812f15c1
|
@ -24,15 +24,15 @@ function battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShi
|
||||||
|
|
||||||
document.getElementById('fightResult').innerHTML = '';
|
document.getElementById('fightResult').innerHTML = '';
|
||||||
//dessiner les deux grilles
|
//dessiner les deux grilles
|
||||||
tableAdv=createElem("table",{"id":"tblAdv","className":"battleshipGrid"});
|
tableAdv=createElem("table",{"id":"tblAdv","class":"battleshipGrid"});
|
||||||
tableMe=createElem("table",{"id":"tblAdv","className":"battleshipGrid"});
|
tableMe=createElem("table",{"id":"tblAdv","class":"battleshipGrid"});
|
||||||
|
|
||||||
for (i=0; i < gridHeight ; i++){
|
for (i=0; i < gridHeight ; i++){
|
||||||
trAdv=createElem("tr");
|
trAdv=createElem("tr");
|
||||||
trMe=createElem("tr");
|
trMe=createElem("tr");
|
||||||
for (j=0; j < gridWidth ; j++){
|
for (j=0; j < gridWidth ; j++){
|
||||||
tdAdv=createElem("td",{"id":"adv" + i +"-" + j,"className": "empty"});
|
tdAdv=createElem("td",{"id":"adv" + i +"-" + j,"class": "empty"});
|
||||||
tdMe=createElem("td",{"id":"me" + i +"-" + j,"className": "empty"});
|
tdMe=createElem("td",{"id":"me" + i +"-" + j,"class": "empty"});
|
||||||
trAdv.appendChild(tdAdv);
|
trAdv.appendChild(tdAdv);
|
||||||
trMe.appendChild(tdMe);
|
trMe.appendChild(tdMe);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user