Advertisement
Guest User

fightsim

a guest
Mar 1st, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. def fight():
  2. #coin toss method for head_or_tails
  3. def coin():
  4. head_or_tails = null
  5. coin = randint(1,2)
  6. return coin
  7. if coin > 1:
  8. head_or_tails = 'H'
  9. else:
  10. head_or_tails = 'T'
  11. #Infinite loop for initiative results + main fight protocol
  12. while True:
  13. print("Flipping a coin for Initiative...")
  14. c1 = coin()
  15. print("Do you want to call heads or tails?")
  16. next = input("... :")
  17.  
  18. if ('head' in next and head_or_tails = 'H') or (next == 'h' and head_or_tails = 'H'):
  19. print("Heads! Good call! You go first.")
  20. choose()
  21. #The syntax works however, as you can see it is quite complicated...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement