Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1.  
  2. n1 = random.randrange(1,7)
  3. n2 = random.randrange(1,7)
  4. initialresult = n1 + n2 #want to display the result
  5. if initialresult in [7,11]
  6. print("Throw total: {} ... you lost!".format(initialresult))
  7. if initialresult in [2,3,12]
  8. print("Throw total {} .. you won!".format(initialresult))
  9. #if roll for point is pressed
  10. while not done:
  11. n1 = random.randrange(1,7)
  12. n2 = random.randrange(1,7)
  13. result = n1 + n2
  14. if result in [7,11]:
  15. print("Throw total: {} ... you lost!".format(result))
  16. break
  17. if result in [2,3,12]:
  18. print("Throw total {} .. you won!".format(result))
  19. break
  20. if result == initialresult:
  21. print("Throw total: {}.. you lost!".format(result))
  22. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement