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
@ryanbourneuk
Copy link

Perfect, precisely what I needed :)

@Mubariz
Copy link

Mubariz commented Feb 3, 2014

Your all wastemans!!!! SUCKERS

@cfcd1999
Copy link

cfcd1999 commented Mar 3, 2016

but where do i find the code? i want to know how it is done...

@ilebsky
Copy link

ilebsky commented May 1, 2018

can someone help me with these:
Detailed pseudocode for your Game:
Detailed pseudocode includes the names of all functions, all program paths, and intended variable names
I should be able to understand how you intend to write your whole program from the pseudocode
Must be neat and formatted

@parashghosh
Copy link

simple, straightforward :)

@dev-Jbostick
Copy link

Awesome! I have something along these lines however I am developing for two players.

@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