december adventure 2026
I’m going to try to work on something small during december. see the original December Adventure.
since I’d be traveling a lot, progress might be sporadic.
my goals:
- rogue-like in Clojure
- go outside
- listen to dub techno
- work on sbt 2.x
december, 2026
| ☾ | ♂ | ☿ | ♃ | ♀︎ | ♄ | ☉ |
|---|---|---|---|---|---|---|
| - | 0001 | 0002 | 0003 | 0004 | 0005 | 0006 |
| 0007 | 0008 | 0009 | 0010 | 0011 | 0012 | 0013 |
| 0014 | 0015 | 0016 | 0017 | 0018 | 0019 | 0020 |
| 0021 | 0022 | 0023 | 0024 | 0025 | 0026 | 0027 |
| 0028 | 0029 | 0030 | 31 | - | - |
0001
the main project I’m thinking about working on is Clojure. I’ve been curious about it, but never worked on anything before. as the first project, I’ll try to make a rogue-like, by which I mean something that only require ANSI X3.64 control sequence / VT100.
here’s a loop that quits on q, otherwise it echos back the character:
; src/example.clj
(ns example
(:import [org.jline.terminal Attributes TerminalBuilder]))
(defn loop1 [terminal]
(let [reader (.reader terminal),
c (.read reader)]
(if (= c (int \q)) (println "")
(do (print (char c)) (flush) (recur terminal)))))
(defn -main [& _]
(with-open [terminal (-> (TerminalBuilder/builder)
(.system true)
(.build))]
(let [^Attributes saved (.enterRawMode terminal)]
(try
(loop1 terminal)
(finally (.setAttributes terminal saved))))))
I used Helix to code the above, which matches the parentheses.
$ clojure -M -m example
aaa
I typed aaaq.
this uses a little bit of JLine 4.x to get into raw mode to avoid echoing the characters by default. it’s Clojure afterall, so why not mix a bit of JVM right?
at first, it looked as if the program was stuck. first, I needed to convert \q to int to compare it with the acquired c. next, I needed to call (flush) after each non-q characters so the character prints on screen.