I am creating a guessing game. Here are the instructions for the game- The Challenge:
Write a program that picks a random integer from 1 to 100, and has players guess the number. The rules are: If a player's guess is less than 1 or greater than 100, say "OUT OF BOUNDS" On a player's first turn, if their guess is within 10 of the number, return "WARM!" further than 10 away from the number, return "COLD!" On all subsequent turns, if a guess is closer to the number than the previous guess return "WARMER!" farther from the number than the previous guess, return "COLDER!" When the player's guess equals the number, tell them they've guessed correctly and how many guesses it took! You can try this from scratch, or follow the steps outlined below. A separate Solution notebook has been provided. Good luck!
My code is attached as a pic. I am facing an error when setting up 2 conditions of IF statement. What am I doing wrong?enter image description here
Aucun commentaire:
Enregistrer un commentaire