empty file connectfour
This commit is contained in:
parent
d948403d40
commit
b8dd435685
23
connectfour.php
Normal file
23
connectfour.php
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?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 battle ship
|
||||||
|
* choose by random a free column
|
||||||
|
*/
|
||||||
|
$in=file_get_contents('php://input');
|
||||||
|
$params=json_decode($in, TRUE);
|
||||||
|
switch($params['action']){
|
||||||
|
case "init":
|
||||||
|
echo '{"name":"Gnieark"}';
|
||||||
|
break;
|
||||||
|
case "play-turn":
|
||||||
|
|
||||||
|
$grid=$params['board'];
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user