.
This commit is contained in:
parent
98dd6280e6
commit
fd95227e8b
|
@ -79,7 +79,7 @@ function score($board,$me,$opponent,$colToPlay,$depth){
|
||||||
//if grid is full
|
//if grid is full
|
||||||
$full = true;
|
$full = true;
|
||||||
for($i = 0; $i < 7; $i++){
|
for($i = 0; $i < 7; $i++){
|
||||||
if($newBoard == " "){
|
if($newBoard == "+"){
|
||||||
$full = false;
|
$full = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ function score($board,$me,$opponent,$colToPlay,$depth){
|
||||||
}
|
}
|
||||||
|
|
||||||
if($depth < 5){
|
if($depth < 5){
|
||||||
return 0 - better_col($newBoard,$opponent,$me,$depth + 1) + $depth;
|
return 0 - better_col($newBoard,$opponent,$me,$depth + 1);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user