Skip to content

cideM/aoc2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎄 Advent of Code 2020 🎅

Intro

This repository contains my solutions for Advent of Code 2020 in whatever languages I feel like. Every solution is a single file which you can just run like this ./d2/d2.hs or ./d2/d2.lua. The code always starts with a shebang line that runs the code in a Nix shell. That means you don't need to install anything, it's all temporary and self-contained.

The Clojure is to be run by opening the file in your favorite editor and interactively evaluating things. No shebang here.

There are also a few other tools installed for you in the base Nix shell, such as ormolu for formatting Haskell and hlint for linting, and so on.

Preparation

Start cat and wait for input

$ mkdir d2
$ cat > d2/input.txt

Reload and run

$ echo "d2/d2.hs" | entr -sc "cat d2/input.txt | ./d2/d2.hs"

Progress (25/25)

Haskell Lua Clojure
1 🔔 🔔 💤
2 🔔 🔔 💤
3 🔔 🔔 💤
4 🔔 🔔 💤
5 🔔 💤 💤
6 🔔 💤 💤
7 🔔 💤 💤
8 🔔 💤 💤
9 💤 🔔 💤
10 🔔 💤 💤
11 🔔 💤 💤
12 🔔 💤 💤
13 💤 💤 🔔
14 💤 💤 🔔
15 💤 💤 🔔
16 💤 💤 🔔
17 💤 💤 🔔
18 🔔 💤 💤
19 🔔 💤 💤
20 🔔 💤 💤
21 🔔 💤 💤
22 🔔 💤 💤
23 🔔 💤 💤
24 🔔 💤 💤
25 🔔 💤 💤

Misc

Post code on reddit (use pbcopy on MacOS)

$ cat code | sed 's/^/    /' | xsel -b`