In this game, the computer generates a number between 1-100 and the user should guess
that number is 6 tries or less. For each time the user gets a wrong guess the computer
should tell the user if the number generated by the computer is greater or less than the user
The user has a total of 6 tries. For each time the user fail, a picture will be displayed in a
PictureBox showing part of a gallows platform. If the user uses all six tries, then a picture
of a skeleton hanging will be shown. If the user gets the number in 6 tries or less, a picture
of a dancing skeleton will be displayed.
Your GUI should have one textbox input. One button. A label for displaying the result, a
picture box for displaying an image each time the user checks his number, and a group box
containing two radio buttons that are displayed once the game is over to prompt the user if
he/ she want to play again. The groupBox should not be apparent when the game is in play
mode. The focus will be always on the textbox that takes the input and the enter key should
be a default action that simulate the button when pressed.
Your programming should utilize if-stmts and also a switch structure. The switch structure
will check which try the user is in, and take appropriate action like loading the correct
picture in the picture box.
You will be provided with all pictures for this program. You need to import these pictures
as resources in order to use them. Screenshots are below on how the program should look.
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.
public partial class Form1 : Form
private int guessedNumber;
private Random rnd;
private int counter;
pictureBox1.Image = Properties.Resources.Hangman_Game_red;
rnd = new Random();
button1.Enabled = false;
textBox1.Enabled = false;
radioButton1.Checked = false;
radioButton2.Checked = false;
private void radioButton2_CheckedChanged(object sender, EventArgs e)