This commit is contained in:
Gnieark 2016-06-15 13:37:15 +02:00
parent 95924b1d51
commit 6d1d652156

View File

@ -115,7 +115,7 @@ switch($params['action']){
} }
if (can_loose($colStr,$opponent) !== false){ if (can_loose($colStr,$opponent) !== false){
$colForNoLose = $x; $colForNoLose = $x;
} }
} }
//horizontales //horizontales
@ -129,7 +129,7 @@ switch($params['action']){
die; die;
} }
if (can_loose($lnStr,$opponent) !== false){ if (can_loose($lnStr,$opponent) !== false){
$colForNoLose = can_loose($lnStr,$opponent); $colForNoLose = can_loose($lnStr,$opponent);
} }
} }
@ -145,11 +145,11 @@ switch($params['action']){
$diagStr.=$params['board'][$y][$x]; $diagStr.=$params['board'][$y][$x];
} }
if(can_win($diagStr,$params['you']) !== false){ if(can_win($diagStr,$params['you']) !== false){
echo '{"play":'.$x.'}'; echo '{"play":'.($k + can_win($diagStr,$params['you'])).'}';
die; die;
} }
if (can_loose($diagStr,$opponent) !== false){ if (can_loose($diagStr,$opponent) !== false){
$colForNoLose = $x; $colForNoLose = $k + can_loose($diagStr,$opponent);
} }
//diagonale \ //diagonale \
@ -158,11 +158,11 @@ switch($params['action']){
$diagStr.=$params['board'][$y][$x]; $diagStr.=$params['board'][$y][$x];
} }
if(can_win($diagStr,$params['you']) !== false){ if(can_win($diagStr,$params['you']) !== false){
echo '{"play":'.$x.'}'; echo '{"play":'.($k + can_win($diagStr,$params['you'])).'}';
die; die;
} }
if (can_loose($diagStr,$opponent) !== false){ if (can_loose($diagStr,$opponent) !== false){
$colForNoLose = $x; $colForNoLose = ($k + can_loose($diagStr,$opponent));
} }