A tamplate for Advent of Code write in Rust.
- Day 1
- Day 2
- Day 3
- Day 4
- Day 5
- Day 6
- Day 7
- Day 8
- Day 9
- Day 10
- Day 11
- Day 12
- Day 13
- Day 14
- Day 15
- Day 16
- Day 17
- Day 18
- Day 19
- Day 20
- Day 21
- Day 22
- Day 23
- Day 24
- Day 25
The project is configured for run
, test
and build
each day independently.
For example:
# only run the day01
$ cargo run --bin day01
# only test the day02
$ cargo test --bin day02
# only build the day03
$ cargo build --bin day03
Folder structure:
src
└── day01
├── bin
│ ├── day01.rs
│ ├── part1.rs
│ └── part2.rs
├── input.txt
└── README.md
You can use nix-shell
to install the rust and tool dependencies used to run
the project.
You can edit the .replit
file and change the run
command for different
puzzles each day.
For example:
# test the day01
run = "cargo test --bin day01"
# test the day02 and run the day02 if the test pass
run = "cargo test --bin day02 && cargo run --bin day02"
Happy coding!