Poli_Monoteista

Wisielec

Jan 10th, 2022
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 6.90 KB | None | 0 0
  1. art.py
  2. logo = '''
  3. _                                            
  4. | |                                            
  5. | |__   __ _ _ __   __ _ _ __ ___   __ _ _ __  
  6. | '_ \ / _` | '_ \ / _` | '_ ` _ \ / _` | '_ \
  7. | | | | (_| | | | | (_| | | | | | | (_| | | | |
  8. |_| |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_|
  9.                    __/ |                      
  10.                   |___/    '''
  11.  
  12. win = """
  13. __     __                    _       _
  14. \ \  / /                   (_)     | |
  15.  \ \_/ /__  _   _  __      ___ _ __ | |
  16.   \  / _ \| | | | \ \ /\ / / | '_ \| |
  17.    | | (_) | |_| |  \ V  V /| | | | |_|
  18.    |_|\___/ \__,_|   \_/\_/ |_|_| |_(_)
  19.                                        
  20.                                        """
  21. lose = """
  22. __     __           _                _
  23. \ \  / /          | |              | |
  24.  \ \_/ /__  _   _  | | ___  ___  ___| |
  25.   \  / _ \| | | | | |/ _ \/ __|/ _ \ |
  26.    | | (_) | |_| | | | (_) \__ \ __/_|
  27.    |_|\___/ \__,_| |_|\___/|___/\___(_)"""
  28.    
  29. stages = ["""
  30.        88                               88          
  31.         88                         ,d    88          
  32.         88                         88    88          
  33. ,adPPYb,88  ,adPPYba, ,adPPYYba, MM88MMM 88,dPPYba,  
  34. a8"    `Y88 a8P_____88 ""     `Y8   88    88P'    "8a  
  35. 8b       88 8PP""""""" ,adPPPPP88   88    88       88  
  36. "8a,   ,d88 "8b,   ,aa 88,    ,88   88,   88       88  
  37. `"8bbdP"Y8  `"Ybbd8"' `"8bbdP"Y8   "Y888 88       88  
  38. ""","""
  39.        88                              
  40.         88                         ,d    
  41.         88                         88    
  42. ,adPPYb,88  ,adPPYba, ,adPPYYba, MM88MMM
  43. a8"    `Y88 a8P_____88 ""     `Y8   88    
  44. 8b       88 8PP""""""" ,adPPPPP88   88    
  45. "8a,   ,d88 "8b,   ,aa 88,    ,88   88,  
  46. `"8bbdP"Y8  `"Ybbd8"' `"8bbdP"Y8   "Y888
  47. """, """
  48.         88                              
  49.         88                    
  50.         88                        
  51. ,adPPYb,88  ,adPPYba, ,adPPYYba,
  52. a8"    `Y88 a8P_____88 ""     `Y8
  53. 8b       88 8PP""""""" ,adPPPPP88
  54. "8a,   ,d88 "8b,   ,aa 88,    ,88
  55. `"8bbdP"Y8  `"Ybbd8"' `"8bbdP"Y8
  56. ""","""
  57.         88                              
  58.         88                    
  59.         88                        
  60. ,adPPYb,88  ,adPPYba,
  61. a8"    `Y88 a8P_____88
  62. 8b       88 8PP"""""""
  63. "8a,   ,d88 "8b,   ,aa
  64. `"8bbdP"Y8  `"Ybbd8"'
  65. ""","""
  66.         88                              
  67.         88                    
  68.         88                        
  69. ,adPPYb,88
  70. a8"    `Y88
  71. 8b       88
  72. "8a,   ,d88
  73. `"8bbdP"Y8
  74. ""","""
  75. _                                            
  76. | |                                            
  77. | |__   __ _ _ __   __ _ _ __ ___   __ _ _ __  
  78. | '_ \ / _` | '_ \ / _` | '_ ` _ \ / _` | '_ \
  79. | | | | (_| | | | | (_| | | | | | | (_| | | | |
  80. |_| |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_|
  81.                    __/ |                      
  82.                   |___/    """]
  83.  
  84. words.py
  85.  
  86. word_list = [
  87. 'abruptly',
  88. 'absurd',
  89. 'abyss',
  90. 'affix',
  91. 'askew',
  92. 'avenue',
  93. 'awkward',
  94. 'axiom',
  95. 'azure',
  96. 'bagpipes',
  97. 'bandwagon',
  98. 'banjo',
  99. 'bayou',
  100. 'beekeeper',
  101. 'bikini',
  102. 'blitz',
  103. 'blizzard',
  104. 'boggle',
  105. 'bookworm',
  106. 'boxcar',
  107. 'boxful',
  108. 'buckaroo',
  109. 'buffalo',
  110. 'buffoon',
  111. 'buxom',
  112. 'buzzard',
  113. 'buzzing',
  114. 'buzzwords',
  115. 'caliph',
  116. 'cobweb',
  117. 'cockiness',
  118. 'croquet',
  119. 'crypt',
  120. 'curacao',
  121. 'cycle',
  122. 'daiquiri',
  123. 'dirndl',
  124. 'disavow',
  125. 'dizzying',
  126. 'duplex',
  127. 'dwarves',
  128. 'embezzle',
  129. 'equip',
  130. 'espionage',
  131. 'euouae',
  132. 'exodus',
  133. 'faking',
  134. 'fishhook',
  135. 'fixable',
  136. 'fjord',
  137. 'flapjack',
  138. 'flopping',
  139. 'fluffiness',
  140. 'flyby',
  141. 'foxglove',
  142. 'frazzled',
  143. 'frizzled',
  144. 'fuchsia',
  145. 'funny',
  146. 'gabby',
  147. 'galaxy',
  148. 'galvanize',
  149. 'gazebo',
  150. 'giaour',
  151. 'gizmo',
  152. 'glowworm',
  153. 'glyph',
  154. 'gnarly',
  155. 'gnostic',
  156. 'gossip',
  157. 'grogginess',
  158. 'haiku',
  159. 'haphazard',
  160. 'hyphen',
  161. 'iatrogenic',
  162. 'icebox',
  163. 'injury',
  164. 'ivory',
  165. 'ivy',
  166. 'jackpot',
  167. 'jaundice',
  168. 'jawbreaker',
  169. 'jaywalk',
  170. 'jazziest',
  171. 'jazzy',
  172. 'jelly',
  173. 'jigsaw',
  174. 'jinx',
  175. 'jiujitsu',
  176. 'jockey',
  177. 'jogging',
  178. 'joking',
  179. 'jovial',
  180. 'joyful',
  181. 'juicy',
  182. 'jukebox',
  183. 'jumbo',
  184. 'kayak',
  185. 'kazoo',
  186. 'keyhole',
  187. 'khaki',
  188. 'kilobyte',
  189. 'kiosk',
  190. 'kitsch',
  191. 'kiwifruit',
  192. 'klutz',
  193. 'knapsack',
  194. 'larynx',
  195. 'lengths',
  196. 'lucky',
  197. 'luxury',
  198. 'lymph',
  199. 'marquis',
  200. 'matrix',
  201. 'megahertz',
  202. 'microwave',
  203. 'mnemonic',
  204. 'mystify',
  205. 'naphtha',
  206. 'nightclub',
  207. 'nowadays',
  208. 'numbskull',
  209. 'nymph',
  210. 'onyx',
  211. 'ovary',
  212. 'oxidize',
  213. 'oxygen',
  214. 'pajama',
  215. 'peekaboo',
  216. 'phlegm',
  217. 'pixel',
  218. 'pizazz',
  219. 'pneumonia',
  220. 'polka',
  221. 'pshaw',
  222. 'psyche',
  223. 'puppy',
  224. 'puzzling',
  225. 'quartz',
  226. 'queue',
  227. 'quips',
  228. 'quixotic',
  229. 'quiz',
  230. 'quizzes',
  231. 'quorum',
  232. 'razzmatazz',
  233. 'rhubarb',
  234. 'rhythm',
  235. 'rickshaw',
  236. 'schnapps',
  237. 'scratch',
  238. 'shiv',
  239. 'snazzy',
  240. 'sphinx',
  241. 'spritz',
  242. 'squawk',
  243. 'staff',
  244. 'strength',
  245. 'strengths',
  246. 'stretch',
  247. 'stronghold',
  248. 'stymied',
  249. 'subway',
  250. 'swivel',
  251. 'syndrome',
  252. 'thriftless',
  253. 'thumbscrew',
  254. 'topaz',
  255. 'transcript',
  256. 'transgress',
  257. 'transplant',
  258. 'triphthong',
  259. 'twelfth',
  260. 'twelfths',
  261. 'unknown',
  262. 'unworthy',
  263. 'unzip',
  264. 'uptown',
  265. 'vaporize',
  266. 'vixen',
  267. 'vodka',
  268. 'voodoo',
  269. 'vortex',
  270. 'voyeurism',
  271. 'walkway',
  272. 'waltz',
  273. 'wave',
  274. 'wavy',
  275. 'waxy',
  276. 'wellspring',
  277. 'wheezy',
  278. 'whiskey',
  279. 'whizzing',
  280. 'whomever',
  281. 'wimpy',
  282. 'witchcraft',
  283. 'wizard',
  284. 'woozy',
  285. 'wristwatch',
  286. 'wyvern',
  287. 'xylophone',
  288. 'yachtsman',
  289. 'yippee',
  290. 'yoked',
  291. 'youthful',
  292. 'yummy',
  293. 'zephyr',
  294. 'zigzag',
  295. 'zigzagging',
  296. 'zilch',
  297. 'zipper',
  298. 'zodiac',
  299. 'zombie',
  300. ]
  301.  
  302. main.py
  303.  
  304. import random
  305. import art
  306. import words
  307. def clear():
  308.   print("\n"*50)
  309.  
  310. play_again = "yes"
  311.  
  312. while play_again == "yes":
  313.   chosen_word = random.choice(words.word_list)
  314.   lives = 6
  315.   typed = []
  316.   display = []
  317.   clear()
  318.   print(art.logo)
  319.   for _ in chosen_word:
  320.       display += "_"
  321.   print(f"{' '.join(display)}")
  322.  
  323.  
  324.   while "_" in display and lives > 1:
  325.    
  326.     counter = 0
  327.     guess = input("Guess a letter: ").lower()
  328.     typed += guess
  329.     clear()
  330.     if guess in display:
  331.         clear()
  332.         print(f'There is already letter "{guess}" in that word!')
  333.     if guess in chosen_word:
  334.       print (f"Good shot!!!")
  335.       for letter in chosen_word:
  336.         if letter == guess:
  337.             display[counter] = guess
  338.             counter += 1
  339.         else:
  340.             counter +=1
  341.  
  342.     if guess not in chosen_word:
  343.       clear()
  344.       print(f'There is no letter "{guess}" in that word!')
  345.       lives -= 1
  346.     print(art.stages[lives-1])
  347.     print(f"You already typed letters: {' '.join(typed)}")
  348.     print(f'{lives-1} lives left!')
  349.     print(f"{' '.join(display)}")
  350.  
  351.   if not "_" in display:
  352.     clear()
  353.     print (art.win)
  354.   if lives == 1:
  355.     clear()
  356.     print (art.lose)
  357.   play_again = input ("\nDo you want to play again [yes/no] ").lower()
  358.  
  359. print("Good bye! Have fun!")
Add Comment
Please, Sign In to add comment