Advent of code solutions from the me
Go to file
xenia e706f6444c day 18: minor cleanups 2020-12-18 00:43:38 -05:00
inputs initial commit 2020-12-01 16:37:03 -05:00
scripts update scripts 2020-12-14 19:55:55 -05:00
.gitignore useless stuff: add watch script 2020-12-12 01:57:39 -05:00
1.rkt day 1: shonks 2020-12-01 16:37:09 -05:00
2.rkt clean up day 2 solution with fancy stuff 2020-12-02 05:08:00 -05:00
3.rkt day 3: triple shork 2020-12-03 00:22:35 -05:00
4.rkt day 4: cleaned up version 2020-12-04 01:24:56 -05:00
5.rkt day 5: cleaned up version 2020-12-05 00:27:13 -05:00
6.rkt day 6: initial implementation 2020-12-06 00:07:33 -05:00
7.rkt day 7: cleaned up version using graph-lib 2020-12-07 02:35:26 -05:00
8.rkt day 8 impl 3: the program analysis solution 2020-12-08 03:18:07 -05:00
9.rkt day 9: fix bug that didn't change the answer 2020-12-09 01:19:10 -05:00
10.rkt day 10: shark 2020-12-10 01:24:50 -05:00
11.rkt day 11 2020-12-11 00:33:35 -05:00
12.rkt day 12: use #:result 2020-12-12 01:02:03 -05:00
13.rkt day 13: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 2020-12-13 00:46:55 -05:00
14.rkt day 14: solution without bitvectors 2020-12-14 01:34:30 -05:00
15.rkt day 15: use unsafe for more fast 2020-12-15 02:03:03 -05:00
16.rkt day 16: implement bipartite-matching solution 2020-12-16 01:18:43 -05:00
17.rkt day 17: extremely minor fix 2020-12-17 01:10:57 -05:00
18.rkt day 18: minor cleanups 2020-12-18 00:43:38 -05:00
COPYING initial commit 2020-12-01 16:37:03 -05:00
LICENSE initial commit 2020-12-01 16:37:03 -05:00
README.md add new library to standard reprovides 2020-12-07 02:35:11 -05:00

README.md

haskal's advent of code 2020 solutions

sharks

third party packages used so far

  • curly-fn and threading: all
  • graph: day 7 +

a guide to this repo

(pregexp #px"([0-9]+).rkt" (list _ day))

these are the solution files for day. some of them have two versions, click on the history button to view both. the first version is the original solution i wrote, and the second version contains some cleanup to make the code nicer. day 1 doesn't have an original version because i didn't commit it. other days may not have a cleaned up version if i didn't think any cleanup needed to be done

the code aims to be as efficient as needed, but prioritizes readability and conciseness. i want to create a good demo of using racket and its available features to solve programming problems quickly and cleanly

(or "LICENSE" "COPYING")

the license is GPL 3.0 or later, including solutions and scripts

"inputs/"

an empty folder, this is where scripts put input files

"scripts/aoc-lib.rkt"

this is a collection of functions for interacting with the AoC server to fetch challenges, submit answers, get leaderboards, and track progress (in a local file called .status.rktd)

scripts expect some environment variables to be present

  • AOC_SESSION: a session token for your account. log in, then copy the session cookie
  • AOC_YEAR: the challenge year
  • AOC_LEADERBOARD: your leaderboard ID, used for plot

"scripts/aoc.rkt"

this is included by the template and goes into every solution by default. it exports a function to report answers to the challenge server, and useful libraries for challenge code to use

"scripts/countdown"

counts down to the next challenge then initializes it from a template, downloads the input file, and displays the challenge text in the terminal

"scripts/get-challenge"

a CLI application for viewing challenges. takes 1 argument for day. displays somewhat styled challenge text to the terminal (requires 256color)

"scripts/get-input"

downloads the input for day n to inputs/n

"scripts/make-day"

creates a new solution file from template and downloads the input for a given day

"scripts/plot"

plots the scores of everyone on a private leaderboard over time, defaults to displaying the plot in a window

(or "scripts/plot.scrbl" "scripts/plot.css")

define a webpage (rendered with scribble) to display the plot generated by scripts/plot. you can render it with scribble --dest <dest> --style plot.css plot.scrbl

the plot for my leaderboard is available at https://joan.awoo.systems/aoc2020/

"scripts/submit-answer"

takes a day, level, and answer and submits it. returns what the server responded

"scripts/template.rktrkt"

a template (in scribble) defining the solution code for a day. should be templated with the variable day specifying the day