32 lines
521 B
Python
32 lines
521 B
Python
input = open("./test.txt", "r")
|
|
|
|
stacks = []
|
|
moves = []
|
|
|
|
count = 0
|
|
|
|
def parseCrates(iLine):
|
|
crates = []
|
|
crates.append(iLine[1])
|
|
crates.append(iLine[5])
|
|
crates.append(iLine[9])
|
|
stacks.append(crates)
|
|
print(crates)
|
|
|
|
def parseMoves(input):
|
|
command = []
|
|
for item in input:
|
|
if (item.isdecimal()):
|
|
command.append(item)
|
|
print(command)
|
|
|
|
for line in input:
|
|
if (count < 4):
|
|
parseCrates(line)
|
|
if (count == 3):
|
|
count += 1
|
|
count += 1
|
|
if (count > 4):
|
|
parseMoves(line)
|
|
|
|
print(stacks) |