Advertisement
Guest User

Python coin flipper(stack overflow info)

a guest
Jan 17th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.30 KB | None | 0 0
  1. import random
  2. import time
  3.  
  4. #Picking up the coin array
  5. comment = ["Finding the coin...", "Saving the world from a massive plague...", "Actually flipping a coin...", "Introducing Bias...", "Hacking your computer...", "Entering the matrix...", "Making Python bite...", "Giving all your details to the NSA...", "Thinking of more phrases...", "Stealing your bank account details...", "Planning mission to SePT-A 51..."]
  6.  
  7. #Coin flip array
  8. coin = ["Heads", "Tails"]
  9.  
  10. #Flip program
  11. def flipit(random, flip, time, comment, repeat):
  12.     time.sleep(1)
  13.     print("It begins...")
  14.     print("\n")
  15.     for x in range(0, 10):
  16.         print("Flip number", x + 1)
  17.         print(random.choice(comment))
  18.         time.sleep(1)
  19.         print(random.choice(coin),"\n")
  20.         time.sleep(2)
  21.         print("\n")
  22.     from collections import Counter
  23.     counting = []
  24.     cnt = Counter(counting)
  25.     cnt
  26.     print("Type startup(time) to begin flipping coins again")
  27.  
  28. #Startup routine
  29. def startup(time):
  30.     #Coundown
  31.     print("Coins will start falling in...\n5")
  32.     time.sleep(1)
  33.     print("\n4")
  34.     time.sleep(1)
  35.     print("\n3")
  36.     time.sleep(1)
  37.     print("\n2")
  38.     time.sleep(1)
  39.     print("\n1")
  40.     time.sleep(1)
  41.     print("\n")
  42.     flipit(random, flip, time, comment, repeat)
  43.    
  44. startup(time)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement