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; | |
// Generate the new secret target number | |
const generateTarget = () => Math.floor(Math.random() * 10); | |
// Calculate the distance from the computer guess to the target and from the human guess to the target | |
const getAbsoluteDistance = (num1, num2) => Math.abs(num1 - num2); |