jonasschmedtmann / complete-javascript-course

Starter files, final projects, and FAQ for my Complete JavaScript course
https://www.udemy.com/the-complete-javascript-course/?couponCode=C3GITHUB10
15.85k stars 16.88k forks source link

DOCUMENT NOT FOUND ERROR IN DOM-PIG-GAME #97

Open p98nikku opened 4 years ago

p98nikku commented 4 years ago

//this is the code that i used but it is showing error and not working and i am not able to find out the error.Can you please help me with @jonasschmedtmann //the number of current -0 is not changing at all var scores, roundScore, activePlayer, dice; scores = [0, 0]; roundScore = 0; activePlayer = 0;

dice = Math.floor(Math.random() * 6) + 1; document.querySelector('#current-' + activePlayer).textContent = dice;

jonasschmedtmann commented 4 years ago

Hi Neetika,

Please post this question in the official course Q&A on Udemy, this is the central place for all questions, and makes this information available to all students of the course :)

-- Jonas Schmedtmann jonas.iohttp://jonas.io / @jonasschmedtmanhttps://twitter.com/jonasschmedtman

On August 24, 2020 at 9:09 AM, Neetika Paliwal (notifications@github.commailto:notifications@github.com) wrote: //this is the code that i used but it is showing error and not working and i am not able to find out the error.Can you please help me with @jonasschmedtmannhttps://github.com/jonasschmedtmann //the number of current -0 is not changing at all var scores, roundScore, activePlayer, dice; scores = [0, 0]; roundScore = 0; activePlayer = 0; dice = Math.floor(Math.random() * 6) + 1; document.querySelector('#current-' + activePlayer).textContent = dice; — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/jonasschmedtmann/complete-javascript-course/issues/97, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEO2BAV747CK23NQ3VQ4G33SCIGYZANCNFSM4QJFRPDA.

hamo225 commented 4 years ago

You said it is showing an error? Can you be more specific? what is the error? Have you declared the variable dice before using it?

Rohan235 commented 3 years ago

if you rolled dice-1 the currentscore will reset thats the functionality of the game not error i thought the same on first time