Skip to content

Instantly share code, notes, and snippets.

@kmandreza
Created January 12, 2013 04:28
Show Gist options
  • Save kmandreza/4516100 to your computer and use it in GitHub Desktop.
Save kmandreza/4516100 to your computer and use it in GitHub Desktop.
Using pseudocode, write a simple hangman game. The point of pseudocode is to represent the logical structureof a program without getting bogged down in the syntax of a particular language. For example, a program to select the largest integer from an array of integers might be written like this in pseudocode initialize max_so_far to the first ele…
# generate a word at random and store it in a variable
# display the length of the word to the user
# correct_guesses is less than the length of the word
# prompt the user to guess a letter
# if the guess is correct increment correct_guesses by 1
# if the guess is incorrect increment incorrect_guesses by 1
# and draw the next part of the hangman
# if the incorrect_guesses is greater than 8, tell the user
# they lost and exit the program
# if correct_guesses is equal to the length of the word, tell the user they won
@tammy-lim428
Copy link

How to
In pseudocode, how to write the random function in a words bank which contains 1000 words to randomly collect anyone word?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment