Dice Roller

Author
Ex-Meta Staff Engineer
Languages

Build a dice roller app that simulates the results of rolling a specified number of 6-sided dice.

Requirements

  • The user can specify the number of dice to roll using the input field and the value can be an integer between 1 to 12 inclusive.
  • Upon clicking the "Roll" button, the dice roll is simulated and the results are displayed.
  • The results of the dice roll should be displayed in rows of three.

The example below shows a potential result of rolling 6 dice.

Dice roller example

Source

This question is adapted from FrontendEval's Rolling Dice question.

The Mobile Fear Factor Tee — The ultimate horror storySponsor: SwagOverflow
The Mobile Fear Factor Tee — The ultimate horror story

Bugs? Manageable. But "It looks weird on my phone"? Pure terror. This black tee perfectly captures every front end engineer's worst fear — mystery UI issues on an unknown device. Whether it's a client's 5-year-old Android or some obscure browser setting, you already know it's going to be painful.

Get yours now ->

The Mobile Fear Factor Tee — The ultimate horror storySponsor: SwagOverflow
The Mobile Fear Factor Tee — The ultimate horror story

Bugs? Manageable. But "It looks weird on my phone"? Pure terror. This black tee perfectly captures every front end engineer's worst fear — mystery UI issues on an unknown device. Whether it's a client's 5-year-old Android or some obscure browser setting, you already know it's going to be painful.

Get yours now ->