Skip to content

christianotieno/adventofcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code

Solutions for Advent of Code challenges implemented primarily in Go.

Prerequisites

  • Go 1.21.4 or higher
  • A valid Advent of Code session cookie

Installation

  1. Clone the repository

  2. Set up your Advent of Code session cookie as an environment variable:

export AOC_SESSION=your_session_cookie_here

You can find your session cookie by:

  1. Logging into Advent of Code
  2. Opening browser developer tools
  3. Going to Application/Storage > Cookies
  4. Copying the value of the 'session' cookie

Running Solutions

Run a specific day's solution:

go run cmd/main.go <day>

For example, to run day 1:

go run cmd/main.go 1

If no day is specified, it will default to day 1.

Project Structure

  • /cmd/main.go - Main entry point
  • /internal/dayN - Solutions for each day
  • /inputs - Input files (automatically downloaded and cached)

Testing

Run tests for a specific day:

go test ./internal/day1

Run all tests:

go test ./...

Features

  • Automatic input fetching and caching
  • Performance timing for solutions
  • Modular structure for easy addition of new days

About

I am taking on the Advent of Code Challenges here.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages