fix win cells coords

This commit is contained in:
gnieark 2016-05-21 22:30:15 +02:00
parent 5c6a3ec547
commit fbf7c74987

View File

@ -113,7 +113,7 @@ switch ($_POST['act']){
$x--; $x--;
$y++; $y++;
$count++; $count++;
$cellsWin[]=array($x - 1,$y + 1); $cellsWin[]=array($x,$y);
} }
$x=$strikeX; $x=$strikeX;
@ -122,7 +122,7 @@ switch ($_POST['act']){
$x++; $x++;
$y--; $y--;
$count++; $count++;
$cellsWin[]=array($x + 1,$y - 1); $cellsWin[]=array($x,$y);
} }
if($count>3){ if($count>3){
@ -141,7 +141,7 @@ switch ($_POST['act']){
$x++; $x++;
$y++; $y++;
$count++; $count++;
$cellsWin[]=array($x + 1 ,$y -1); $cellsWin[]=array($x,$y);
} }
$x=$strikeX; $x=$strikeX;
$y=$strikeY; $y=$strikeY;
@ -149,7 +149,7 @@ switch ($_POST['act']){
$x--; $x--;
$y--; $y--;
$count++; $count++;
$cellsWin[]=array($x + 1 ,$y -1); $cellsWin[]=array($x,$y);
} }
if($count>3){ if($count>3){
$wins=true; $wins=true;
@ -167,14 +167,14 @@ switch ($_POST['act']){
while(($x < 6) && ($_SESSION['map'][$y][$x + 1 ] == $you)){ while(($x < 6) && ($_SESSION['map'][$y][$x + 1 ] == $you)){
$x++; $x++;
$count++; $count++;
$cellsWin[]=array($x +1 ,$y); $cellsWin[]=array($x,$y);
}
}
$x=$strikeX; $x=$strikeX;
while(($x >0) && ($_SESSION['map'][$y][$x - 1 ] == $you)){ while(($x >0) && ($_SESSION['map'][$y][$x - 1 ] == $you)){
$count++; $count++;
$x--; $x--;
$cellsWin[]=array($x -1,$y); $cellsWin[]=array($x,$y);
} }
if($count>3){ if($count>3){
$wins=true; $wins=true;
@ -193,14 +193,14 @@ switch ($_POST['act']){
while(($y < 5) && ($_SESSION['map'][$y + 1 ][$x] == $you)){ while(($y < 5) && ($_SESSION['map'][$y + 1 ][$x] == $you)){
$y++; $y++;
$count++; $count++;
$cellsWin[]=array($x ,$y + 1); $cellsWin[]=array($x,$y);
} }
$y=$strikeY; $y=$strikeY;
while(($y >0) && ($_SESSION['map'][$y - 1][$x] == $you)){ while(($y >0) && ($_SESSION['map'][$y - 1][$x] == $you)){
$count++; $count++;
$y--; $y--;
$cellsWin[]=array($x ,$y -1); $cellsWin[]=array($x,$y);
} }
if($count>3){ if($count>3){
$wins=true; $wins=true;