-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
70 lines (60 loc) · 1.8 KB
/
main.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
import grammar as gr
import os
os.system("")
ruleset = gr.Ruleset(
5, 5,
{0: {
"J": (1, 0.005), "Q": (1, 0.005), "K": (1, 0.005), "10": (1, 0.005),
"Shoes": (0.3, 0.02), "Shirt": (0.3, 0.02), "Service": (0.3, 0.02), "WILD": (0.02, 0.022)
}},
False, 5, gr.MatchType.LTR,
{0: {
"J": ("J", "WILD"), "Q": ("Q", "WILD"), "K": ("K", "WILD"), "10": ("10", "WILD"),
"Shoes": ("Shoes", "WILD"), "Shirt": ("Shirt", "WILD"), "Service": ("Service", "WILD"),
"WILD": ("J", "Q", "K", "10", "Shoes", "Shirt", "Service", "WILD")
}},
[], [0], 0
)
board = gr.Board(ruleset)
# Calculate RTP
"""
avg = 0
times = 200000
for i in range(times):
board.spin()
avg += (board.value_matches(board.check_matches()) - avg) / (i + 1)
print("Average RTP is {}".format(avg))
"""
# "Game"
cash = 100000
print("\u001b[2;1H", end="")
board.render()
print("\n\n\n\n CASH: {:8}".format(cash))
while True:
input("")
board.spin()
print("\u001b[2;1H", end="")
board.render()
matches = board.check_matches()
payout = int(board.value_matches(matches) * 1000)
if payout > 0:
print("\n {:6} ways!".format(len(matches)))
# print("\n".join(str(t) for t in matches))
print(" PAYOUT: {:8}".format(payout))
else:
print("\n \n ")
cash -= 1000
cash += payout
print("\n CASH: {:8}".format(cash))
# Manual spinning
"""
board.render()
while True:
input("")
board.spin()
board.render()
matches = board.check_matches()
print("\n" + str(len(matches)), "matches!")
# print("\n".join(str(t) for t in matches))
print("Value:", board.value_matches(matches))
"""