Solving Advent of Code problems in Clojure and Java to get hands-on fun experience with the language.
Each day I write down a "Today I Learned" (TIL) so I don't just solve the problem, but also keep track of what I've learned, tricks I found, or just problems I liked.
λ🎄.(λ🎅.🎄(🎅🎅))(λ🎅.🎄(🎅🎅))
- Learn Clojure (XinYMinutes) <-- Start here if you're totally new to Clojure
- Clojure Cheatsheet
- ClojureDocs - community examples
- Associative (Map) Destructuring
- regex.Pattern
Prerequisites:
- Install Java
- Install Clojure
- Install Leiningen
Highly Recommended:
- IntelliJ: the best Java IDE
- Note: IntelliJ has a free Community Edition
- Cursive: IntelliJ plugin that adds Clojure support
- Note: Cursive has a free license for non-commercial
$ lein repl
# repl starts. use -main as a sanity check
advent-clj.core=> (-main)
λ🎄.(λ🎅.🎄(🎅🎅))(λ🎅.🎄(🎅🎅))
$ lein run
$ lein uberjar
# The resulting standalone can be run by java, from anywhere, and executes core.clj
$ java -jar target/uberjar/advent-clj-0.1.0-SNAPSHOT-standalone.jar
$ lein javac
# Howdy is a basic hello world example
$ java -cp target/default/classes/ com.valbaca.advent.Howdy
If you get ClassNotFound
when running a method in Clojure in IntelliJ, configure the following:
- How to run it
- Run with Leiningen
- Profiles: dev
- Run with Leiningen
What I've completed in Clojure, within this repo
- Year 2015: 🎄 All in Clojure!
- Year 2016: 🎁 IN PROGRESS
- Years 2016 - 2020: ❄️ NOT STARTED in Clojure
What I've completed in any language
- Year 2015: 🎄 DONE! Did days 1-19 in Go valbaca/advent-go, 19-22 in Python valbaca/advent-py, and rest in Java.
- Again in Clojure to learn the language.
- Year 2016: 🎁 IN PROGRESS @ Day 19. Days 1-7 in Python, 8-18 in Java.
- Year 2017: ❄️ On ice.
- Year 2018: ❄️ On ice.
- Year 2019: ❄️ On ice.
- Year 2020: 🎄 DONE in Python in valbaca/advent-py
- Year 2021: 🎄 DONE in Python in valbaca/advent-py
- Year 2022: 🎄 DONE in Kotlin valbaca/advent-kt
Copyright © 2021 Valentin Baca
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.