daanbreur / AoC23

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advent of Code 2023

About Language: Rust License: MIT Days completed Stars

This is the third year in a row I (plan to) use rust to solve Advent of Code. But I must warn you: I haven't programmed a lot over the past year, so I am likely not in the best shape (School has been rough - I need a break) - expect the worst.

Just like last year, I am lazy and currently setting this project up in a hurry (In class, actually) just so I have the basic framework once the event starts. So this project is literally a cleaned-up copy of my solutions for the previous year, which in term are a cleaned up version of my Advent of Code 2021 solutions.
The Following therefore still contains screenshots of the 2021 binary. The usage is the same, but the name is aoc23 instead of aoc21

Later on, maybe even before AoC starts, I'll clean this up more, maybe create a crate out of the framework so I don't have to copy each year over and over again.

Usage

There are multiple ways to run my solutions, the easiest and most comfortable one is the auto command:
It automatically downloads your input. For this it requires you to provide your Advent of Code session id, which you can find in the websites cookies after logging in.
Simply provide the session token by setting the AOC_SESSION environment variable or using the -s argument:
AOC_SESSION=XXXMYSESSION ./aoc23 [DAY] auto or ./aoc23 [DAY] auto -s XXXMYSESSION.
In this example, the environment variable for the AoC session is set using export AOC_SESSION=XXXMYSESSION, so I can run the command without specifying the session token again:
auto command in action

If you don't want to automatically download the input, you can also use the run command, which uses a locally stored file or the stdin input:
./aoc23 [DAY] run -f my_input.txt:
run command in action

If you just want to run the day's example, simply use the test command, as this project already includes the examples: ./aoc23 [DAY] test:
test command in action

Compiling

This project uses Cargo, so compiling is pretty easy:
cargo build --release
The resulting binary can be found at ./targets/release/aoc22. You can also directly run the project using cargo run --release [arguments for aoc23]
the --release option is not required, but it results in better performance.

Check out other AoC23 solutions

Repository Language

This list is not complete yet, as the event has not started yet.

About

License:MIT License


Languages

Language:Rust 100.0%