Question

Using a list, create a game that allows a user 3 guesses. You should consider a...

Using a list, create a game that allows a user 3 guesses. You should consider a list of 5 items (you can consider any list you want, e.g. a list of 5 different foods’ names).   You are to create a game that asks a user to make 3 guesses. Track the guesses and what the guess was. Provide a code that tracks all user guesses and counts those guesses.

I want to create a simple code that allows the user to guess three colors of the rainbow. I want the correct guesses to be red, blue, yellow and the other colors to display an error message or incorrect message. Any help will do.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Add the colors red blue yellow to the list.

Ask the user to enter three colors of the rainbow.

Use if statement and iterate to the list if it matches the list colors completely print success message or print error or incorrect message.

Please rate it if the above solution helps you in any way or if you have any concerns comment it, I will help you through again.

Add a comment
Know the answer?
Add Answer to:
Using a list, create a game that allows a user 3 guesses. You should consider a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using a list, create a game that allows a user 3 guesses. You should consider a list of 5 items (you can consider any list you want, e.g. a list of 5 different foods’ names). You are to create a game...

    Using a list, create a game that allows a user 3 guesses. You should consider a list of 5 items (you can consider any list you want, e.g. a list of 5 different foods’ names). You are to create a game that asks a user to make 3 guesses. Track the guesses and what the guess was. Provide a code in C language that tracks all user guesses and counts those guesses.

  • Computer Guesses - Create a page that allows the user to think of a number from...

    Computer Guesses - Create a page that allows the user to think of a number from 1 to 100. Write a function that will guess the number the user chose. The user will provide clues: higher or lower and correct. It should take no more than 7 guesses to get the correct number. User Guesses - Create a page that generates a random number from 1 to 100. Allow the user only 7 guesses to guess the number. Provide clues:...

  • Create a JavaFX game: Guess the Number create a random # between 1 and 1000 Ask...

    Create a JavaFX game: Guess the Number create a random # between 1 and 1000 Ask user for a guess; possible answers TOO LOW TOO HIGH WINNER! print guess to screen if the user wins, write the random number, and all the guesses to a file. If the user doesn't guess in 10 turns, display the number. NOTES: You may want to implement: Restart option Best Guess statistic (game 1 took 8 tries, game 2 took 5 - 5 is...

  • For this assignment, you will write a program that guesses a number chosen by your user....

    For this assignment, you will write a program that guesses a number chosen by your user. Your program will prompt the user to pick a number from 1 to 10. The program asks the user yes or no questions, and the guesses the user’s number. When the program starts up, it outputs a prompt asking the user to guess a number from 1 to 10. It then proceeds to ask a series of questions requiring a yes or no answer....

  • Create a new program, WordGuessingGame. Using a while loop, create a game for the user. The...

    Create a new program, WordGuessingGame. Using a while loop, create a game for the user. The game requires the user to guess a secret word. The game does not end until the user guesses the word. After they win the game, they are prompted to choose to play again. The secret word that user must guess is "valentine". It is a case-sensitive analysis With each guess... If the guess does not have an equal number of characters, tell the user...

  • Overview In this exercise you are going to recreate the classic game of hangman. Your program...

    Overview In this exercise you are going to recreate the classic game of hangman. Your program will randomly pick from a pool of words for the user who will guess letters in order to figure out the word. The user will have a limited number of wrong guesses to complete the puzzle or lose the round. Though if the user answers before running out of wrong answers, they win. Requirements Rules The program will use 10 to 15 words as...

  • Currently, the game allows players to play as many times as they wish. It does not...

    Currently, the game allows players to play as many times as they wish. It does not provide any feedback on how the players are doing, however. Modify the game so that it keeps track of the number of games played as well as the average number of guesses made per game. To implement this change, add the following list of global variables to the beginning of the script’s Main Script Logic section. Assign each variable an initial value of zero....

  • For a C program hangman game: Create the function int play_game [play_game ( Game *g )]...

    For a C program hangman game: Create the function int play_game [play_game ( Game *g )] for a C program hangman game. (The existing code for other functions and the program is below, along with what the function needs to do) (Also the link to program files (hangman.h and library file) is below the existing code section. You can use that to check if the code works) What int play_game needs to do mostly involves calling other functions you've already...

  • Write a Java application program that plays a number guessing game with the user. In the...

    Write a Java application program that plays a number guessing game with the user. In the starter code that you are given to help you begin the project, you will find the following lines of code: Random generator = args.length == 0 ? new Random() :                    new Random(Integer.parseInt(args[0])); int secret = generator.nextInt(100); You must keep these lines of code in your program. If you delete these lines, or if you change thse lines in any way, then your program...

  • Guess my Number Create a world containing an actor (your choice) and an environment (your choice)....

    Guess my Number Create a world containing an actor (your choice) and an environment (your choice). When the world begins to play, the actor selects a WholeNumber at random in the range 1..99. The actor then repeatedly asks you to guess the number. If you guess too high, the actors say “Too high” and if you guess too low, the actor says “Too low.” The actor keeps track of the number of erroneous guesses. If you guess correctly, the actor...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT