Dice Roller App
Try It Now
To test the Dice Roller App yourself and see the functionality in action, click the link below:
×
Overview
The Dice Roller App is a lightweight web application that simulates rolling two dice. It records each result in your browser's localStorage
, so the latest rolls persist even after you refresh.
Features
- Roll Two Dice: Click a button to generate two random numbers from 1 to 6.
- Random Outcomes: Dice faces change every roll.
- History Tracking: Stores the last ten rolls in a list.
- Persistent Storage: Keeps history using
localStorage
across reloads.
Purpose
Demonstrates Codex's ability to generate a small, stateful game entirely in the browser.
How It Works
- Rolling: Press the "Roll Dice" button to generate new values for each die.
- Updating History: The combination and total are prepended to the history list.
- Persisting: History is saved in
localStorage
so previous rolls appear on reload.