This commit is contained in:
Gnieark 2016-05-31 09:36:28 +02:00
parent a86705bad9
commit 0066000b6e

View File

@ -32,8 +32,12 @@ function score_case($map,$me,$him,$case,$depth=0){
){
return 10 - $depth;
}else{
$sc=choose_better_cell($newMap,$him,$me,$depth + 1);
return -$sc[1];
if($depth == 9){
return 0;
}else{
$sc=choose_better_cell($newMap,$him,$me,$depth + 1);
return -$sc[1];
}
}
}
function choose_better_cell($map,$me,$him,$depth=0){
@ -73,4 +77,4 @@ if(!isset($hisSymbol)){
}
echo choose_better_cell($message['board'],$message['you'], $hisSymbol,9 - $freeCells);
echo '{"play":"'.choose_better_cell($message['board'],$message['you'], $hisSymbol,9 - $freeCells).'"}';