Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <iostream>
- int main(void)
- {
- int levels = 40;
- int xp_for_first_level = 1000;
- int xp_for_last_level = 1000000;
- double B = log((double)xp_for_last_level / xp_for_first_level) / (levels - 1);
- double A = (double)xp_for_first_level / (exp(B) - 1.0);
- for (int i = 1; i <= levels; i++)
- {
- int old_xp = round(A * exp(B * (i - 1)));
- int new_xp = round(A * exp(B * i));
- std::cout << i << " " << (new_xp - old_xp) << std::endl;
- }
- }
- And the following output:
- 1 1000 9 4125 17 17012 25 70170 33 289427
- 2 1193 10 4924 18 20309 26 83768 34 345511
- 3 1425 11 5878 19 24245 27 100000 35 412462
- 4 1702 12 7017 20 28943 28 119378 36 492389
- 5 2031 13 8377 21 34551 29 142510 37 587801
- 6 2424 14 10000 22 41246 30 170125 38 701704
- 7 2894 15 11938 23 49239 31 203092 39 837678
- 8 3455 16 14251 24 58780 32 242446 40 1000000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement