tracks

Sign In Sign Up
1/10
Snake Eyes
Do you want to play a game?

We're going to look at making a simple dice game using all of the coding skills covered so far as a test of your coding genius.

To get started we need to recall how to make simulate a die roll by generating a random number between 1 and 6.

Instructions

Write code to generate a random number between 1 and 6 store the value in a variable called diceRoll.

?
Stuck? Get a hint! Hint

Math.random() and Math.floor() should help you here.

You could also look at the [Math] { math } section of the glossary to look at how to use them to make random numbers.

script.js
Back to Editor

Sign in