Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions Hangman.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import random
import hangman_art
import hangman_words


# stages = ['''
# +---+
Expand Down Expand Up @@ -59,11 +62,13 @@

# Create a List

word_list = ["aardvark", "baboon", "camel"]
# Print the logo from the hangman_art
print(random.choice(hangman_art.logos))

# Randomly select the word in the list to a variable
# word_list = ["aardvark", "baboon", "camel"]

chosen_word = random.choice(word_list)
# Randomly select word from the word_list, imported from the hangman_words
chosen_word = random.choice(hangman_words.word_list)

# Creating an empty list
display = []
Expand All @@ -72,18 +77,14 @@
lives = 6

# Printing out the guess word
print(f"Psst, the guess word is:", chosen_word)
print(f"Psst, the guess word is:", {chosen_word})

# For loop for creating the dash sign
for char in chosen_word:
# display += "_"
display.append("_")
# print(display)

# for name in chosen_word:
# if guess not in name:
# lives -= 1
# print(lives)

while True:

Expand All @@ -107,7 +108,7 @@
if guess not in chosen_word:
lives -= 1
# Print out the ASCII stages index base on the number of lives left as a value for the list (stages)
print(stages[lives])
print(hangman_art.stages[lives])

# Check for no lives and exit the loop
if lives == 0:
Expand Down
45 changes: 41 additions & 4 deletions hangman_art.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,51 @@
=========
''']

logo = '''
logos = ['''
888
888
888
88888b. 8888b. 88888b. .d88b. 88888b.d88b. 8888b. 88888b.
888 "88b "88b888 "88bd88P"88b888 "888 "88b "88b888 "88b
888 888.d888888888 888888 888888 888 888.d888888888 888
888 888888 888888 888Y88b 888888 888 888888 888888 888
888 888"Y888888888 888 "Y88888888 888 888"Y888888888 888
888
Y8b d88P
"Y88P"


''',


'''
88
88
88
88,dPPYba, ,adPPYYba, 8b,dPPYba, ,adPPYb,d8 88,dPYba,,adPYba, ,adPPYYba,
88P' "8a "" `Y8 88P' `"8a a8" `Y88 88P' "88" "8a "" `Y8
88 88 ,adPPPPP88 88 88 8b 88 88 88 88 ,adPPPPP88
88 88 88, ,88 88 88 "8a, ,d88 88 88 88 88, ,88
88 88 `"8bbdP"Y8 88 88 `"YbbdP"Y8 88 88 88 `"8bbdP"Y8
aa, ,88
"Y8bbdP"
8b,dPPYba,
88P' `"8a
88 88
88 88
88 88


''',

'''
_
| |
| |__ __ _ _ __ __ _ _ __ ___ __ _ _ __
| '_ \ / _` | '_ \ / _` | '_ ` _ \ / _` | '_ \
| | | | (_| | | | | (_| | | | | | | (_| | | | |
|_| |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_|
__/ |
|___/

'''
|___/
''']