From c23476f9bef5fe771f3b57b6c50858be03ddc529 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Thu, 17 Dec 2015 19:03:10 +0100 Subject: [PATCH] fix php int float comparaison --- src/arenas/Battleship/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/arenas/Battleship/functions.php b/src/arenas/Battleship/functions.php index 1500630..d3f6bc0 100644 --- a/src/arenas/Battleship/functions.php +++ b/src/arenas/Battleship/functions.php @@ -4,6 +4,7 @@ function is_it_possible_to_place_ships_on_grid($gridWidth,$gridHeight,$nbShipsSi //not a perfect solution $shipsArea=$nbShipsSize1 + 2 * $nbShipsSize2 + 3 * $nbShipsSize3 + 4 * $nbShipsSize4 + 5 * $nbShipsSize5 + 6 * $nbShipsSize6; if( $shipsArea < intval($gridHeight * $gridWidth / 2)){ + echo "there"; return false; } //longest ship