for debog the debog
This commit is contained in:
parent
e0044e5146
commit
a78e2ebf2b
|
@ -4,7 +4,7 @@ function is_it_possible_to_place_ships_on_grid($gridWidth,$gridHeight,$nbShipsSi
|
||||||
//not a perfect solution
|
//not a perfect solution
|
||||||
$shipsArea=$nbShipsSize1 + (2 * $nbShipsSize2) + (3 * $nbShipsSize3) + (4 * $nbShipsSize4) + (5 * $nbShipsSize5) + (6 * $nbShipsSize6);
|
$shipsArea=$nbShipsSize1 + (2 * $nbShipsSize2) + (3 * $nbShipsSize3) + (4 * $nbShipsSize4) + (5 * $nbShipsSize5) + (6 * $nbShipsSize6);
|
||||||
if( $shipsArea < intval($gridHeight * $gridWidth / 2)){
|
if( $shipsArea < intval($gridHeight * $gridWidth / 2)){
|
||||||
echo $shipArea." ". intval($gridHeight * $gridWidth / 2);
|
echo $shipsArea." ". intval($gridHeight * $gridWidth / 2);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//longest ship
|
//longest ship
|
||||||
|
|
Loading…
Reference in New Issue
Block a user