mirror of
https://github.com/Ajetski/advent-of-code.git
synced 2025-09-30 05:23:17 -09:00
golf
This commit is contained in:
parent
84fbe1a642
commit
774e85068b
@ -9,8 +9,7 @@
|
||||
(get (get input row) col))
|
||||
|
||||
;; part 1
|
||||
(->> input
|
||||
c/get-coords
|
||||
(->> (c/get-coords input)
|
||||
(map (fn [[row col]]
|
||||
(->> (for [offset (range 4)]
|
||||
[[row (+ col offset)]
|
||||
@ -28,8 +27,7 @@
|
||||
(reduce +))
|
||||
|
||||
;; part 2
|
||||
(->> input
|
||||
c/get-coords
|
||||
(->> (c/get-coords input)
|
||||
(filter #(= (get-char %) \A))
|
||||
(filter (fn [[row col]]
|
||||
(->> [[[(dec row) (dec col)] [(inc row) (inc col)]]
|
||||
|
Loading…
x
Reference in New Issue
Block a user