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 trialTijl Declerck
1,211 PointsCan't open it in the web browser
Same damn problem every time. Shouldn't it at least open the prompt window? really frustrating.
''' var randomNumber = math.floor(Math.random()*6)+1;
var answer = prompt('I have a number in my head between 1 and 6, can you guess it?');
if (parseInt(answer) === randomNumber){ document.write("<p> You're right! </p>") } else{ document.write("<p> WRONG! </p>") }
'''
2 Answers
Doegena Fennich
8,974 Pointschange math.floor to Math.floor and you're good to go.
Doegena Fennich
8,974 PointsWeird, it works on http://jsbin.com/rogopasuwo/edit?js,output. maybe you should relaunch your workspace sometimes it gets a lil buggy. If it still not works check if you put the right name of the js file in the HTML script tag.
Tijl Declerck
1,211 PointsTijl Declerck
1,211 PointsI changed it and it's still not working.