From ec06d2c2cface837dace01f283d23b0e8955c39a Mon Sep 17 00:00:00 2001 From: gnieark Date: Wed, 16 Dec 2015 00:06:35 +0100 Subject: [PATCH] grrrr --- html/StupidIABattleship.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/html/StupidIABattleship.php b/html/StupidIABattleship.php index f5221a7..a464951 100644 --- a/html/StupidIABattleship.php +++ b/html/StupidIABattleship.php @@ -61,7 +61,7 @@ switch($_POST['act']){ //construire une grille for($i=0; $i < $width; $i++){ for($j=0; $j < $height; $j++){ - $map[$i][$j]=0; + $map[$j][$i]=0; } } @@ -94,7 +94,7 @@ switch($_POST['act']){ //vers le bas $bottom=true; - for($i=$ytest; $i < $ytest + $shipWidth -1; $i++){ + for($i = $ytest; $i < $ytest + $shipWidth -1; $i++){ if ((!isset($map[$i][$xtest])) OR ($map[$i][$xtest] == 1)){ $bottom=false; @@ -112,9 +112,7 @@ switch($_POST['act']){ } } - //gauche - $left=true; for($i = $xtest; $i >= $xtest - $shipWidth + 1; $i--){ if((!isset($map[$ytest][$i]))