Skip to content

OrangeRed/advent-of-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

67 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ„ Advent of Code πŸŽ„

This is a repository of my solutions for Advent of Code.


Guide

Auth Cookie

Make sure to set the AOC_COOKIE env with your session secret. To get your session secret press F12 while you are logged in on adventofcode.com to open the developer tools of your browser. Then open the Application Tab on Chromium Browsers or Storage on Firefox. There you can have a look at your cookies and copy the session id. It won't be possible to use the puzzle input get script without this session id.

Get Script

This script will get the puzzle input for the specified year and day and print it to stdout. Consider piping the result into a file so it can be reused. If not specified the script will get the puzzle input for the current date.

# Download puzzle input for current date and save it to 'in.txt'
$ ./get.sh > in.txt

# Download puzzle input for 2023 day 1 and save it to 'in.txt'
$ ./get.sh 2023 1 > in.txt

Running

# Run go script using stdin
$ go run ./go/2023/day01a.go < in.txt

# Run go script using the result from ./get.sh
$ ./get.sh 2023 1 > go run ./go/2023/day01a.go

# Run python script using stdin
$ python ./py/2023/day01a.py < in.txt

# Run python script using the result from ./get.sh
$ ./get.sh 2023 1 > python ./py/2023/day01a.py