22 lines
427 B
PHP
22 lines
427 B
PHP
<?php
|
|
|
|
header('Access-Control-Allow-Origin: *');
|
|
header('Access-Control-Allow-Methods: GET, POST');
|
|
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
|
|
|
|
/*
|
|
* stupid IA for tron
|
|
*/
|
|
$in=file_get_contents('php://input');
|
|
$params=json_decode($in, TRUE);
|
|
switch($params['action']){
|
|
case "init":
|
|
echo '{"name":"Stupid AI"}';
|
|
break;
|
|
case "play-turn":
|
|
//to do
|
|
break;
|
|
default:
|
|
break;
|
|
}
|