Skip to content

Latest commit

 

History

History
137 lines (81 loc) · 4.23 KB

README.md

File metadata and controls

137 lines (81 loc) · 4.23 KB

hang_man

Contributors: Trevor Rapp, David Wise, Bob Ziroll

Completed as part of the Coding Campus, now V-School, curriculum




hangman



JavaScript



DESCRIPTION:

"Every guilty person is his own hangman."

-- Seneca

This is a simple game of hangman done completely in Python. The program asks if the user wants to have the rules explained or if they want to play. When it comes time to play the program chooses a random word from a list of words. The program then displays the number of spaces in the word and the player is left to guess a letter. The program checks the letter guessed and filters out case issues or non alphabetic characters and returns an error message if there is one. If the input is valid, then the program checks if and where the character is contained in the word and displays which empty space is now filled in. If the guess is incorrect the computer chooses from a list of disparaging remarks to taunt the player and displays how much of the person is "drawn." The player wins if all letters are guessed correctly in under 5 guesses.



QUICKSTART INSTRUCTIONS:

  1. Make sure you have a Python interpreter installed:
  • on a Mac type ⌘ + space
  • type "terminal"
  • press Enter
  • in the shell command line type
\\Check the system Python version
$ python --version

\\Check the Python 2 version
$ python2 --version

\\Check the Python 3 version
$ python3 --version

  1. This will show you if you have Python installed already and which version you have installed.

  2. If you need to, install Python

  • From your browser navigate to Python.org
  • On the Python.org page, find the links to download the file. Versions are available for Mac or Windows. However, I found the Mac version worked more consistently for me.


image



  1. Create a Folder to hold the program
  • in the terminal type mkdir Hangman or whatever other name you want to call it.
  • navigate into the folder by typing cd Hangman
  • clone the program into the Hangman folder you just created by typing:
git clone https://github.com/trrapp12/hang_man.git
  1. Make sure you are still in the Hangman folder
  2. You should be able to see a program named 'hangman.py'. If not, navigate back into the Hangman folder.
  3. Type python hangman.py to run the program from the terminal
  4. The program runs from prompts in the Command Line, so watch for prompts and respond accordingly.
  5. Enjoy!


THIS PROJECT DEMONSTRATES THE FOLLOWING:

  • Correct use of functions, conditionals, loops, arrays.

  • Properly sequence Python statements.

  • Select a random word from a dictionary of words.

  • Display all guesses on the user's screen so the user knows what letters he/she has already guessed.

  • Display a visual indication for each letter in the word.

  • Display the number of turns remaining.

  • Decrement the number of turns remaining.

  • Display letters guessed in the position that they are contained in the word.



CHALLENGES I OVERCAME:

  • This was one of my first coding projects so, while a great opportunity for me to learn about iteration and logic statements, the credit for the work goes to the instructor.


MY OWN PERSONAL CONTRIBUTIONS INCLUDED:

  • The work was that of the instructor. This was one of my first coding projects so, while a great opportunity for me to learn about iteration and logic statements, the credit for the work goes to the instructor.


ATTRIBUTIONS

  • Instructor lead project completed by me with direction from Bob Ziroll.


YOU CAN FIND ME AT:

For more information see my LinkedIn or return to my Github