Learn Intermediate Algorithmic Thinking by Building a Dice Game - Step 17

Tell us what’s happening:

This is my conde to get a random number between 1 and 6 inclusive:

const randomDice = Math.floor((Math.random() * 6) + 1);

I get an error message that says I should use a Math.floor method.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

 const randomDice = Math.floor((Math.random() * 6) + 1);   

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.15

Challenge Information:

Learn Intermediate Algorithmic Thinking by Building a Dice Game - Step 17

Hey there!
Remove the extra parentheses (,before Math.random and after your last addition 1 .
@Albi73

1 Like

It worked. Thank you so much! :+1:

2 Likes

Your welcome. Happy Coding.