fix js$
This commit is contained in:
parent
7366926906
commit
0b90324a31
|
@ -24,7 +24,7 @@ function battleship(bot1,bot2,gridWidth,gridHeight,nbShip1,nbShip2,nbShip3,nbShi
|
||||||
|
|
||||||
var shipsArea= nbShip1 + 2 * nbShip2 + 3 * nbShip3 + 4 * nbShip4 + 5 * nbShip5 + 6 * nbShip6;
|
var shipsArea= nbShip1 + 2 * nbShip2 + 3 * nbShip3 + 4 * nbShip4 + 5 * nbShip5 + 6 * nbShip6;
|
||||||
if(shipsArea > gridWidth * gridHeight / 2 ){
|
if(shipsArea > gridWidth * gridHeight / 2 ){
|
||||||
alert("Map is too small. Sum of ships areas must be under 50% of the map.");
|
alert("Map is too small. Sum of ships areas must be under 50% of the map." + shipsArea);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var ships= [0,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6];
|
var ships= [0,nbShip1,nbShip2,nbShip3,nbShip4,nbShip5,nbShip6];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user