Skip to content

Instantly share code, notes, and snippets.

View thehcker's full-sized avatar

Isaac Nyakoi thehcker

View GitHub Profile
@thehcker
thehcker / hangman.py
Last active July 3, 2019 21:19
The name of this game is Hangman. The player only has 6 incorrect guesses (head, body, 2 legs, and 2 arms) before they lose the game. Firstly, we loaded a random word list from sowpods dictionary and pick a word from it. Secondly, we wrote the logic for guessing the letter and displaying that information to the user. Finally, we have to put it a…
import random
# A function that prints the hangman using ASCII whenever called
def printHang(n):
hang = [['---- '],
['| | '],
['| '],
['| '],
['| ']]
if n < 6:
hang[2] = ['| o ']