Solutions to Advent of Code programming challenges for various years.
The simplest way to use the programs is to visit the web app hosted here which provides an interface for running the solutions directly from a web browser using WebAssembly. The source code for the web app is available in the frontend directory.
Rust solutions have been compiled directly into WASM, so will be lightweight and fast. Go solutions are built using the TinyGo runtime, which is lightweight but has fewer optimizations than the official Go runtime. Python is an interpreted language, so cannot be directly compiled to WASM. Pyodide is a Python interpreter which targets WASM, and is used here to run Python solutions.
The challenges depend on a specific puzzle input provided alongside each task.
This repository expects these files to be available in the location /year/day_n/input.txt however the creator has asked that these files not be committed. As such you will need to provide your own puzzle inputs. For most solutions I have provided tests to solve the publicly available example input. You may run the tests for any challenge to see the code in action without providing your own puzzle input.
- To run the solution: navigate to the directory
/year/day_n/task_m/and run the commandcargo run --release. - To run the tests: navigate to the directory
/year/day_n/task_m/and run the commandcargo test.
- To run the solution: navigate to the directory
/year/day_n/task_m/and run the commandgo run .. - To run the tests: navigate to the directory
/year/day_n/task_m/and run the commandgo test.
- To run the solution: navigate to the directory
/year/day_n/task_m/and run the commandpython main.py. - To run the tests: navigate to the directory
/year/day_n/task_m/and run the commandpython -m unittest.
A TUI app for quickly bootstrapping a new solution is provided, and can be started by running make new from the root directory.
This repository contains all of the necessary scripts to deploy the web app to AWS.
To do so, provide a terraform/terraform.tfvars file containing the following:
region = "us-east-1"
app_name = "aoc-solver"
base_domain = "my-domain.com"
full_domain = "aoc.my-domain.com"
cert_arn = "arn:aws:acm:us-east-1:012345678912:certificate/b2124057-6e1e-4221-a127-66ff3a83a1e5"
and run the command make from the root directory.