fix
This commit is contained in:
parent
5228bfdfa5
commit
837b534707
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user