Advertisement
Guest User

Untitled

a guest
May 19th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.28 KB | None | 0 0
  1. import random
  2. import time
  3. from os import system
  4.  
  5. class Shot(object):
  6.     def __init__(self, name=None, ingredients=None):
  7.         self.name = name
  8.         self.ingredients = ingredients
  9.  
  10. shots = []
  11.  
  12. shots.append(Shot("BLOODSHOT", "Vodka, Tomato, Garlic, Chili, Spices"))
  13. shots.append(Shot("GARLIC VODKA", "Vodka, Vitlok"))
  14. shots.append(Shot("GARLIC HONEY VODKA", "Vodka, Vitlokschonung"))
  15. shots.append(Shot("GARLIC HONEY BRANDY", "Brandy, Vitlokschonung"))
  16. shots.append(Shot("GARLIC HONEY DARK RUM", "Mork Rom, Vitlokschonung"))
  17. shots.append(Shot("GARLIC MARTINI SHOOTER", "Vitloksvodka, Nolly Prat, Oliv"))
  18. shots.append(Shot("LONG GIN SHOT", "Gin, Cointrau, Lime"))
  19. shots.append(Shot("INSTANT MARGERITA", "Tequila, Cointrau, Lime"))
  20. shots.append(Shot("FERNET TRIPLE STAR", "Fernet Branca, Brandy, Cointrau"))
  21. shots.append(Shot("FLY ME TO THE MOON", "Banan, Vodka, Tequila, Menthe, Southern Comfort"))
  22.  
  23. def clear():
  24.   _ = system('clear')
  25.  
  26. def choose_random_shot():
  27.   t_end = time.time() + 2
  28.  
  29.   while time.time() < t_end:
  30.     time.sleep(0.08)
  31.     selected_shot = random.randint(0, len(shots) - 1)
  32.     display_text = str(selected_shot + 1) + ": " + shots[selected_shot].name + " - " + shots[selected_shot].ingredients
  33.  
  34.     clear()
  35.     print(display_text)
  36.  
  37. choose_random_shot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement