-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTokenDistribution.py
More file actions
39 lines (34 loc) · 1.21 KB
/
TokenDistribution.py
File metadata and controls
39 lines (34 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
class TokenDistribution:
def __init__(self):
self.m_ltd = []
total = 0
height = 0
for i in range(5):
reward = 1153 - 110 * i
total += 43200 * reward
height += 43200
self.m_ltd.append({"reward":reward,"total":total,"height":height})
for i in range(2):
reward = 603 - 53 * i
total += (43200 * 5) * reward
height += (43200 * 5)
self.m_ltd.append({"reward":reward,"total":total,"height":height})
for i in range(9):
reward = 100 - 10 * i
total += (43200 * 5 * 5) * reward
height += (43200 * 5 * 5)
self.m_ltd.append({"reward":reward,"total":total,"height":height})
def GetTotal(self,height):
max_height = 0
max_money = 0
for obj in self.m_ltd:
if height < obj["height"]:
return obj["total"] - (obj["height"] - height) * obj["reward"]
max_height = obj["height"]
max_money = obj["total"]
return max_money + (height - max_height) * 10
def PrintInfo(self):
for obj in self.m_ltd:
print(obj)