aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 9793a98bfea59a1263cfdbf263d12b2841784e17 (plain) (blame)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Advent of Code
==============

This is a repository containing my solutions to the [Advent of Code][1], a
series of programming challenges released daily from the 1st to 25th of December
every year.  All sorts of languages are used in this repo.  You’ll mostly find
Awk and Python, but also a lot of other languages like C and Shell Script, and
even more “obscure” ones like Flex (a C lexer/scanner generator if you didn’t
know) or BC (an arbitrary precision calculator).

The repo should be simply to navigate, just select the folder of the
corresponding year and then the folder of the corresponding day.  Each days
folder should have a file called “input” with the input data and either two
files called “puzzle-1.ext” and “puzzle-2.ext” or one file called “puzzles.ext”.
In the latter case, there should be a Makefile you can run to build the two
individual programs or scripts to run each part seperately.  It’s rare but you
might also see both, in this case just run the “puzzles.ext” file as it’s
required to get the “puzzle-1.ext” and “puzzle-2.ext” files to actually run
properly.

[1]: https://adventofcode.com


Running Code
------------

Some of the solutions in this repo make use of `libaoc`.  In order to run these
solutions you need to add the directory of the library to the `PYTHONPATH`
environment variable.  In other words, instead of doing this:

```console
$ ./puzzle-1.py
```

You must do this:

```console
$ PYTHONPATH=../../ ./puzzle-1.py
```