-
Notifications
You must be signed in to change notification settings - Fork 0
/
arknights.py
72 lines (56 loc) · 1.63 KB
/
arknights.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
import random
#TODO:
# web app w/ screenshot uploading capability
# constraints
# reroll function (selective)
# MTG mulligan (reroll a random 11 op team)
# stretch: image process operator type????
# sort operator list by level.
# option in format [A, B, C]
# A: number of ops. Check your friend display to see how many you have.
# B: weighting. Rolls n random indices within [1, numOps] and selects the lowest number.
# Also, weighting < 1 is dumb. If you set weighting < 1 I hate you and you will never pull another 6*.
# C: pageSize. Number of operators on a page when in the multi-select screen for squad comp.
CIRNOBYL = [180, 1, 16]
GANYULESS = [74, 1, 16]
SYO = [167, 1, 16]
ZEPHYR = [185, 1, 12]
SETTINGS = CIRNOBYL
def randomize():
global SETTINGS
numOps = SETTINGS[0]
weighting = SETTINGS[1]
pageSize = SETTINGS[2]
allOps = list(range(1,numOps))
ops = set([])
weighting = max(1, weighting)
while len(ops) < 12:
result = allOps[-1] # set to max
for j in range(weighting):
result = min(result,random.randint(0,len(allOps)-1))
ops.add(allOps[result])
allOps.remove(allOps[result])
ops = list(ops)
ops.sort()
return ops
def paginate(ops):
global SETTINGS
pageSize = SETTINGS[2]
ops.sort()
page = 1
opsOnPage = []
for op in ops:
newPage = (op-1)//(pageSize)+1
if newPage != page:
if opsOnPage:
print("Page", page, "no.", opsOnPage)
opsOnPage = []
page = newPage
opsOnPage.append((op-1)%(pageSize)+1)
if opsOnPage:
print("Page", page, "no.", opsOnPage)
def main():
ops = randomize()
print(ops, "\n")
paginate(ops)
main()