Write the code to play a number guessing game in Excel. The game is the old favorite that starts with a prompt like "I am thinking of a number between 0 and 20". And then you define how many guesses the guesser gets – they guess and you respond with answers like: "too high", "too low", "correct!". But, if the guesses uses up his/her guesses – they lose.
Create a "form-like" input area on a Worksheet on which the user will input the game
parameters and see the game results. Consider these elements:
Allow the user to enter the range of numbers for the guessing game: lower and upper numbers from which the secret number will be selected (the portion to handle the "I'm thinking of a number between").
• Let the user input the number of guesses they think they need to guess the secret number.
• These inputs should be entered directly on the worksheet by the person playing the game. You can prepopulate those cells with default values – like Low = 0, High = 20, Number of Guesses = 5 as that may save the game player some keystrokes! But, do not use an Inputbox to capture this input!
• Add a properly labeled button to the worksheet that will start the game play.
• Consider the best way to provide the response to each guess. Things you may want to
Get Free Quote!
338 Experts Online