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,9 +1,27 @@
|
||||||
<?php
|
<?php
|
||||||
switch($_POST['act']){
|
switch($_POST['act']){
|
||||||
case "init":
|
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];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -37,4 +37,7 @@
|
||||||
<h4>...</h4>
|
<h4>...</h4>
|
||||||
<p>...</p>
|
<p>...</p>
|
||||||
<h4>"ship6"</h4>
|
<h4>"ship6"</h4>
|
||||||
<p>integer, compris entre 0 et 10, bornes incluses, Vous indique le nombre de bateaux de longeur 6 cases à placer.</p>
|
<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