-
Notifications
You must be signed in to change notification settings - Fork 0
/
Spore_Sity.py
56 lines (53 loc) · 3.25 KB
/
Spore_Sity.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
def get_work(min_bp):
max_pr = 0
max_bp = 0
out = ''
A = 1
for B in range(1, 4):
for C in range(1, 4):
for D in range(1, 4):
for E in range(1, 4):
for F in range(1, 4):
for G in range(1, 4):
for H in range(1, 4):
for I in range(1, 4):
for J in range(1, 4):
for K in range(1, 4):
# for L in range(1,4):
pr = 0
bp = 0
# all_sity = [A, B, C, D, E, F, G, H, I, J, K, L]
all_sity = [A, B, C, D, E, F, G, H, I, J, K]
for i in all_sity:
if (i == 2):
bp += 1
elif (i == 3):
bp -= 1
# template = [[A, B], [A, E], [A, H], [A, K], [B, C], [B, D], [B, E], [B, K],
# [C, D], [E, F], [F, G], [G, H], [H, I], [I, J], [K, L]]
template = [[A, B], [A, E], [A, G], [A, K], [A, H], [B, C], [B, D], [C, D],
[E, F], [G, H], [G, I], [G, J], [H, I]]
for i in template:
i.sort()
if (i[0] == 1) and (i[1] == 2):
bp += 1
elif (i[0] == 1) and (i[1] == 3):
pr += 0.3
elif (i[0] == 2) and (i[1] == 3):
bp -= 1
if (max_pr <= pr) and (bp >= min_bp):
max_pr = pr
max_bp = bp
# out = 'A=' + str(A) + '; B=' + str(B) + '; C=' + str(C) + '; D=' + str(
# D) + '; E=' + str(E) + '; F=' + str(F) + '; G=' + str(
# G) + '; H=' + str(H) + '; I=' + str(I) + '; J=' + str(
# J) + '; K=' + str(K) + '; L=' + str(L)
out = 'A=' + str(A) + '; B=' + str(B) + '; C=' + str(C) + '; D=' + str(
D) + '; E=' + str(E) + '; F=' + str(F) + '; G=' + str(
G) + '; H=' + str(H) + '; I=' + str(I) + '; J=' + str(
J) + '; K=' + str(K)
print('Pr.=', max_pr, 'Bp.=', max_bp)
print(out)
print()
for i in range(1, 6):
get_work(i)