From a36c6fe4b3fe93c936d40dcca41f5e8cbf4987d7 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 5 Dec 2022 09:04:45 +0100 Subject: golf? a bit --- 2022/05/solve.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '2022/05/solve.py') diff --git a/2022/05/solve.py b/2022/05/solve.py index 8997d4e..fb996bc 100644 --- a/2022/05/solve.py +++ b/2022/05/solve.py @@ -18,10 +18,10 @@ def solve(mover_version): stacks[i // 4].insert(0, cols[i]) i += 4 else: - proc = line.replace("move ", "").replace("from ", "").replace("to ", "").replace("target ", "").split(" ") - what = int(proc[0]) - source = int(proc[1]) - 1 - target = int(proc[2]) - 1 + proc = line.split(" ") + what = int(proc[1]) + source = int(proc[3]) - 1 + target = int(proc[5]) - 1 crates = stacks[source][-what:] if mover_version == 9000: -- cgit v1.2.3