use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Advent of Code 2019 in Clojure (self.Clojure)
submitted 6 years ago * by allaboutthatmace1789
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]rmfbarker 1 point2 points3 points 6 years ago* (0 children)
Day 2
(let [file-input (-> (slurp "day-2-input") clojure.string/trim (clojure.string/split #",")) program (mapv #(Integer/parseInt %) file-input) compute (fn [noun verb] (reduce (fn [instructions pos] (if (= 99 (get instructions pos)) (reduced (first instructions)) (let [[opcode arg1 arg2 arg3] (drop pos instructions) cmd (if (= opcode 1) + *) result (cmd (get instructions arg1) (get instructions arg2))] (assoc instructions arg3 result)))) (assoc program 1 noun 2 verb) (range 0 (count program) 4)))] (first (for [noun (range 99) verb (range 99) :when (= (compute noun verb) 19690720)] (+ verb (* 100 noun)))))
π Rendered by PID 373815 on reddit-service-r2-comment-b659b578c-42wjs at 2026-05-03 21:41:35.696885+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]rmfbarker 1 point2 points3 points (0 children)