|
|
|
@ -6,28 +6,23 @@ for s in range(2, len(lines),6): |
|
|
|
|
|
|
|
|
|
winsOn = [-1] * len(boards) |
|
|
|
|
|
|
|
|
|
# i should really make an attempt to optimize this |
|
|
|
|
|
|
|
|
|
for b in range(0, len(boards)): |
|
|
|
|
for i in range(0, 5): |
|
|
|
|
latest = 0 |
|
|
|
|
latestH = 0 |
|
|
|
|
latestV = 0 |
|
|
|
|
for j in range(0, 5): |
|
|
|
|
if boards[b][i][j] not in draw: |
|
|
|
|
if boards[b][i][j] not in draw or boards[b][j][i] not in draw: |
|
|
|
|
break |
|
|
|
|
drawIndex = draw.index(boards[b][i][j]) |
|
|
|
|
if drawIndex > latest: |
|
|
|
|
latest = drawIndex |
|
|
|
|
if winsOn[b] == -1 or winsOn[b] > latest: |
|
|
|
|
winsOn[b] = latest |
|
|
|
|
latest = 0 |
|
|
|
|
for j in range(0, 5): |
|
|
|
|
if boards[b][j][i] not in draw: |
|
|
|
|
break |
|
|
|
|
if drawIndex > latestH: |
|
|
|
|
latestH = drawIndex |
|
|
|
|
drawIndex = draw.index(boards[b][j][i]) |
|
|
|
|
if drawIndex > latest: |
|
|
|
|
latest = drawIndex |
|
|
|
|
if winsOn[b] > latest : |
|
|
|
|
winsOn[b] = latest |
|
|
|
|
if drawIndex > latestV: |
|
|
|
|
latestV = drawIndex |
|
|
|
|
if winsOn[b] == -1 or winsOn[b] > latestH: |
|
|
|
|
winsOn[b] = latestH |
|
|
|
|
if winsOn[b] == -1 or winsOn[b] > latestV: |
|
|
|
|
winsOn[b] = latestV |
|
|
|
|
|
|
|
|
|
summa = 0 |
|
|
|
|
summaLose = 0 |
|
|
|
|