From 1dcd20de8511c527e4821d3ea64f36da69cfa2e4 Mon Sep 17 00:00:00 2001 From: "JARNOUEN DE VILLARTAY Ulysse (SAFRAN AIRCRAFT ENGINES)" Date: Wed, 8 Apr 2026 17:13:19 +0200 Subject: [PATCH] use constants for rock paper scissors --- R3.01/tp/tp3/chifoumi/index.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/R3.01/tp/tp3/chifoumi/index.php b/R3.01/tp/tp3/chifoumi/index.php index 6045fd4..7df181a 100644 --- a/R3.01/tp/tp3/chifoumi/index.php +++ b/R3.01/tp/tp3/chifoumi/index.php @@ -1,9 +1,13 @@ [0 => "Draw", 1 => "Loss", 2 => "Win"], - 1 => [0 => "Win", 1 => "Draw", 2 => "Loss"], - 2 => [0 => "Loss", 1 => "Win", 2 => "Draw"], + $ROCK => [$ROCK => "Draw", $PAPER => "Loss", $SCISSORS => "Win"], + $PAPER => [$ROCK => "Win", $PAPER => "Draw", $SCISSORS => "Loss"], + $SCISSORS => [$ROCK => "Loss", $PAPER => "Win", $SCISSORS => "Draw"], ]; $playerChoice = filter_input(