# 6230 MINRoll Dices
# 62
30 MIN
Overview
Practice generating random integer values within different ranges using Math.random() by building a dice roller app and three random number generators.
Requirements
- Form:
- The input defaults to
3and only accepts values between1and6. - The Roll button (
data-testid="roll") submits the form.
- The input defaults to
- On submit, roll as many dice as the input value:
- Render one
Dicecomponent per dice. - Each dice shows a random value between
1and6.
- Render one
- Add three random number generators, each with a Roll button and a result display:
- Between
-10and10, both included. - Between
7and14, both not included. - Between
0and255, both included.
- Between
Notes
Dice.tsxis provided and read-only.- Respect the
data-testidvalues expected by the tests.
Tests
- default input value 3
- does not roll more than 6 dices
- does not roll less than 1 dice
- when click roll, number dices equals input value
- maps random values to dice faces
- first random is between -10 and 10 (both included)
- second random is between 8 and 13 (both not included)
- third random is between 0 and 255 (both included)