From 9ef5aee3151fee55fa1d82fa09cd90cde39883d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20A=2E=20Ortega=20Froysa?= Date: Thu, 17 Nov 2022 17:29:44 +0100 Subject: [PATCH] Simplify code. Array not necessary. --- 2/IAW/exercises/php/dice.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/2/IAW/exercises/php/dice.php b/2/IAW/exercises/php/dice.php index 854c206..ff5e152 100644 --- a/2/IAW/exercises/php/dice.php +++ b/2/IAW/exercises/php/dice.php @@ -9,14 +9,13 @@ $num_dice = rand(1,10); ?>

dados

$max) - $max = $rolls[$i]; + $roll = rand(1,6); + if($roll > $max) + $max = $roll; ?> - +