This commit is contained in:
Gnieark 2016-07-04 22:45:04 +02:00
parent 5228bfdfa5
commit 837b534707
2 changed files with 7 additions and 3 deletions

View File

@ -73,7 +73,9 @@ function play($map,$colToPlay,$me,$opponent,$gameid,$player_index){
map='".hash_map($map,$me,$opponent)."', map='".hash_map($map,$me,$opponent)."',
play_at='".$colToPlay."';"); play_at='".$colToPlay."';");
echo '{"play":'.$colToPlay.',"comment":"'.$trace.'"}'; //echo '{"play":'.$colToPlay.',"comment":"'.$trace.'"}';
echo '{"play":'.$colToPlay.',"comment":13}';
die; die;
} }

View File

@ -27,7 +27,9 @@ switch($params['action']){
} }
//get my head coords //get my head coords
$myCoords = end($params['board'][$params['player-index']]); $myCoords = end($params['board'][$params['player-index']]);
list($x,$y) = explode(",",$myCoords);
$x = $myCoords[0];
$y = $myCoords[1];
$availablesDirs = array(); $availablesDirs = array();
if (in_array(($x + 1).",".$y, $busyCells)){ if (in_array(($x + 1).",".$y, $busyCells)){
@ -47,7 +49,7 @@ switch($params['action']){
echo '{"play":"x+","comment":"I Loose"}'; echo '{"play":"x+","comment":"I Loose"}';
}else{ }else{
shuffle($availablesDirs); shuffle($availablesDirs);
echo '{"play":"'.$availablesDirs[0].'","comment":"I Loose"}'; echo '{"play":"'.$availablesDirs[0].'"}';
} }
break; break;