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.
- 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
-
This will show you if you have Python installed already and which version you have installed.
-
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.
- 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
- Make sure you are still in the Hangman folder
- You should be able to see a program named 'hangman.py'. If not, navigate back into the Hangman folder.
- Type
python object_oriented_hangman.py
to run the program from the terminal - The program runs from prompts in the Command Line, so watch for prompts and respond accordingly.
- Enjoy!
- 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.
- Object Oriented Programming techniques.
- Classes and Inheritance.
*For more information see my LinkedIn or return to my Github