From 09e1c2712b76bf35aa6beeb8709f22911dc494d3 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Fri, 3 Dec 2021 09:20:18 -0500 Subject: [PATCH] day2: one more update --- day2/part1.clj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/day2/part1.clj b/day2/part1.clj index 6b09212..d301b37 100644 --- a/day2/part1.clj +++ b/day2/part1.clj @@ -16,10 +16,12 @@ n (Integer/parseInt (second ins)) ] (recur - (case (first ins) - "forward" (update-in data [:xpos] + n) - "up" (update-in data [:depth] - n) - "down" (update-in data [:depth] + n) + (apply (partial update-in data) + (case (first ins) + "forward" [[:xpos] + n] + "up" [[:depth] - n] + "down" [[:depth] + n] + ) ) ) )