2022-11-17 16:12:51 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Dice</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<?php
|
|
|
|
$num_dice = rand(1,10);
|
|
|
|
?>
|
|
|
|
<h1><?= $num_dice ?> dados</h1>
|
|
|
|
<?php
|
|
|
|
$max = -1;
|
|
|
|
for($i = 0; $i < $num_dice; $i++) {
|
2022-11-17 16:29:44 +00:00
|
|
|
$roll = rand(1,6);
|
|
|
|
if($roll > $max)
|
|
|
|
$max = $roll;
|
2022-11-17 16:12:51 +00:00
|
|
|
?>
|
2022-11-17 16:29:44 +00:00
|
|
|
<img src="imgs/<?= $roll ?>.svg" />
|
2022-11-17 16:12:51 +00:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<p>El valor más grande obtenido es <b><?= $max ?></b>.</p>
|
|
|
|
<p>Última modificación de esta página: <?= date('Y-m-d', filemtime(__FILE__)) ?>
|
|
|
|
</body>
|
|
|
|
</html>
|