Skip to content

The classic game of hangman written completely in Python. The hangman game randomly chooses a word, count its letters, and presents a list of “_” characters equal to that number. The player guesses a letter which the game checks. If it’s correct it replaces the “_” character with the letter and continues. If it is in-correct it “draws” the hangm…

Notifications You must be signed in to change notification settings

trrapp12/object_oriented_hangman

Repository files navigation

object_oriented_hangman

Contributors: Trevor Rapp, David Wise, Bob Ziroll

hangman




Description:

This is version 2.0 of an earlier Project. It evolved from the "hang_man" also listed in my GitHub account. We simply took it and made it more object-oriented.




Instructions on how to launch:

  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:
https://github.com/trrapp12/object_oriented_hangman.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 object_oriented_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!



Original project demonstrated 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.



This project adds additional use of:

  • Object Oriented Programming techniques.
  • Classes and Inheritance.



More Information:

*For more information see my LinkedIn or return to my Github

About

The classic game of hangman written completely in Python. The hangman game randomly chooses a word, count its letters, and presents a list of “_” characters equal to that number. The player guesses a letter which the game checks. If it’s correct it replaces the “_” character with the letter and continues. If it is in-correct it “draws” the hangm…

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages