specs
This commit is contained in:
parent
8e100f4a35
commit
c82b6c434e
BIN
html/.StupidIABattleship.php.kate-swp
Normal file
BIN
html/.StupidIABattleship.php.kate-swp
Normal file
Binary file not shown.
|
@ -1,6 +1,24 @@
|
|||
<?php
|
||||
switch($_POST['act']){
|
||||
case "init":
|
||||
$wantedVars=array(
|
||||
'match_id' => false, //false-> string ; true -> integer
|
||||
'opponent' => false,
|
||||
'width' => true,
|
||||
'height' => true,
|
||||
'ship1' => true,
|
||||
'ship2' => true,
|
||||
'ship3' => true,
|
||||
'ship4' => true,
|
||||
'ship5' => true,
|
||||
'ship6' => true
|
||||
);
|
||||
foreach($wantedVars as $key => $shouldBeInteger){
|
||||
if(($shouldBeInteger) && (!is_numeric($_POST[$key]))){
|
||||
echo "var is not numeric"; die;
|
||||
}
|
||||
$$key=$_POST[$key];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -38,3 +38,6 @@
|
|||
<p>...</p>
|
||||
<h4>"ship6"</h4>
|
||||
<p>integer, compris entre 0 et 10, bornes incluses, Vous indique le nombre de bateaux de longeur 6 cases à placer.</p>
|
||||
<h3>Ce que doit retourner votre bot</h3>
|
||||
Il doit retourner la position des navires.
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user