aoc2016 icon indicating copy to clipboard operation
aoc2016 copied to clipboard

My solutions for Advent of Code 2016, each in a different language

Polyglot Advent of Code 2016

Advent of Code 2016 is a programming contest, in which a new puzzle comes online every day from 1 until 25 December. These are my solutions to the puzzles. As an additional challenge, I solved each day's puzzle in a different programming language.

Languages

I used only "mainstream" programming languages, not esoteric or toy languages, because this will be hard enough as is. However, I did include some older languages in the list out of historic interest. Plus, a free (as in beer) implementation for Linux has to exist.

Languages I could still have used, roughly in order of decreasing preference (based both on what I know, and what might be suitable for such puzzles):

  • Java
  • PHP
  • BASIC
  • Clojure
  • Elixir
  • CoffeeScript
  • Dart
  • Nim
  • REBOL
  • Forth
  • F#
  • Kotlin
  • Octave
  • Erlang
  • Icon
  • Eiffel
  • Prolog
  • CUDA
  • GLSL
  • TCL
  • Smalltalk
  • Julia
  • AWK
  • J
  • APL
  • Ada
  • Algol
  • 6502 assembly

Used:

  • C (day 23)
  • C++ (day 24)
  • C# (day 17)
  • COBOL (day 1)
  • D (day 11)
  • Fortran 90 (day 8)
  • Go (day 25)
  • Groovy (day 13)
  • Haskell (day 16)
  • Haxe (day 22)
  • JavaScript (day 20)
  • Lua (day 18)
  • OCaml (day 12)
  • OpenCL (day 14)
  • Pascal (day 10)
  • Pen and paper (and a calculator) (day 15)
  • Perl (day 21)
  • Python (day 5)
  • R (day 6)
  • Ruby (day 19)
  • Rust (day 9)
  • Scala (day 3)
  • Scheme (day 2)
  • Sh (bash and common shell utilities) (day 4)
  • x86 assembly (day 7)

Rules

  • Input should be read from stdin if at all possible. Otherwise, read from a file named input.
  • The input file must be read and parsed exactly as provided. No modifications are allowed.