plop
This commit is contained in:
parent
a86705bad9
commit
0066000b6e
|
@ -31,11 +31,15 @@ function score_case($map,$me,$him,$case,$depth=0){
|
||||||
OR (($newMap['0-2']==$newMap['1-1'])&&($newMap['1-1']==$newMap['2-0'])&&($newMap['2-0']!==""))
|
OR (($newMap['0-2']==$newMap['1-1'])&&($newMap['1-1']==$newMap['2-0'])&&($newMap['2-0']!==""))
|
||||||
){
|
){
|
||||||
return 10 - $depth;
|
return 10 - $depth;
|
||||||
|
}else{
|
||||||
|
if($depth == 9){
|
||||||
|
return 0;
|
||||||
}else{
|
}else{
|
||||||
$sc=choose_better_cell($newMap,$him,$me,$depth + 1);
|
$sc=choose_better_cell($newMap,$him,$me,$depth + 1);
|
||||||
return -$sc[1];
|
return -$sc[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function choose_better_cell($map,$me,$him,$depth=0){
|
function choose_better_cell($map,$me,$him,$depth=0){
|
||||||
$betterCell="";
|
$betterCell="";
|
||||||
$betterScore=-100;
|
$betterScore=-100;
|
||||||
|
@ -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).'"}';
|
Loading…
Reference in New Issue
Block a user