This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let humanScore = 0; | |
let computerScore = 0; | |
let currentRoundNumber = 1; | |
const generateTarget = () => Math.floor(Math.random() * 9); | |
const getAbsoluteDistance = (guess, targetGuess) => Math.abs(guess-targetGuess) | |
function compareGuesses(userGuess, computerGuess, targetGuess) { | |
if (userGuess > 9 || userGuess < 0) { | |
alert('guess out of range') |