test vertical

This commit is contained in:
gnieark 2016-05-15 00:15:51 +02:00
parent 1f602275ef
commit 3d0d969acd
2 changed files with 12 additions and 1 deletions

View File

@ -140,6 +140,18 @@ switch ($_POST['act']){
} }
} }
//tester si 4 pions allignés vers le haut
if((!$wins) && ($j<3)){
$wins = true;
for($y = $j+1; $y < $j + 4; $j++){
if($_SESSION['map'][$y][$i] <> $you){
$wins=false;
break;
}
}
}
} }
} }
} }

View File

@ -57,7 +57,6 @@ function connectFour(bot1,bot2,xd_check, newGame){
//fill the grid //fill the grid
if( reponse['strikeX'] > -1){ if( reponse['strikeX'] > -1){
//alert(reponse['strikeSymbol']);
document.getElementById('td' + reponse['strikeX'] + '_' + reponse['strikeY']).innerHTML = reponse['strikeSymbol']; document.getElementById('td' + reponse['strikeX'] + '_' + reponse['strikeY']).innerHTML = reponse['strikeSymbol'];
} }
if(reponse['continue'] == 1){ if(reponse['continue'] == 1){