This commit is contained in:
Gnieark 2015-12-12 20:00:41 +01:00
parent c82b6c434e
commit d273c2a5cb
2 changed files with 21 additions and 0 deletions

View File

@ -19,7 +19,28 @@ switch($_POST['act']){
} }
$$key=$_POST[$key]; $$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; break;