Open p98nikku opened 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.
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?
if you rolled dice-1 the currentscore will reset thats the functionality of the game not error i thought the same on first time
//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;