IAS/stupidIATron.php

22 lines
427 B
PHP
Raw Normal View History

2016-07-01 07:32:39 +02:00
<?php
2016-07-01 07:34:27 +02:00
2016-07-01 07:32:39 +02:00
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;
}