Coming from the front end path, it felt like I was thrown into this project without much explanation to what node was or how to use it and how it works with VSC.
Somehow I’m supposed to use this new program on my own to do this project. It was very confusing, but I figured it out with the help of someone on the discord.
Hi, I believe I have this working so I believe my code is correct - now for the real test - if someone could take a look at this and let me know if and where I can improve/correct things, much appreciated
Hello everyone I’m trying to add the alert function to my code in the CodeCademy workspace for the moment before I move it over to VSCode. How would I go about creating a function to check the range of the users guess since it is a parameter in the compareGuesses function? The hint provided makes sense I just don’t know if I can even use the userGuess or humanGuess parameter to compare its value. Your help would be greatly appreciated thank you.
Hey, I see the issue with the updateScore function, when you return humanScore and computerScore it should be like this “return humanScore++” and "return “computerScore++”. This will increment the scores by 1. The way you have it written adds 1 and assigns the variables to that new value which we don’t want to happen since both variables change as you progress through the game.
Hey! No sure if your question was answered already. But I actually just added an additional line of code to the compareGuesses function. Essentially, i have the computer check that humanGuess is in the range, if not, the alert is triggered. If the number is in range, the rest of the if/else-if will run.
I know someone said the issue was how you wrote the increments as += vs ++, both will work. Your logs are printing correctly. The computer is printing to the console what you are asking, the round should be 1 because the game will initialize there, the updated score is undefined because you dont have a winner , and the compare guesses will return true because at the initializing of the game neither the human or computer have a guess, making the guesses “the same” and that returns true.