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