Question
Using C#: Create a game similar to Hangman named GuessAWord in which a player guesses letters to try to replicate a hidden word. Store at
Using C#:
Create a game similar to Hangman named GuessAWord in which a player guesses letters to try to replicate a hidden word. Store at least eight words in an array, and randomly select one to be the hidden word.
Initially, display the hidden word using asterisks to represent each letter. Allow the user to guess letters to replace the asterisks in the hidden word until the user completes the entire word.
If the user guesses a letter that is not in the hidden word, display an appropriate message.
If the user guesses a letter that appears multiple times in the hidden word, make sure that each correct letter is placed.
(This problem relies on the generation of a random number. You can create a random number that is at least min but less than max using the following statements:
Random ranNumberGenerator = new Random(); int randomNumber; randomNumber = ranNumberGenerator.Next(min, max);
0 Instructions GuessAWord.cs + > 1 using System; 2 using static System.Console; 3 class GuessAWord If the user guesses a letter that is not in the hidden word, display an appropriate message. 4 { static void Main() { // Write your main here ] 6 7 8 9} 10 If the user guesses a letter that appears multiple times in the hidden word, make sure that each correct letter is placed. 6 Figure 6-27 shows a typical game in progress. Word: ********* Guess a letter >> s Sorry. s is not in the word Word: ********* Guess a letter >> e Yes! e is in the word Word: ********e Guess a letter >> r Yes! r is in the word Word: ********e Guess a letter >> a Yes! a is in the word Word: **p***a*e Guess a letter >> Figure 6-27 Typical execution of console-based GuessAWord 0 Instructions GuessAWord.cs + > 1 using System; 2 using static System.Console; 3 class GuessAWord If the user guesses a letter that is not in the hidden word, display an appropriate message. 4 { static void Main() { // Write your main here ] 6 7 8 9} 10 If the user guesses a letter that appears multiple times in the hidden word, make sure that each correct letter is placed. 6 Figure 6-27 shows a typical game in progress. Word: ********* Guess a letter >> s Sorry. s is not in the word Word: ********* Guess a letter >> e Yes! e is in the word Word: ********e Guess a letter >> r Yes! r is in the word Word: ********e Guess a letter >> a Yes! a is in the word Word: **p***a*e Guess a letter >> Figure 6-27 Typical execution of console-based GuessAWordStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started