My solutions to Advent of Code 2016 problems.
The goal is to use a different programming language for every problem:
-
Day 01: Python
$ python solution.py < input.txt
-
Day 02: C++
$ g++ -std=c++11 solution.cpp -o solution $ ./solution < input.txt
-
Day 03: Factor
In the listener:
IN: scratchpad "<path>/<to>/<parent>/<folder>" add-vocab-root IN: scratchpad USE: dec03-factor IN: scratchpad main
-
Day 04: Nim
$ nim c --opt:speed solution.nim && ./solution < input.txt
-
Day 05: TypeScript
$ npm install @types/node $ npm install crypto`` $ tsc --lib es6 solution.ts && node solution.js < input.txt
-
Day 06: Julia
$ julia solution.jl input.txt
-
Day 07: F#
$ fsi solution.fsx input.txt
-
Day 08: Lua
$ lua5.1 solution.lua input.txt
-
Day 09: Kotlin
$ kotlinc -script solution.kts input.txt
-
Day 10: Elm
$ elm-reactor
Then, open http://localhost:8000/solution.elm in a browser.
-
Day 11: Scala
$ scala solution.scala input1.txt $ scala -J"-Xmx2048m" solution.scala input2.txt
-
Day 12: Dart
$ dart solution.dart input.txt
-
Day 13: Java
$ cd src && javac solution.java && java solution ../input.txt
-
Day 14: Ruby
$ ruby solution.rb input.txt
-
Day 15: Haskell
$ ghc solution.hs && ./solution input1.txt && ./solution input2.txt
-
Day 16: Go
$ go run solution.go input1.txt $ go run solution.go input2.txt
-
Day 17: Clojure
$ lein run input.txt
-
Day 18: Elixir
$ elixir solution.exs input.txt 40 $ elixir solution.exs input.txt 400000
-
Day 19: Crystal
$ crystal solution.cr
-
Day 20: C#
$ mcs Solution.cs && mono Solution.exe
-
Day 21: Ada
$ gnatmake -gnata solution.adb && ./solution
-
Day 22: Rust
$ cargo run --release solution.rs input.txt
-
Day 23: D
$ rdmd -release solution input.txt 7 $ rdmd -release solution input.txt 12
-
Day 24: Ceylon
$ ceylon run --compile=force solution
-
Day 25: Swift
$ swift solution.swift input.txt