diff --git a/html/.StupidIABattleship.php.kate-swp b/html/.StupidIABattleship.php.kate-swp deleted file mode 100644 index 5733c16..0000000 Binary files a/html/.StupidIABattleship.php.kate-swp and /dev/null differ diff --git a/html/StupidIABattleship.php b/html/StupidIABattleship.php index 9787ff5..d3ebed1 100644 --- a/html/StupidIABattleship.php +++ b/html/StupidIABattleship.php @@ -19,7 +19,28 @@ switch($_POST['act']){ } $$key=$_POST[$key]; } + if(!preg_match('^[0-9]+-(1|2)$',$match_id)){ + echo "parametre incorrect"; die; + } + //construire une grille + for($i=0; $i < $width; $i++){ + for($j=0; $j < $height; $j++){ + $map[$i][$j]=0; + } + } + + //pour toutes les tailles de bateau + for($shipWidth = 6; $shipWidth >= 0; $shipWidth--){ + //nombre de bateau à placer de cette taille + $shipCount=$('ship'.$shipWidth); // #trollface + for( $sh = 0; $sh < $shipCount; $sh++){ + $xtest=rand($width); + + + + } + } break;