does javascript permit it?
This commit is contained in:
parent
82790c37d0
commit
9252427740
|
@ -20,7 +20,7 @@ function createElem(type,attributes)
|
||||||
return elem;
|
return elem;
|
||||||
}
|
}
|
||||||
|
|
||||||
function battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6,xd_check){
|
function battleship(botsArray,bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6,xd_check){
|
||||||
|
|
||||||
document.getElementById('fightResult').innerHTML = '';
|
document.getElementById('fightResult').innerHTML = '';
|
||||||
//dessiner les deux grilles
|
//dessiner les deux grilles
|
||||||
|
@ -28,6 +28,9 @@ function battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShi
|
||||||
tableMe=createElem("table",{"id":"tblAdv","class":"battleshipGrid"});
|
tableMe=createElem("table",{"id":"tblAdv","class":"battleshipGrid"});
|
||||||
|
|
||||||
for (i=0; i < gridHeight ; i++){
|
for (i=0; i < gridHeight ; i++){
|
||||||
|
//ligne de titre
|
||||||
|
|
||||||
|
|
||||||
trAdv=createElem("tr");
|
trAdv=createElem("tr");
|
||||||
trMe=createElem("tr");
|
trMe=createElem("tr");
|
||||||
for (j=0; j < gridWidth ; j++){
|
for (j=0; j < gridWidth ; j++){
|
||||||
|
|
|
@ -49,6 +49,6 @@ if(!$postParams){
|
||||||
</select></em>
|
</select></em>
|
||||||
</p>
|
</p>
|
||||||
<!-- battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6,xd_check) -->
|
<!-- battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6,xd_check) -->
|
||||||
<p><label> </label><input type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="battleship(document.getElementById('bot1').value,document.getElementById('bot2').value,getElementById('width').value,getElementById('height').value,getElementById('ship1').value,getElementById('ship2').value,getElementById('ship3').value,getElementById('ship4').value,getElementById('ship5').value,getElementById('ship6').value,'<?php echo xd_check_input(2); ?>');"></p>
|
<p><label> </label><input type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="battleship(<?php echo json_encode($bots); ?>,document.getElementById('bot1').value,document.getElementById('bot2').value,getElementById('width').value,getElementById('height').value,getElementById('ship1').value,getElementById('ship2').value,getElementById('ship3').value,getElementById('ship4').value,getElementById('ship5').value,getElementById('ship6').value,'<?php echo xd_check_input(2); ?>');"></p>
|
||||||
<div id="fightResult"></div>
|
<div id="fightResult"></div>
|
||||||
</article>
|
</article>
|
Loading…
Reference in New Issue
Block a user