#!/usr/bin/env liberate coffee # Huh?

These are my solutions for 2016’s Advent of Code days 1 through 5.

Preliminaries

This program accepts the day on the command line. For example to solve day one, run:

./aoc.coffee.md day1 < input.txt

output = console .log debug = (msg) -> ARGV = day: process.argv[ 2 ] main = -> day = if ARGV.day then Days[ARGV.day] else "wat" throw " #{ARGV.day} not implemented" unless day day and do -> input = "" process.stdin. on 'readable' , -> chunk = process.stdin.read() chunk && input = input + chunk process.stdin. on 'end' , -> day(input) Util = invalid_triangle: (a,b,c) -> (+a)+(+b) <= (+c) or (+a)+(+c) <= (+b) or (+b)+(+c) <= (+a) Days =