magnificentophat

Untitled

Sep 9th, 2026 (edited)
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. def roll(tens,ones,TN):
  2. if tens == 10:
  3. result = ones
  4. if ones == 10:
  5. result = 100
  6. if tens != 10 and ones == 10:
  7. result = tens*10
  8. if tens != 10 and ones != 10:
  9. result = tens*10+ones
  10. SL = int(TN/10)-int(result/10)
  11. return SL
  12.  
  13. def compare(TN):
  14. total = 0
  15. for t in range(1,11):
  16. for o in range(1,11):
  17. regularSL = roll(t,o,TN)
  18. flippedSL = roll(o,t,TN)
  19. total += max(regularSL,flippedSL)
  20. return total/100
  21.  
  22. def averageSL(TN):
  23. total = 0
  24. for t in range(1,11):
  25. for o in range(1,11):
  26. regularSL = roll(t,o,TN)
  27. total+= regularSL
  28. return total/100
  29.  
  30. for TN in range(1,101):
  31. print(compare(TN)-averageSL(TN))
Advertisement
Add Comment
Please, Sign In to add comment