Home > Back-end >  C program hungman game
C program hungman game

Time:12-08

How to write C program hungman game to bring the figure (SIMS)

Hangman (hereinafter referred to as guess the word game), is a double game, guess the word have two players in the game, a player is responsible for selecting words, another player responsible for guess,
Guess the word game process can be described as follows:
1) responsible for the selection of players from randomly select a word in the dictionary, draw the corresponding number location (each position using a symbol "_"), and draw on a scaffold,
2) responsible for the guess guess one character at a time, and submitted to responsible for the selection of the player;
3) if the characters in the word, is responsible for choosing players fill all the characters in position in the character; If the character is not in word, selected player is painted on the gallows, every time a pen, and painted in sequence;
4) if the six strokes, responsible for the guessing player hasn't guess out all characters, prompt players for failure; Otherwise the game end ahead of schedule, prompt players for success,

Typical scaffold and small painting (drawing) as follows:
Scaffold pen pen pen pen pen 5 4 3 2 1 6 pens


Here is a character version of the scaffold and SIMS:


Job requirements:
1) one side of the computer as the selected words are responsible for selecting words, scaffold and SIMS, draw the user's input, and the rest of the space, prompt the user input;
2) the computer from the word list randomly select a word game, the screen draw the gallows and figures, and draw the word space position;
3) every time the result of the game at the end of the computer display, real words, the user guess sequences of characters;
4) after the game, every time the computer prompt the user whether to continue, if it is, is to start the game; If not, then the end of the game,
5) need to consider the robustness of the program, the program for the user to enter the fault-tolerant ability,

End
  • Related