From fbf7c7498792599d56999450d8ab9f945086f9e1 Mon Sep 17 00:00:00 2001 From: gnieark Date: Sat, 21 May 2016 22:30:15 +0200 Subject: [PATCH] fix win cells coords --- src/arenas/connectFour/act.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/arenas/connectFour/act.php b/src/arenas/connectFour/act.php index ece917f..d4b5f6c 100644 --- a/src/arenas/connectFour/act.php +++ b/src/arenas/connectFour/act.php @@ -113,7 +113,7 @@ switch ($_POST['act']){ $x--; $y++; $count++; - $cellsWin[]=array($x - 1,$y + 1); + $cellsWin[]=array($x,$y); } $x=$strikeX; @@ -122,7 +122,7 @@ switch ($_POST['act']){ $x++; $y--; $count++; - $cellsWin[]=array($x + 1,$y - 1); + $cellsWin[]=array($x,$y); } if($count>3){ @@ -141,7 +141,7 @@ switch ($_POST['act']){ $x++; $y++; $count++; - $cellsWin[]=array($x + 1 ,$y -1); + $cellsWin[]=array($x,$y); } $x=$strikeX; $y=$strikeY; @@ -149,7 +149,7 @@ switch ($_POST['act']){ $x--; $y--; $count++; - $cellsWin[]=array($x + 1 ,$y -1); + $cellsWin[]=array($x,$y); } if($count>3){ $wins=true; @@ -167,14 +167,14 @@ switch ($_POST['act']){ while(($x < 6) && ($_SESSION['map'][$y][$x + 1 ] == $you)){ $x++; $count++; - $cellsWin[]=array($x +1 ,$y); + $cellsWin[]=array($x,$y); + } - $x=$strikeX; while(($x >0) && ($_SESSION['map'][$y][$x - 1 ] == $you)){ $count++; $x--; - $cellsWin[]=array($x -1,$y); + $cellsWin[]=array($x,$y); } if($count>3){ $wins=true; @@ -193,14 +193,14 @@ switch ($_POST['act']){ while(($y < 5) && ($_SESSION['map'][$y + 1 ][$x] == $you)){ $y++; $count++; - $cellsWin[]=array($x ,$y + 1); + $cellsWin[]=array($x,$y); } $y=$strikeY; while(($y >0) && ($_SESSION['map'][$y - 1][$x] == $you)){ $count++; $y--; - $cellsWin[]=array($x ,$y -1); + $cellsWin[]=array($x,$y); } if($count>3){ $wins=true;