complete-javascript-course icon indicating copy to clipboard operation
complete-javascript-course copied to clipboard

DOCUMENT NOT FOUND ERROR IN DOM-PIG-GAME

Open p98nikku opened this issue 4 years ago • 3 comments

//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;

p98nikku avatar Aug 24 '20 07:08 p98nikku

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 ([email protected]mailto:[email protected]) 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.

jonasschmedtmann avatar Aug 30 '20 15:08 jonasschmedtmann

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?

hamo225 avatar Sep 22 '20 10:09 hamo225

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

Rohan235 avatar Jan 31 '21 08:01 Rohan235