/advent-of-code-2022

Solutions to Advent of Code 2022 in Rust

Primary LanguageRustMIT LicenseMIT

advent-of-code-2022

My attempts at the Advent of Code 2022 challenges in Rust.

This is primarily a learning experience, and the code may not be following best practices.

Solutions

Day Name Code Input Data Time † GitHub Action Output
1 Calorie Counting src/day_01.rs src/day_01.data 0m0.002s Day-01
2 Rock Paper Scissors src/day_02.rs src/day_02.data 0m0.002s Day-02
3 Rucksack Reorganization src/day_03.rs src/day_03.data 0m0.002s Day-03
4 Camp Cleanup src/day_04.rs src/day_04.data 0m0.001s Day-04
5 Supply Stacks src/day_05.rs src/day_05.data 0m0.002s Day-05
6 Tuning Trouble src/day_06.rs src/day_06.data 0m0.002s Day-06
7 No Space Left On Device src/day_07.rs src/day_07.data 0m0.002s Day-07
8 Treetop Tree House src/day_08.rs src/day_08.data 0m0.002s Day-08
9 Rope Bridge src/day_09.rs src/day_09.data 0m0.007s Day-09
10 Cathode-Ray Tube src/day_10.rs src/day_10.data 0m0.003s Day-10
11 Monkey in the Middle src/day_11.rs src/day_11.data 0m0.030s Day-11
12 Hill Climbing Algorithm src/day_12.rs src/day_12.data 0m0.053s Day-12
13 Distress Signal src/day_13.rs src/day_13.data 0m0.053s Day-13
14 Regolith Reservoir src/day_14.rs src/day_14.data 0m0.002s Day-14
15 Beacon Exclusion Zone src/day_15.rs src/day_15.data 0m0.645s Day-15

The measured execution time in GitHub Actions

How to run

All puzzles are compiled into a single executable, and individual puzzles are selected using the first argument, which is the day number (01-25).

For example, to build and execute the puzzle for Day 2, run:

cargo run -- 02

To build optimized artifacts, run:

cargo build –-release --verbose
./target/release/aoc 02

Attribution