my solutions for advent of code 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
679 B

2 years ago
# building input
with open('in.txt','r') as f:
inp = f.read().splitlines(keepends=False)
blueprints = []
for line in inp:
tempA, tempB = line.split(' ore. Each clay robot costs ')
oreBot = int(tempA[-1])
clayBot, tempC = tempB.split(' ore. Each obsidian robot costs ')
clayBot = int(clayBot)
tempC, tempD = tempC.split(' clay. Each geode robot costs ')
obsidianBot = tuple(map(int, tempC.split(' ore and ')))
tempA, tempB = tempD.split(' ore and ')
tempB, _ = tempB.split(' obsidian')
geodeBot = (int(tempA), int(tempB))
blueprints.append((oreBot, clayBot, obsidianBot, geodeBot))
for blueprint in blueprints:
print(blueprint)