Awesome
Advent of Code solutions in Rust by TBali
- AoC website
- My AoC username:
tbali0524
- Puzzle list with topics and my completion status (in Rust)
- Link to this repo on GitHub
This repo contains the partial (~3 seasons) rewrite of my complete (450 ⭐) AoC solutions in PHP to Rust
, plus a simple CLI runner.
Usage
# -- setup
# install Rust: https://www.rust-lang.org/tools/install
rustup update stable
# -- info
cargo version
cargo tree
# -- lint
cargo verify-project
cargo fmt
cargo clippy
# -- doc
cargo doc --no-deps --document-private-items --open
# -- test
cargo test
cargo test 2023
cargo test 2023day02
cargo test cli
# in Powershell:
$env:RUST_BACKTRACE=1 ; cargo test
cargo run
cargo run -- 2023
cargo run -- 2023 2
# -- run
cargo build --release
target/release/aoc.exe
target/release/aoc.exe 2023
target/release/aoc.exe 2023 2
# -- shortcut run
./aoc.bat
./aoc.bat 2023
./aoc.bat 2023 2
./aoc.bat --help
# -- shortcut qa
./qa.bat
# -- cleanup
cargo clean
Adding a new solution
- add puzzle input in
input/year/AocYYYYDayDD.txt
and example inputs in...exX.txt
- add and edit source in
src/year/aocYYYYdayDD.rs
, using the template insrc/aocYYYYdayDD.rs
- update
pub fn metadata()
, writesolve()
, add unit tests as needed
- update
- edit
src/aocYYYY.rs
:- uncomment the
pub mod aocYYYYdayDD;
line - update the
PUZZLES
list: replaceNone
withSome(...)
- uncomment the
- for a completely new season:
- edit
src/lib.rs
: add apub mod aocYYYY;
line - edit
src/aoc.rs
: increaseMAX_SEASONS
and add aSome(...)
item toPUZZLES
- add and update
src/aocYYYY.rs
using the template insrc/aocYYYY.rs
- edit