LeMoonStar / AoC21

My solutions for Advent of Code 2021

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Advent of Code 2021

About Language: Rust License: MIT Days completed Stars

This repository contains my solutions for the Advent of Code 2021 challanges written in Rust.
I am currently still learning rust so please dont jude the quality of my code.

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 that it requires you to provide your Advent of Code session id, which you can find in the website's cookies after logging in.
Simply provide it by setting the AOC_SESSION enviroment variable or using the -s argument:
AOC_SESSION=XXXMYSESSION ./aoc21 [DAY] auto or ./aoc21 [DAY] auto -s XXXMYSESSION.
In this example, I set the enviroment variable for the terminal session using export AOC_SESSION=XXXMYSESSION, so I can run it without specifiyng the session id 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 stdin input:
./aoc21 [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: ./aoc21 [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/aoc21. You can also directly run the project using cargo run --release [arguments for aoc21]
the --release option is not required, but it results in better performance of the solutions.

Check out other solutions to AoC21

This is just a small selection of solutions from an small community I am part of.

Repository Language
1Turtle's AdventOfCode Lua(2021)
andi-make's aoc2021 Rust
Jonas' AdventOfCode2021 Java
DerNiklaas's Advent-Of-Code-2021 Kotlin
Trojaner's AdventofCode2021 C++
Daan Breur's AdventofCode Python(2021)
Gewi413's AdventOfCode Kotlin
Luftkeks's AdventOfCode Golang(2021)
noeppi_noeppi's aoc Assembly, COBOL, Smalltalk, Pascal, ...
NetworkException's AdventOfCode TypeScript

About

My solutions for Advent of Code 2021

License:MIT License


Languages

Language:Rust 100.0%