dfd
This commit is contained in:
parent
c82b6c434e
commit
d273c2a5cb
Binary file not shown.
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user