From 2e5efe917ff912a17c9f284621cdda1f4e5bc6a3 Mon Sep 17 00:00:00 2001 From: pythonboi Date: Wed, 1 Sep 2021 20:42:19 -0400 Subject: [PATCH] import hangman_art and hangman_words --- Hangman.py | 19 ++++++++++--------- hangman_art.py | 45 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/Hangman.py b/Hangman.py index b5724b1..367af5d 100644 --- a/Hangman.py +++ b/Hangman.py @@ -1,4 +1,7 @@ import random +import hangman_art +import hangman_words + # stages = [''' # +---+ @@ -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 = [] @@ -72,7 +77,7 @@ 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: @@ -80,10 +85,6 @@ display.append("_") # print(display) -# for name in chosen_word: -# if guess not in name: -# lives -= 1 -# print(lives) while True: @@ -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: diff --git a/hangman_art.py b/hangman_art.py index 475e1ff..dbe1219 100644 --- a/hangman_art.py +++ b/hangman_art.py @@ -55,7 +55,44 @@ ========= '''] -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 + + +''', + + ''' _ | | | |__ __ _ _ __ __ _ _ __ ___ __ _ _ __ @@ -63,6 +100,6 @@ | | | | (_| | | | | (_| | | | | | | (_| | | | | |_| |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_| __/ | - |___/ - - ''' \ No newline at end of file + |___/ + + ''']