Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- art.py
- logo = '''
- _
- | |
- | |__ __ _ _ __ __ _ _ __ ___ __ _ _ __
- | '_ \ / _` | '_ \ / _` | '_ ` _ \ / _` | '_ \
- | | | | (_| | | | | (_| | | | | | | (_| | | | |
- |_| |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_|
- __/ |
- |___/ '''
- win = """
- __ __ _ _
- \ \ / / (_) | |
- \ \_/ /__ _ _ __ ___ _ __ | |
- \ / _ \| | | | \ \ /\ / / | '_ \| |
- | | (_) | |_| | \ V V /| | | | |_|
- |_|\___/ \__,_| \_/\_/ |_|_| |_(_)
- """
- lose = """
- __ __ _ _
- \ \ / / | | | |
- \ \_/ /__ _ _ | | ___ ___ ___| |
- \ / _ \| | | | | |/ _ \/ __|/ _ \ |
- | | (_) | |_| | | | (_) \__ \ __/_|
- |_|\___/ \__,_| |_|\___/|___/\___(_)"""
- stages = ["""
- 88 88
- 88 ,d 88
- 88 88 88
- ,adPPYb,88 ,adPPYba, ,adPPYYba, MM88MMM 88,dPPYba,
- a8" `Y88 a8P_____88 "" `Y8 88 88P' "8a
- 8b 88 8PP""""""" ,adPPPPP88 88 88 88
- "8a, ,d88 "8b, ,aa 88, ,88 88, 88 88
- `"8bbdP"Y8 `"Ybbd8"' `"8bbdP"Y8 "Y888 88 88
- ""","""
- 88
- 88 ,d
- 88 88
- ,adPPYb,88 ,adPPYba, ,adPPYYba, MM88MMM
- a8" `Y88 a8P_____88 "" `Y8 88
- 8b 88 8PP""""""" ,adPPPPP88 88
- "8a, ,d88 "8b, ,aa 88, ,88 88,
- `"8bbdP"Y8 `"Ybbd8"' `"8bbdP"Y8 "Y888
- """, """
- 88
- 88
- 88
- ,adPPYb,88 ,adPPYba, ,adPPYYba,
- a8" `Y88 a8P_____88 "" `Y8
- 8b 88 8PP""""""" ,adPPPPP88
- "8a, ,d88 "8b, ,aa 88, ,88
- `"8bbdP"Y8 `"Ybbd8"' `"8bbdP"Y8
- ""","""
- 88
- 88
- 88
- ,adPPYb,88 ,adPPYba,
- a8" `Y88 a8P_____88
- 8b 88 8PP"""""""
- "8a, ,d88 "8b, ,aa
- `"8bbdP"Y8 `"Ybbd8"'
- ""","""
- 88
- 88
- 88
- ,adPPYb,88
- a8" `Y88
- 8b 88
- "8a, ,d88
- `"8bbdP"Y8
- ""","""
- _
- | |
- | |__ __ _ _ __ __ _ _ __ ___ __ _ _ __
- | '_ \ / _` | '_ \ / _` | '_ ` _ \ / _` | '_ \
- | | | | (_| | | | | (_| | | | | | | (_| | | | |
- |_| |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_|
- __/ |
- |___/ """]
- words.py
- word_list = [
- 'abruptly',
- 'absurd',
- 'abyss',
- 'affix',
- 'askew',
- 'avenue',
- 'awkward',
- 'axiom',
- 'azure',
- 'bagpipes',
- 'bandwagon',
- 'banjo',
- 'bayou',
- 'beekeeper',
- 'bikini',
- 'blitz',
- 'blizzard',
- 'boggle',
- 'bookworm',
- 'boxcar',
- 'boxful',
- 'buckaroo',
- 'buffalo',
- 'buffoon',
- 'buxom',
- 'buzzard',
- 'buzzing',
- 'buzzwords',
- 'caliph',
- 'cobweb',
- 'cockiness',
- 'croquet',
- 'crypt',
- 'curacao',
- 'cycle',
- 'daiquiri',
- 'dirndl',
- 'disavow',
- 'dizzying',
- 'duplex',
- 'dwarves',
- 'embezzle',
- 'equip',
- 'espionage',
- 'euouae',
- 'exodus',
- 'faking',
- 'fishhook',
- 'fixable',
- 'fjord',
- 'flapjack',
- 'flopping',
- 'fluffiness',
- 'flyby',
- 'foxglove',
- 'frazzled',
- 'frizzled',
- 'fuchsia',
- 'funny',
- 'gabby',
- 'galaxy',
- 'galvanize',
- 'gazebo',
- 'giaour',
- 'gizmo',
- 'glowworm',
- 'glyph',
- 'gnarly',
- 'gnostic',
- 'gossip',
- 'grogginess',
- 'haiku',
- 'haphazard',
- 'hyphen',
- 'iatrogenic',
- 'icebox',
- 'injury',
- 'ivory',
- 'ivy',
- 'jackpot',
- 'jaundice',
- 'jawbreaker',
- 'jaywalk',
- 'jazziest',
- 'jazzy',
- 'jelly',
- 'jigsaw',
- 'jinx',
- 'jiujitsu',
- 'jockey',
- 'jogging',
- 'joking',
- 'jovial',
- 'joyful',
- 'juicy',
- 'jukebox',
- 'jumbo',
- 'kayak',
- 'kazoo',
- 'keyhole',
- 'khaki',
- 'kilobyte',
- 'kiosk',
- 'kitsch',
- 'kiwifruit',
- 'klutz',
- 'knapsack',
- 'larynx',
- 'lengths',
- 'lucky',
- 'luxury',
- 'lymph',
- 'marquis',
- 'matrix',
- 'megahertz',
- 'microwave',
- 'mnemonic',
- 'mystify',
- 'naphtha',
- 'nightclub',
- 'nowadays',
- 'numbskull',
- 'nymph',
- 'onyx',
- 'ovary',
- 'oxidize',
- 'oxygen',
- 'pajama',
- 'peekaboo',
- 'phlegm',
- 'pixel',
- 'pizazz',
- 'pneumonia',
- 'polka',
- 'pshaw',
- 'psyche',
- 'puppy',
- 'puzzling',
- 'quartz',
- 'queue',
- 'quips',
- 'quixotic',
- 'quiz',
- 'quizzes',
- 'quorum',
- 'razzmatazz',
- 'rhubarb',
- 'rhythm',
- 'rickshaw',
- 'schnapps',
- 'scratch',
- 'shiv',
- 'snazzy',
- 'sphinx',
- 'spritz',
- 'squawk',
- 'staff',
- 'strength',
- 'strengths',
- 'stretch',
- 'stronghold',
- 'stymied',
- 'subway',
- 'swivel',
- 'syndrome',
- 'thriftless',
- 'thumbscrew',
- 'topaz',
- 'transcript',
- 'transgress',
- 'transplant',
- 'triphthong',
- 'twelfth',
- 'twelfths',
- 'unknown',
- 'unworthy',
- 'unzip',
- 'uptown',
- 'vaporize',
- 'vixen',
- 'vodka',
- 'voodoo',
- 'vortex',
- 'voyeurism',
- 'walkway',
- 'waltz',
- 'wave',
- 'wavy',
- 'waxy',
- 'wellspring',
- 'wheezy',
- 'whiskey',
- 'whizzing',
- 'whomever',
- 'wimpy',
- 'witchcraft',
- 'wizard',
- 'woozy',
- 'wristwatch',
- 'wyvern',
- 'xylophone',
- 'yachtsman',
- 'yippee',
- 'yoked',
- 'youthful',
- 'yummy',
- 'zephyr',
- 'zigzag',
- 'zigzagging',
- 'zilch',
- 'zipper',
- 'zodiac',
- 'zombie',
- ]
- main.py
- import random
- import art
- import words
- def clear():
- print("\n"*50)
- play_again = "yes"
- while play_again == "yes":
- chosen_word = random.choice(words.word_list)
- lives = 6
- typed = []
- display = []
- clear()
- print(art.logo)
- for _ in chosen_word:
- display += "_"
- print(f"{' '.join(display)}")
- while "_" in display and lives > 1:
- counter = 0
- guess = input("Guess a letter: ").lower()
- typed += guess
- clear()
- if guess in display:
- clear()
- print(f'There is already letter "{guess}" in that word!')
- if guess in chosen_word:
- print (f"Good shot!!!")
- for letter in chosen_word:
- if letter == guess:
- display[counter] = guess
- counter += 1
- else:
- counter +=1
- if guess not in chosen_word:
- clear()
- print(f'There is no letter "{guess}" in that word!')
- lives -= 1
- print(art.stages[lives-1])
- print(f"You already typed letters: {' '.join(typed)}")
- print(f'{lives-1} lives left!')
- print(f"{' '.join(display)}")
- if not "_" in display:
- clear()
- print (art.win)
- if lives == 1:
- clear()
- print (art.lose)
- play_again = input ("\nDo you want to play again [yes/no] ").lower()
- print("Good bye! Have fun!")
Add Comment
Please, Sign In to add comment