diff --git a/src/arenas/Battleship/functions.php b/src/arenas/Battleship/functions.php index 63f1244..723c8b8 100644 --- a/src/arenas/Battleship/functions.php +++ b/src/arenas/Battleship/functions.php @@ -1,10 +1,26 @@ 0; $i--){ + $var='nbShipsSize'.$i; + if($$var > 0){ + $longestShip=$$var; + break; + } + } + if( (!isset($longestShip)) + OR(($longestShip > $gridWidth) && ($longestShip > $gridHeight)) + ){ + return false: + } } -function get_Post_Params($botsCount){ +function get_Post_Params($ccbotsCount){ $keysBots=array('bot1','bot2'); foreach($keysBots as $botKey){ if(!isset($_POST[$botKey])){