Skip to content

RoystonS/aoc-go

Repository files navigation

Advent of Code in Go

This is set up as a Visual Studio Code devcontainer, to make it easy to set up the Go environment.

Use

  1. Clone repo
  2. Open in Visual Studio code
  3. Allow it to establish a 'Dev Container' using the Dev Container extension (which you'll be prompted to install if not already present)
  4. It'll take a few minutes to create the container.
  5. Bring up a terminal in the container (Terminal->New Container)
  6. Run go run test.go
  7. You should see a message confirming that your Go container is working

Working on Advent of Code challenges

Setup

  1. Log into Advent of Code in a browser and extract the session cookie.
  2. Place it in the .env file, based on .env.sample.

To solve a new day

  • Inside the dev container, run ./setup-day.sh <year> <day>
    • This will fetch the assignment details and input, into <year>/<day> and set up a basic Go skeleton for the day
  • To run the code for a part for a day:
    • cd <year>/<day>
    • make <part> (e.g. make 1)

To run all days for a year, checking correctness and performance

  • ./test-all.sh <year>