deep_expo.py 843 B

1234567891011121314151617181920212223242526272829
  1. """Calculate resources koef"""
  2. def calc_koef(resource_limit, koef_value):
  3. """Calculate koef based on limit"""
  4. return pow(resource_limit * koef_value / 10, 0.8)
  5. def calc_resource(resource_limit, deep_expo, koef_value):
  6. """Calculate deep expo for resource"""
  7. initial_koef = calc_koef(resource_limit, koef_value)
  8. new_koef = calc_koef(resource_limit + deep_expo, koef_value)
  9. percentage = 100 / initial_koef * new_koef
  10. print("%8.2f%8.2f%8.2f" % (initial_koef, new_koef, percentage))
  11. if __name__ == "__main__":
  12. print("old new percentage")
  13. # gold
  14. calc_resource(379, 258, 0.4)
  15. # oil
  16. calc_resource(223, 148, 0.65)
  17. # ore
  18. calc_resource(247, 109, 0.65)
  19. # uranium
  20. calc_resource(2, 23, 0.75)
  21. # diamonds
  22. calc_resource(2, 25, 0.75)
  23. print("lux")
  24. calc_resource(267, 89, 0.65)