This commit is contained in:
starnakin 2023-12-07 13:21:49 +01:00
parent 5adb259376
commit dfa1a49c7b

View File

@ -22,6 +22,7 @@ for line in lines:
same.update({"value": int(bozo[1])}) same.update({"value": int(bozo[1])})
sames.append(same) sames.append(same)
#[print(same) for same in sames]
def get_highest(cards1, cards2, i): def get_highest(cards1, cards2, i):
if (cards1 == cards2): if (cards1 == cards2):
@ -60,8 +61,6 @@ for same in sames[1:]:
index = get_index(sort, opponent.get("key")) index = get_index(sort, opponent.get("key"))
place = index if place == None else min(place, index) place = index if place == None else min(place, index)
opponents = new opponents = new
if (place != None):
break
if (place == None): if (place == None):
place = len(sort) place = len(sort)
sort.insert(place, same) sort.insert(place, same)
@ -69,6 +68,6 @@ for same in sames[1:]:
for j, bozo in enumerate(sort): for j, bozo in enumerate(sort):
rank: int = (len(lines) - j) rank: int = (len(lines) - j)
_value += rank * bozo.get("value") _value += rank * bozo.get("value")
print(f'{rank}, {bozo.get("key")} {bozo.get("value")}') print(f'{rank} {bozo.get("key")} {bozo.get("value")}')
print(_value) print(_value)