From 999ccd9948394f1ef2e253eed400e34e20cc47c0 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Thu, 17 Dec 2015 19:11:07 +0100 Subject: [PATCH] erf --- src/arenas/Battleship/functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/arenas/Battleship/functions.php b/src/arenas/Battleship/functions.php index 91afa98..ae7677c 100644 --- a/src/arenas/Battleship/functions.php +++ b/src/arenas/Battleship/functions.php @@ -3,8 +3,7 @@ function is_it_possible_to_place_ships_on_grid($gridWidth,$gridHeight,$nbShipsSi //return false or true //not a perfect solution $shipsArea=$nbShipsSize1 + (2 * $nbShipsSize2) + (3 * $nbShipsSize3) + (4 * $nbShipsSize4) + (5 * $nbShipsSize5) + (6 * $nbShipsSize6); - if( $shipsArea < intval($gridHeight * $gridWidth / 2)){ - echo $shipsArea." ". intval($gridHeight * $gridWidth / 2); + if( $shipsArea > intval($gridHeight * $gridWidth / 2)){ return false; } //longest ship