<?php

include(__DIR__ . "/config.php");
include(__DIR__ . "/autoload_namespace.php");

$rolls = array();
$dice = new \Rasb14\Dice\Dice();

for ($i = 0; $i < 6; $i++) {
    array_push($rolls, $dice->roll());
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>Page Title</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
    <h1>Rolling dice six times</h1>
    <ol>
        <?php
        for ($i = 0; $i < count($rolls); $i++) {
            echo "<li>" . $rolls[$i] . "</li>";
        }
        ?>
    </ol>
    <p>Sum: <?= array_sum($rolls) ?></p>
    <p>Average: <?= (array_sum($rolls) / count($rolls)) ?></p>
</body>
</html>
