day2: one more update

master
Clyne 3 years ago
parent 5ebea9566f
commit 09e1c2712b

@ -16,10 +16,12 @@
n (Integer/parseInt (second ins)) n (Integer/parseInt (second ins))
] ]
(recur (recur
(case (first ins) (apply (partial update-in data)
"forward" (update-in data [:xpos] + n) (case (first ins)
"up" (update-in data [:depth] - n) "forward" [[:xpos] + n]
"down" (update-in data [:depth] + n) "up" [[:depth] - n]
"down" [[:depth] + n]
)
) )
) )
) )

Loading…
Cancel
Save