Advertisement
Peaser

Points system (super alpha)

Oct 18th, 2014
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. multipliers = {
  2.          "easy" : 1,
  3.        "medium" : 1.5,
  4.          "hard" : 2,
  5.       "extreme" : 3,
  6.     "impossible": 5
  7. }
  8.  
  9. impossible, medium, hard, easy, extreme = multipliers.keys()
  10.  
  11. inp = [eval(i) for i in raw_input("points distance bonus faults difficulty > ").split(" ")]
  12. # ^^^ currently raw_input because point acquisition not implemented
  13.  
  14. points, distance, bonus, faults, difficulty = inp
  15.  
  16. # Miscellaneous operations
  17. distance = 80 if distance > 80 else distance #set distance to max if it is higher than max
  18. bonus = 10 if bonus > 10 else bonus #set bonus to max if it is higher than max
  19. #/Miscellaneous operations
  20.  
  21.  
  22. total = ((((points or distance) * (distance/5)) + bonus)/(faults or 1))*multipliers[difficulty]
  23. # ^^^ Calculating total score in order of priority.
  24.  
  25. for i in ["Points", "Distance", "Bonus", "Faults", "Difficulty"]:
  26.     print "{i}: {val}".format(i=i, val=eval(i.lower()))
  27.  
  28. print "#"*20
  29. print "Total = {}".format(total)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement