aoc-2020

My Advent of Code 2020 solutions, written in Crystal.

Advent of Code 2020

My entry for the Advent of Code for 2020, written entirely in Crystal.

Installation

You only need Crystal installed to run these solutions.

Setup

This solution takes inspiration from the cargo-aoc Rust plugin that I used for the 2018 Advent of Code and automatically downloads and provides the input to the solution implementations using the AoC API.

To setup, make sure that you are logged in to the Advent of Code website, and then copy your session cookie by opening the Network Inspector of your web browser and looking at the "Cookies" tab of the inspector. Then write the session token to a file in this repo named .session however you like; something like this should work:

$ cd aoc-2020/ && xsel > .session

Once this is done, this application will automatically download input data to the .data folder (which it will create automatically) if it is missing.

Usage

Once you have setup by installing Crystal and saving your session token to the .session file, you can run any solution from the repo with

$ crystal run src/aoc-2020.cr [--day <DAY>] [--release]

By default, this application will use the current day of the month (e.g. if it is December 8th, day will default to 8). Crystal assumes debug mode for faster compilation, but if you need to run a solution faster because it is computationally expensive, you can add the --release flag to improve runtime speeds at the cost of compilation time.

Development

All of the days are already templated out, so you just have to pick the one you are working on and start writing!

Contributors

Repository

aoc-2020

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • almost 4 years ago
  • December 1, 2020
License

MIT License

Links
Synced at

Sun, 22 Dec 2024 09:18:36 GMT

Languages