add correction

This commit is contained in:
JARNOUEN DE VILLARTAY Ulysse (SAFRAN AIRCRAFT ENGINES)
2026-04-02 13:48:28 +02:00
parent eb2d8315f9
commit 6dd596e7b3
5 changed files with 113 additions and 55 deletions
+20 -4
View File
@@ -1,3 +1,19 @@
<?php
// Generate random values for two six-sided dice.
$die1 = mt_rand(1, 6);
$die2 = mt_rand(1, 6);
$sum = $die1 + $die2;
// Map dice values to matching SVG filenames.
$diceImages = [
1 => 'dice-six-faces-one.svg',
2 => 'dice-six-faces-two.svg',
3 => 'dice-six-faces-three.svg',
4 => 'dice-six-faces-four.svg',
5 => 'dice-six-faces-five.svg',
6 => 'dice-six-faces-six.svg',
];
?>
<!DOCTYPE html>
<html lang="fr">
<head>
@@ -13,12 +29,12 @@
</head>
<body>
<main>
<h5><a href=""> Tirage aléatoire</a></h5>
<h5><a href="./">Tirage aléatoire</a></h5>
<article class="is-center">
<img src='./img/dice-six-faces-five.svg'>
<img src='./img/dice-six-faces-one.svg'>
<img src="./img/<?= $diceImages[$die1] ?>" alt="Dé 1 : <?= $die1 ?>">
<img src="./img/<?= $diceImages[$die2] ?>" alt="Dé 2 : <?= $die2 ?>">
</article>
<h5>Somme = </h5>
<h5>Somme = <?= $sum ?></h5>
</main>
</body>
</html>