Skip to content

Instantly share code, notes, and snippets.

View dilbernd's full-sized avatar

Bernd Haug dilbernd

View GitHub Profile
(def inputs [...])
(def day2_2_sought 42)
(defn computer [data ip]
(let [[op oa1 oa2 t] (subvec data ip)
o1 (data oa1)
o2 (data oa2)
ofn ({1 + 2 * 99 :hlt} op)]
(if (= :hlt ofn) (data 0) (recur (assoc data t (ofn o1 o2)) (+ 4 ip)))))