Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let humanScore = 0;
let computerScore = 0;
let currentRoundNumber = 1;
// Write your code below:
function generateTarget() {
return Math.floor(Math.random() * 10);
}
function compareGuesses(usrGuess ,comGuess ,secNum) {
if (comGuess === secNum && usrGuess != secNum || Math.abs(usrGuess - secNum) > Math.abs(comGuess - secNum)) {
return false;
} else {
return true;
}
};
function updateScore(winner) {
if (winner === "human") {
humanScore += 1;
} else {
computerScore +=1;
}
};
function advanceRound() {
currentRoundNumber += 1;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.