Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.
First and foremost, go to the Advent of Code website and log in and obtain the cookie.
In request header, in the request.header.cookie, find the session={value} pair.
Copy the {value} part to cmd/cookie.txt file.(do not include the session= part)
Build the adventofcode go command-line tool:
cd go
make build
## color test
go install github.com/rakyll/gotest@latestGet started on your first puzzle:
./generate -d 1 -y 2024 # default will use current day / yearThe command above will create a template solution file where your code will go. Your next steps should be:
-
Implement your solution in the
solution.gofile. updatetest.inputfile fro aoc website. Use this command to test it:go test ./y2024/d01/* go run ./y2024/d01/* # gotest
-
Once you think you have found the answer to the problem, submit it on the adventofcode.com website. If it's the right answer, congrats!
When logged in to the adventofcode.com website, your browser has a cookie called
session. Retrieve this cookie's value and save it to the cmd/cookie.txt. CLI
will automatically download your input for the day.