|
|
@ -6,6 +6,9 @@ for s in range(2, len(lines),6): |
|
|
|
|
|
|
|
|
|
|
|
earliestWin = len(draw) |
|
|
|
earliestWin = len(draw) |
|
|
|
winBoard = 0 |
|
|
|
winBoard = 0 |
|
|
|
|
|
|
|
winsOn = [-1] * len(boards) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# i should really make an attempt to optimize this |
|
|
|
|
|
|
|
|
|
|
|
for b in range(0, len(boards)): |
|
|
|
for b in range(0, len(boards)): |
|
|
|
for i in range(0, 5): |
|
|
|
for i in range(0, 5): |
|
|
@ -13,27 +16,40 @@ for b in range(0, len(boards)): |
|
|
|
for j in range(0, 5): |
|
|
|
for j in range(0, 5): |
|
|
|
if boards[b][i][j] not in draw: |
|
|
|
if boards[b][i][j] not in draw: |
|
|
|
break |
|
|
|
break |
|
|
|
index = draw.index(boards[b][i][j]) |
|
|
|
drawIndex = draw.index(boards[b][i][j]) |
|
|
|
if index > latest: |
|
|
|
if drawIndex > latest: |
|
|
|
latest = index |
|
|
|
latest = drawIndex |
|
|
|
if latest < earliestWin and latest != 0: |
|
|
|
if latest < earliestWin and latest != 0: |
|
|
|
earliestWin = latest |
|
|
|
earliestWin = latest |
|
|
|
winBoard = int(b) |
|
|
|
winBoard = b |
|
|
|
|
|
|
|
if winsOn[b] == -1 or winsOn[b] > latest: |
|
|
|
|
|
|
|
winsOn[b] = latest |
|
|
|
latest = 0 |
|
|
|
latest = 0 |
|
|
|
for j in range(0, 5): |
|
|
|
for j in range(0, 5): |
|
|
|
if boards[b][j][i] not in draw: |
|
|
|
if boards[b][j][i] not in draw: |
|
|
|
break |
|
|
|
break |
|
|
|
index = draw.index(boards[b][j][i]) |
|
|
|
drawIndex = draw.index(boards[b][j][i]) |
|
|
|
if index > latest: |
|
|
|
if drawIndex > latest: |
|
|
|
latest = index |
|
|
|
latest = drawIndex |
|
|
|
if latest < earliestWin and latest != 0: |
|
|
|
if latest < earliestWin and latest != 0: |
|
|
|
earliestWin = latest |
|
|
|
earliestWin = latest |
|
|
|
winBoard = b |
|
|
|
winBoard = b |
|
|
|
|
|
|
|
if winsOn[b] > latest : |
|
|
|
|
|
|
|
winsOn[b] = latest |
|
|
|
|
|
|
|
|
|
|
|
summa = 0 |
|
|
|
summa = 0 |
|
|
|
|
|
|
|
summaLose = 0 |
|
|
|
|
|
|
|
winBoard = winsOn.index(min(winsOn)) |
|
|
|
|
|
|
|
loseBoard = winsOn.index(max(winsOn)) |
|
|
|
for row in boards[winBoard]: |
|
|
|
for row in boards[winBoard]: |
|
|
|
for n in row: |
|
|
|
for n in row: |
|
|
|
if n not in draw[:earliestWin+1]: |
|
|
|
if n not in draw[:winsOn[winBoard]+1]: |
|
|
|
summa += n |
|
|
|
summa += n |
|
|
|
|
|
|
|
|
|
|
|
print(draw[earliestWin]*summa) |
|
|
|
for row in boards[loseBoard]: |
|
|
|
|
|
|
|
for n in row: |
|
|
|
|
|
|
|
if n not in draw[:winsOn[loseBoard]+1]: |
|
|
|
|
|
|
|
summaLose += n |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(draw[winsOn[winBoard]]*summa) |
|
|
|
|
|
|
|
print(draw[winsOn[loseBoard]]*summaLose) |
|
|
|