// Number Guessing Game (Mainly based on chance) // const winCon = "Good Job! You guessed correctly!"; const loseCon = "Incorrect... The correct answer was "; function playGuessingGame() { const computerChoice = Math.floor(Math.random() * 4) + 1; let userChoice = parseInt(prompt("Guess a number between 1 and 4:")); function checkGuess() { if (userChoice === computerChoice) { alert(winCon); } else { alert(loseCon + computerChoice); } } checkGuess(); } playGuessingGame();