You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB
PHP

<?php
require_once(__DIR__."/functions.php");
$bots=getBotsArray();
$postParams=get_Post_Params();
if(!$postParams){
$bot1="";
$bot2="";
}else{
$bot1=$postParams['bot1'];
$bot2=$postParams['bot2'];
}
?>
<article>
<h2>Lancer un combat</h2>
<p>
<select name="bot1" id="bot1">
<?php
for($i=0;$i<count($bots);$i++){
if($i==$bot1)
$selected='selected="selected"';
else
$selected='';
echo '<option value="'.$i.'" '.$selected.'>'.$bots[$i]['name'].'</option>';
}
?>
</select>
&nbsp;VS&nbsp;
<select name="bot2" id="bot2">
<?php
for($i=0;$i<count($bots);$i++){
if($i==$bot2)
$selected='selected="selected"';
else
$selected='';
echo '<option value="'.$i.'" '.$selected.'>'.$bots[$i]['name'].'</option>';
}
?>
</select>
</p>
<p><input type="button" value="Fight!" onclick="tictactoe(document.getElementById('bot1').value,document.getElementById('bot2').value);"></p>
</article>
<article id="fightResult"></article>