very first project. any help will be very much appreciated.
Hi there, and welcome to the forums.
That doesnât look quite finished to me - is there a specific step where youâre stuck? (If so, can you also post a link to the project on Codecademy please?)
have just completed it but I lost the link to the project
I have created project but when I go to next round - the next round button become deactivated. Any ideas why?
I wrote my code out, but when I try it out the âNextâ button doesnât work so I only only do one round, and Iâm not getting any errors in the debugger. I tried looking online, but my code look similar to what I have. Does anyone have an ideas as to what I am doing wrong?
let humanScore = 0;
let computerScore = 0;
let currentRoundNumber = 1;
// Write your code below:
const generateTarget = () =>{
let secret = Math.floor(Math.random() * 10);
return secret
}
const compareGuesses = (human, computer, secret) =>{
let h1 = Math.abs(human - secret)
let c1 = Math.abs(computer - secret)
if (human >= 9 || human <= 0){
alert âPlease select a number from 1 - 9â
}
if (h1 < c1 || h1 === c1 ){
return true;}
else if (c1 < h1){
return false;}
}
const updateScore = winner => {
if (winner === âhumanâ) {
humanScore += 1;}
else if (winner === âcomputerâ){
computerScore = computerScore + 1
}
}
const advancedRound = () => {
currentRoundNumber += 1;
};
âAdvancedâ is an adjective; âadvanceâ is a verb. What is the name of the function that game.js
calls for this event?
Thanks, yes I keep changing the names when I donât mean to. Good eye!