This commit is contained in:
Juan José Gutiérrez de Quevedo Pérez 2020-12-22 23:49:11 +01:00
parent 815d8ae5c2
commit 9c24543479
2 changed files with 6 additions and 8 deletions

10
22/1.py
View file

@ -8,11 +8,11 @@ for c in content:
if not c:
part += 1
continue
if part == 0: # reading player 2 stack
if part == 0: # reading player 1 stack
if c.startswith("Player"):
continue
player1.append(int(c))
if part == 1: # reading player 1 stack
if part == 1: # reading player 2 stack
if c.startswith("Player"):
continue
player2.append(int(c))
@ -21,13 +21,11 @@ while len(player1) and len(player2):
if player1[0] > player2[0]:
player1.append(player1[0])
player1.append(player2[0])
del(player1[0])
del(player2[0])
else:
player2.append(player2[0])
player2.append(player1[0])
del(player1[0])
del(player2[0])
del(player1[0])
del(player2[0])
if len(player1):
winner = player1

View file

@ -8,11 +8,11 @@ for c in content:
if not c:
part += 1
continue
if part == 0: # reading player 2 stack
if part == 0: # reading player 1 stack
if c.startswith("Player"):
continue
player1.append(int(c))
if part == 1: # reading player 1 stack
if part == 1: # reading player 2 stack
if c.startswith("Player"):
continue
player2.append(int(c))