Fix natsume function
This commit is contained in:
parent
02e73e2c93
commit
ab0c692141
1 changed files with 44 additions and 33 deletions
13
tools.py
13
tools.py
|
@ -1707,9 +1707,13 @@ def natsume():
|
||||||
natsuwantgrouped.append(listone)
|
natsuwantgrouped.append(listone)
|
||||||
listone = []
|
listone = []
|
||||||
listone.append(card)
|
listone.append(card)
|
||||||
|
if index + 1 == len(natsuwant):
|
||||||
|
natsuwantgrouped.append(listone)
|
||||||
else:
|
else:
|
||||||
listone = []
|
listone = []
|
||||||
listone.append(card)
|
listone.append(card)
|
||||||
|
if len(natsuwant) == 1:
|
||||||
|
natsuwantgrouped.append(listone)
|
||||||
index += 1
|
index += 1
|
||||||
index = 0
|
index = 0
|
||||||
for card in natsugivech:
|
for card in natsugivech:
|
||||||
|
@ -1722,9 +1726,13 @@ def natsume():
|
||||||
natsugivechgrouped.append(listtwo)
|
natsugivechgrouped.append(listtwo)
|
||||||
listtwo = []
|
listtwo = []
|
||||||
listtwo.append(card["name"])
|
listtwo.append(card["name"])
|
||||||
|
if index + 1 == len(natsugivech):
|
||||||
|
natsugivechgrouped.append(listtwo)
|
||||||
else:
|
else:
|
||||||
listtwo = []
|
listtwo = []
|
||||||
listtwo.append(card["name"])
|
listtwo.append(card["name"])
|
||||||
|
if len(natsugivech) == 1:
|
||||||
|
natsugivechgrouped.append(listtwo)
|
||||||
index += 1
|
index += 1
|
||||||
index = 0
|
index = 0
|
||||||
for card in natsugivesp:
|
for card in natsugivesp:
|
||||||
|
@ -1737,16 +1745,19 @@ def natsume():
|
||||||
natsugivespgrouped.append(listthree)
|
natsugivespgrouped.append(listthree)
|
||||||
listthree = []
|
listthree = []
|
||||||
listthree.append(card["name"])
|
listthree.append(card["name"])
|
||||||
|
if index + 1 == len(natsugivesp):
|
||||||
|
natsugivespgrouped.append(listthree)
|
||||||
else:
|
else:
|
||||||
listthree = []
|
listthree = []
|
||||||
listthree.append(card["name"])
|
listthree.append(card["name"])
|
||||||
|
if len(natsugivesp) == 1:
|
||||||
|
natsugivespgrouped.append(listthree)
|
||||||
index += 1
|
index += 1
|
||||||
natsugivechgrouped = natsugivechgrouped[:5]
|
natsugivechgrouped = natsugivechgrouped[:5]
|
||||||
natsugivespgrouped = natsugivespgrouped[:5]
|
natsugivespgrouped = natsugivespgrouped[:5]
|
||||||
finalwant = []
|
finalwant = []
|
||||||
finalgive = []
|
finalgive = []
|
||||||
for group in natsuwantgrouped:
|
for group in natsuwantgrouped:
|
||||||
if len(finalwant) < 5:
|
|
||||||
if group[0]["colour"] == "special":
|
if group[0]["colour"] == "special":
|
||||||
if len(natsugivespgrouped) > 0:
|
if len(natsugivespgrouped) > 0:
|
||||||
if natsugivespgrouped[0][0][:-2] == group[0]["name"][:-2]:
|
if natsugivespgrouped[0][0][:-2] == group[0]["name"][:-2]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue