Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNate Luzod
6,707 PointsMy solution... Not sure if this looks good, or what.
/* Random # Challenge */
var num1 = prompt("Give us a number. We're going to use this to get all random and shit.");
var number1 = parseInt(num1);
var result = Math.floor( Math.random() * number1 ) + 1;
document.write("The number is " + result + ".");
var smallNum = parseInt( prompt("Please choose the minimum number for your dice roll"));
var bigNum = parseInt( prompt("Please give us the max number for your dice roll"));
var dieRoll = Math.floor( Math.random() * (bigNum - smallNum + 1) + smallNum);
alert(dieRoll);
William Li
Courses Plus Student 26,868 PointsWilliam Li
Courses Plus Student 26,868 PointsHi, Nate, I've corrected the syntax highlighting for you.