From 88c227e1883007476ec3f13d51a5cf5b6b115115 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Mon, 14 Dec 2015 16:48:27 +0100 Subject: [PATCH] fix dynamic var --- html/StupidIABattleship.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/html/StupidIABattleship.php b/html/StupidIABattleship.php index cc8d0be..f645b93 100644 --- a/html/StupidIABattleship.php +++ b/html/StupidIABattleship.php @@ -70,7 +70,8 @@ switch($_POST['act']){ //pour toutes les tailles de bateau for($shipWidth = 6; $shipWidth >= 0; $shipWidth--){ //nombre de bateau à placer de cette taille - $shipCount=$('ship'.$shipWidth); // #trollface + $dynVar='ship'.$shipWidth; + $shipCount=$$dynVar; // #trollface for( $sh = 0; $sh < $shipCount; $sh++){ $directions=array(); while( count($directions) == 0){