Guest User

Untitled

a guest
Dec 15th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. from dice import *
  2.  
  3. def play_turn_human():
  4. a = roll()
  5. print '-->',a
  6.  
  7. def play_turn_computer():
  8. b = roll()
  9. print '-->',b
  10.  
  11. def play():
  12. print 'YOUR TURN'
  13. play_turn_human()
  14. print 'MY TURN'
  15. play_turn_computer()
  16. print '-' * 45
  17.  
  18. def ask_user():
  19. print "Want a new try? (y=yes, n=no):"
  20. a = "y"
  21. b = "n"
  22. x = raw_input()
  23. if x == a:
  24. play()
  25. elif x == b:
  26. print "Quitting game."
  27. else:
  28. print "Your input was not y or n, try again:"
  29.  
  30. def main():
  31. init_seed()
  32. play()
  33. ask_user()
  34. print 'Quitting game.'
  35.  
  36. if __name__ == '__main__':
  37. main()
Add Comment
Please, Sign In to add comment