-
Notifications
You must be signed in to change notification settings - Fork 0
/
fsh.py
82 lines (67 loc) · 2.26 KB
/
fsh.py
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import sys
class Fish:
def __init__(self, name, ratio):
self.Name = name
self.Ratio = ratio
self.MaxPrice = 0.0
class MichaelBloom:
def __init__(self, quality, ratio):
self.Name = quality
self.Ratio = ratio
self.MaxPrice = 0.0
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def CalculateMaxPrice(list, market_price):
for i in list:
i.MaxPrice = (float(market_price) * 0.95) * i.Ratio
i.MaxPrice += i.MaxPrice * 0.08
list.sort(key=lambda x: x.MaxPrice, reverse=False)
return list
# List Init
FishList = []
FishList.append(Fish("Specular Rainbowfish", 0.82))
FishList.append(Fish("Dilly-Dally Dace ", 0.82))
FishList.append(Fish("Bloody Perch ", 0.82))
FishList.append(Fish("Goldengill Trout ", 0.82))
FishList.append(Fish("Bismuth Bitterling ", 0.82))
FishList.append(Fish("Dornish Pike ", 0.82))
FishList.append(Fish("Crystalline Sturgeon", 0.82))
FishList.append(Fish("Roaring Anglerseeker", 1.00))
FishList.append(Fish("Spiked Sea Raven ", 1.78))
FishList.append(Fish("Quiet River Bass ", 1.00))
MichaelBloomList = []
MichaelBloomList.append(MichaelBloom(" * ", 0.95))
MichaelBloomList.append(MichaelBloom(" * * ", 1.25))
MichaelBloomList.append(MichaelBloom("* * *", 1.56))
# End List Init
FilletPrice = 0.0
ChoppedPrice = 0.0
if len(sys.argv) > 1:
FilletPrice = sys.argv[1]
else:
print("Error: rerun as fsh.py <Fish market price>")
sys.exit()
if len(sys.argv) > 2:
ChoppedPrice = sys.argv[2]
FishList = CalculateMaxPrice(FishList, FilletPrice)
MichaelBloomList = CalculateMaxPrice(MichaelBloomList, ChoppedPrice)
print()
print(f"{bcolors.WARNING}Fish Prices")
print("Raw Break Even At")
print(f"------------------------------------{bcolors.ENDC}")
for f in FishList:
print(" %s | %2.2f" % (f.Name, f.MaxPrice))
print()
print(f"{bcolors.WARNING}Michaelbloom Prices")
print("Quality Break Even At")
print(f"------------------------------------{bcolors.ENDC}")
for q in MichaelBloomList:
print(" %s | %2.2f" % (q.Name, q.MaxPrice))