--- /dev/null
+(ns aoc.core
+ [:require [clojure.string :as str]])
+
+(def get-list-from-file
+ #(str/split #"," (slurp %)))
+
+(def parse-int
+ #(Integer/parseInt %))
+
+(def opcodes {1 +, 2 *})
+(defn perform-operation [[opcode fst snd thd] program]
+ (let [opcode-fn (opcodes opcode)
+ fst-val (program fst)
+ snd-val (program snd)]
+ (assoc program thd (opcode-fn fst-val snd-val))))
+
+(defn intcode [program counter]
+ (loop [program program
+ counter counter]
+ (let [opcode (program counter)]
+ (if (= opcode 99)
+ program
+ (recur (perform-operation (map program (take 4 (iterate inc counter)))
+ program)
+ (+ counter 4))))))
+
+(defn -main []
+ (let [input (mapv parse-int (get-list-from-file "input"))
+ fixed-input (assoc input 1 12 2 1)]
+ (println (first (intcode fixed-input)))))
+
+(-main)