diff --git a/src/arenas/tictactoe/act.php b/src/arenas/tictactoe/act.php new file mode 100644 index 0000000..e69de29 diff --git a/src/arenas/tictactoe/functions.php b/src/arenas/tictactoe/functions.php new file mode 100644 index 0000000..722dab6 --- /dev/null +++ b/src/arenas/tictactoe/functions.php @@ -0,0 +1,31 @@ + $name, "url" =>$url); + } + } + return $bots; +} +function getIAResponse($youChar,$iaBaseUrl,$grille){ + /*transforme la grille en parametres http GET + * et fait la requete vers $iaBaseUrl + * Retourne la réponse de l'IA + */ + $paramsGrille=""; + foreach($grille as $key => $case){ + $paramsGrille.="&".$key."=".$case; + } + $url=$iaBaseUrl."?you=".$youChar.$paramsGrille; + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + $output = curl_exec($ch); + curl_close($ch); + return htmlentities($output); +} \ No newline at end of file diff --git a/src/arenas/tictactoe/listOfBots.txt b/src/arenas/tictactoe/listOfBots.txt new file mode 100644 index 0000000..fd17f62 --- /dev/null +++ b/src/arenas/tictactoe/listOfBots.txt @@ -0,0 +1,3 @@ +stupidAI http://morpionmaster.tinad.fr/stupidIa.php +moul http://tictactoe.m.42.am/ +Gnieark http://morpionmaster.tinad.fr/gnieark.php diff --git a/src/arenas/tictactoe/public.php b/src/arenas/tictactoe/public.php index 020f14a..377d9a0 100644 --- a/src/arenas/tictactoe/public.php +++ b/src/arenas/tictactoe/public.php @@ -1 +1,5 @@ -

tic tac toe

\ No newline at end of file +