<?php
$games = file("games.txt", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$game = $games[array_rand($games)];
?>
<!DOCTYPE html>
<html>
    <head>
        <title>pin</title>
        <link rel="stylesheet" href="https://tilde.team/~ben/gruvbox/gruvbox.min.css">
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    </head>
    <body id="top">
        <main>
            <img  src="cslogo.png" alt="CS Logo">
	    <center><h1>The Coin Slot - Pinball Picker</h1></center>
            
            <p>reload the page, or press Ready Player 1 button to pick another game</p>
            <center><button onClick="history.go(0);">Ready Player 1</button></center>
	    <ul>
            <?php foreach ($games as $g) {
            if ($g === $game) { ?>
                <li><strong><mark><?=$g?></mark></strong></li>
            <?php } else { ?>
                <li><?=$g?></li>
            <?php }
            } ?>
            </ul>
	<p>*if the pinball game picked for your team is not working, just reload the page and have another game picked for you</p>
	<hr>
	<p>created by Ben H. Modified by Russ R.</p>
            
        </main>
    </body>
</html>

