diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 60037ffb..1f29e3da 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,7 +31,7 @@ jobs: for manifest in `find . -maxdepth 3 ! -path '*/day*' -name Cargo.toml` do echo check clippy for $manifest - cargo clippy --manifest-path $manifest -- --no-deps -D clippy::all -A clippy::pedantic -A clippy::nursery + cargo clippy --manifest-path $manifest -- --no-deps -D clippy::all -D clippy::pedantic -F clippy::nursery done # Check non-regression tests diff --git a/.justfile b/.justfile index c2f7be1a..9f046228 100644 --- a/.justfile +++ b/.justfile @@ -2,21 +2,23 @@ set shell := ["bash", "-uc"] alias r := run -# export RUSTFLAGS := "-C target-cpu=native" - run: ./scripts/runall.py --working-dir {{invocation_directory()}} -lrust --verified +# make + clean: git clean -fd make-debug: - cargo build --manifest-path aoc/Cargo.toml --quiet - @for year in 20* ; do echo "cargo build $year" ; cargo build --manifest-path $year/Cargo.toml --quiet ; done + @for path in crates/*/Cargo.toml ; do cargo build --manifest-path $path --quiet ; done + cargo build --manifest-path ./Cargo.toml --quiet make: - cargo build --manifest-path aoc/Cargo.toml --release --quiet - @for year in 20* ; do echo "cargo build $year" ; cargo build --manifest-path $year/Cargo.toml --release --quiet ; done + @for path in crates/*/Cargo.toml ; do cargo build --manifest-path $path --quiet --release ; done + cargo build --manifest-path ./Cargo.toml --quiet --release + +# exec timings *ARGS: ./scripts/timings.py {{ ARGS }} @@ -27,6 +29,8 @@ run-all *ARGS: tmux kill-window -t aoc:0 tmux list-windows -t aoc +# GitHub + gh-fmt: #!/usr/bin/env bash for manifest in `find . -maxdepth 3 ! -path '*/day*' -name Cargo.toml` @@ -40,7 +44,7 @@ gh-clippy: for manifest in `find . -maxdepth 3 ! -path '*/day*' -name Cargo.toml` do echo check clippy for $manifest - cargo clippy --manifest-path $manifest -- --no-deps -D clippy::all -A clippy::pedantic -A clippy::nursery + cargo clippy --manifest-path $manifest -- --no-deps -D clippy::all -D clippy::pedantic -F clippy::nursery done gh-test: @@ -53,6 +57,7 @@ gh-test: gh: gh-fmt gh-clippy gh-test +# Docker stuff debian: docker build -f scripts/Dockerfile -t aoc scripts/ diff --git a/2015/Cargo.toml b/2015/Cargo.toml deleted file mode 100644 index e30b2418..00000000 --- a/2015/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -# https://adventofcode.com/2015 - -[workspace] -members = ["day*"] -resolver = "2" diff --git a/2015/README.md b/2015/README.md deleted file mode 100644 index cb668147..00000000 --- a/2015/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Advent of Code in Rust 🦀 - -![AoC2015](https://img.shields.io/badge/Advent_of_Code-2015-8A2BE2) -![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) -![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) -![Python: 5](https://img.shields.io/badge/Python-5-cyan?logo=Python) - -## 2015 ([Calendar](https://adventofcode.com/2015)) ([Solutions](../2015/)) : 50⭐ - -Puzzle | Stars | Languages ------------------------------------------------------------------------------------- | ----- | ----------- -[Day 1: Not Quite Lisp](https://adventofcode.com/2015/day/1) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day1/day1.rs) -[Day 2: I Was Told There Would Be No Math](https://adventofcode.com/2015/day/2) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day2/day2.rs) -[Day 3: Perfectly Spherical Houses in a Vacuum](https://adventofcode.com/2015/day/3) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day3/day3.rs) -[Day 4: The Ideal Stocking Stuffer](https://adventofcode.com/2015/day/4) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day4/day4.rs) -[Day 5: Doesn't He Have Intern-Elves For This?](https://adventofcode.com/2015/day/5) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day5/day5.rs) -[Day 6: Probably a Fire Hazard](https://adventofcode.com/2015/day/6) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day6/day6.rs) -[Day 7: Some Assembly Required](https://adventofcode.com/2015/day/7) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day7/day7.rs) -[Day 8: Matchsticks](https://adventofcode.com/2015/day/8) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day8/day8.rs) -[Day 9: All in a Single Night](https://adventofcode.com/2015/day/9) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day9/day9.rs) -[Day 10: Elves Look, Elves Say](https://adventofcode.com/2015/day/10) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day10/day10.rs) -[Day 11: Corporate Policy](https://adventofcode.com/2015/day/11) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day11/day11.rs) -[Day 12: JSAbacusFramework.io](https://adventofcode.com/2015/day/12) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day12/day12.rs) -[Day 13: Knights of the Dinner Table](https://adventofcode.com/2015/day/13) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day13/day13.rs) [![Python](../scripts/assets/python.png)](../2015/day13/day13.py) -[Day 14: Reindeer Olympics](https://adventofcode.com/2015/day/14) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day14/day14.rs) -[Day 15: Science for Hungry People](https://adventofcode.com/2015/day/15) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day15/day15.rs) -[Day 16: Aunt Sue](https://adventofcode.com/2015/day/16) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day16/day16.rs) [![Python](../scripts/assets/python.png)](../2015/day16/day16.py) -[Day 17: No Such Thing as Too Much](https://adventofcode.com/2015/day/17) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day17/day17.rs) -[Day 18: Like a GIF For Your Yard](https://adventofcode.com/2015/day/18) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day18/day18.rs) [🎁](../2015/day18/README.md) -[Day 19: Medicine for Rudolph](https://adventofcode.com/2015/day/19) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day19/day19.rs) -[Day 20: Infinite Elves and Infinite Houses](https://adventofcode.com/2015/day/20) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day20/day20.rs) -[Day 21: RPG Simulator 20XX](https://adventofcode.com/2015/day/21) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day21/day21.rs) [![Python](../scripts/assets/python.png)](../2015/day21/day21.py) -[Day 22: Wizard Simulator 20XX](https://adventofcode.com/2015/day/22) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day22/day22.rs) -[Day 23: Opening the Turing Lock](https://adventofcode.com/2015/day/23) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day23/day23.rs) [![Python](../scripts/assets/python.png)](../2015/day23/day23.py) -[Day 24: It Hangs in the Balance](https://adventofcode.com/2015/day/24) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day24/day24.rs) [![Python](../scripts/assets/python.png)](../2015/day24/day24.py) -[Day 25: Let It Snow](https://adventofcode.com/2015/day/25) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2015/day25/day25.rs) diff --git a/2015/day1/Cargo.toml b/2015/day1/Cargo.toml deleted file mode 100644 index bbf40642..00000000 --- a/2015/day1/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day1" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day1" -path = "day1.rs" diff --git a/2015/day10/Cargo.toml b/2015/day10/Cargo.toml deleted file mode 100644 index 0c6b79d5..00000000 --- a/2015/day10/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day10" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day10" -path = "day10.rs" diff --git a/2015/day11/Cargo.toml b/2015/day11/Cargo.toml deleted file mode 100644 index 6f7b3801..00000000 --- a/2015/day11/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day11" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day11" -path = "day11.rs" diff --git a/2015/day12/Cargo.toml b/2015/day12/Cargo.toml deleted file mode 100644 index a387b716..00000000 --- a/2015/day12/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day12" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -serde_json = "*" - -[[bin]] -name = "day12" -path = "day12.rs" diff --git a/2015/day13/Cargo.toml b/2015/day13/Cargo.toml deleted file mode 100644 index 0116b484..00000000 --- a/2015/day13/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day13" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" -itertools = "*" - -[[bin]] -name = "day13" -path = "day13.rs" diff --git a/2015/day14/Cargo.toml b/2015/day14/Cargo.toml deleted file mode 100644 index 83b818d2..00000000 --- a/2015/day14/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day14" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day14" -path = "day14.rs" diff --git a/2015/day15/Cargo.toml b/2015/day15/Cargo.toml deleted file mode 100644 index e555ab14..00000000 --- a/2015/day15/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day15" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day15" -path = "day15.rs" diff --git a/2015/day16/Cargo.toml b/2015/day16/Cargo.toml deleted file mode 100644 index cc47be34..00000000 --- a/2015/day16/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day16" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day16" -path = "day16.rs" diff --git a/2015/day17/Cargo.toml b/2015/day17/Cargo.toml deleted file mode 100644 index 914ae753..00000000 --- a/2015/day17/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day17" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -itertools = "*" -rustc-hash = "*" - -[[bin]] -name = "day17" -path = "day17.rs" diff --git a/2015/day18/Cargo.toml b/2015/day18/Cargo.toml deleted file mode 100644 index 3a0c4bfc..00000000 --- a/2015/day18/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "day18" -version = "0.1.0" -edition = "2021" - -[features] -ascii = [] -anim = ["image"] - -[dependencies] -aoc = { path = "../../aoc" } -image = { version = "*", optional = true } - -[[bin]] -name = "day18" -path = "day18.rs" diff --git a/2015/day19/Cargo.toml b/2015/day19/Cargo.toml deleted file mode 100644 index c46af131..00000000 --- a/2015/day19/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day19" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day19" -path = "day19.rs" diff --git a/2015/day2/Cargo.toml b/2015/day2/Cargo.toml deleted file mode 100644 index 768b1e4b..00000000 --- a/2015/day2/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day2" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day2" -path = "day2.rs" diff --git a/2015/day20/Cargo.toml b/2015/day20/Cargo.toml deleted file mode 100644 index 4547f15e..00000000 --- a/2015/day20/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day20" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -divisors = "*" - -[[bin]] -name = "day20" -path = "day20.rs" diff --git a/2015/day21/Cargo.toml b/2015/day21/Cargo.toml deleted file mode 100644 index 06a1dbab..00000000 --- a/2015/day21/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day21" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day21" -path = "day21.rs" diff --git a/2015/day22/Cargo.toml b/2015/day22/Cargo.toml deleted file mode 100644 index 8a6b51d4..00000000 --- a/2015/day22/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day22" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -strum = { version = "*", features = ["strum_macros", "derive"] } -strum_macros = "*" - -[[bin]] -name = "day22" -path = "day22.rs" diff --git a/2015/day23/Cargo.toml b/2015/day23/Cargo.toml deleted file mode 100644 index 8a51b172..00000000 --- a/2015/day23/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day23" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day23" -path = "day23.rs" diff --git a/2015/day24/Cargo.toml b/2015/day24/Cargo.toml deleted file mode 100644 index 82a5d728..00000000 --- a/2015/day24/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day24" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -itertools = "*" - -[[bin]] -name = "day24" -path = "day24.rs" diff --git a/2015/day25/Cargo.toml b/2015/day25/Cargo.toml deleted file mode 100644 index 9fd6995b..00000000 --- a/2015/day25/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day25" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day25" -path = "day25.rs" diff --git a/2015/day3/Cargo.toml b/2015/day3/Cargo.toml deleted file mode 100644 index 4f561a74..00000000 --- a/2015/day3/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day3" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day3" -path = "day3.rs" diff --git a/2015/day4/Cargo.toml b/2015/day4/Cargo.toml deleted file mode 100644 index ccc13204..00000000 --- a/2015/day4/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day4" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -md5 = "*" - -[[bin]] -name = "day4" -path = "day4.rs" diff --git a/2015/day5/Cargo.toml b/2015/day5/Cargo.toml deleted file mode 100644 index 64854eb5..00000000 --- a/2015/day5/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day5" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day5" -path = "day5.rs" diff --git a/2015/day6/Cargo.toml b/2015/day6/Cargo.toml deleted file mode 100644 index 4ed5981d..00000000 --- a/2015/day6/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day6" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day6" -path = "day6.rs" diff --git a/2015/day7/Cargo.toml b/2015/day7/Cargo.toml deleted file mode 100644 index f1450864..00000000 --- a/2015/day7/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day7" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day7" -path = "day7.rs" diff --git a/2015/day8/Cargo.toml b/2015/day8/Cargo.toml deleted file mode 100644 index 63ccc8ce..00000000 --- a/2015/day8/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day8" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day8" -path = "day8.rs" diff --git a/2015/day9/Cargo.toml b/2015/day9/Cargo.toml deleted file mode 100644 index 013a2e89..00000000 --- a/2015/day9/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day9" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -itertools = "*" -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day9" -path = "day9.rs" diff --git a/2016/.bonus.md b/2016/.bonus.md deleted file mode 100644 index a1caa275..00000000 --- a/2016/.bonus.md +++ /dev/null @@ -1,3 +0,0 @@ -## Bonus - -[Assembunny assembler](../2016/assembunny/assembler/asm.py) \ No newline at end of file diff --git a/2016/Cargo.toml b/2016/Cargo.toml deleted file mode 100644 index e0828cd5..00000000 --- a/2016/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -# https://adventofcode.com/2016 - -[workspace] -members = ["day*", "assembunny"] -resolver = "2" - -[profile.release] -opt-level = "s" diff --git a/2016/README.md b/2016/README.md deleted file mode 100644 index 89c04b37..00000000 --- a/2016/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Advent of Code in Rust 🦀 - -![AoC2016](https://img.shields.io/badge/Advent_of_Code-2016-8A2BE2) -![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) -![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) - -## 2016 ([Calendar](https://adventofcode.com/2016)) ([Solutions](../2016/)) : 50⭐ - -Puzzle | Stars | Languages --------------------------------------------------------------------------------------- | ----- | ----------- -[Day 1: No Time for a Taxicab](https://adventofcode.com/2016/day/1) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day1/day1.rs) -[Day 2: Bathroom Security](https://adventofcode.com/2016/day/2) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day2/day2.rs) -[Day 3: Squares With Three Sides](https://adventofcode.com/2016/day/3) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day3/day3.rs) -[Day 4: Security Through Obscurity](https://adventofcode.com/2016/day/4) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day4/day4.rs) -[Day 5: How About a Nice Game of Chess?](https://adventofcode.com/2016/day/5) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day5/day5.rs) -[Day 6: Signals and Noise](https://adventofcode.com/2016/day/6) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day6/day6.rs) -[Day 7: Internet Protocol Version 7](https://adventofcode.com/2016/day/7) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day7/day7.rs) -[Day 8: Two-Factor Authentication](https://adventofcode.com/2016/day/8) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day8/day8.rs) -[Day 9: Explosives in Cyberspace](https://adventofcode.com/2016/day/9) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day9/day9.rs) -[Day 10: Balance Bots](https://adventofcode.com/2016/day/10) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day10/day10.rs) -[Day 11: Radioisotope Thermoelectric Generators](https://adventofcode.com/2016/day/11) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day11/day11.rs) -[Day 12: Leonardo's Monorail](https://adventofcode.com/2016/day/12) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day12/day12.rs) -[Day 13: A Maze of Twisty Little Cubicles](https://adventofcode.com/2016/day/13) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day13/day13.rs) -[Day 14: One-Time Pad](https://adventofcode.com/2016/day/14) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day14/day14.rs) -[Day 15: Timing is Everything](https://adventofcode.com/2016/day/15) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day15/day15.rs) -[Day 16: Dragon Checksum](https://adventofcode.com/2016/day/16) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day16/day16.rs) -[Day 17: Two Steps Forward](https://adventofcode.com/2016/day/17) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day17/day17.rs) -[Day 18: Like a Rogue](https://adventofcode.com/2016/day/18) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day18/day18.rs) -[Day 19: An Elephant Named Joseph](https://adventofcode.com/2016/day/19) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day19/day19.rs) -[Day 20: Firewall Rules](https://adventofcode.com/2016/day/20) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day20/day20.rs) -[Day 21: Scrambled Letters and Hash](https://adventofcode.com/2016/day/21) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day21/day21.rs) -[Day 22: Grid Computing](https://adventofcode.com/2016/day/22) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day22/day22.rs) -[Day 23: Safe Cracking](https://adventofcode.com/2016/day/23) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day23/day23.rs) -[Day 24: Air Duct Spelunking](https://adventofcode.com/2016/day/24) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day24/day24.rs) -[Day 25: Clock Signal](https://adventofcode.com/2016/day/25) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2016/day25/day25.rs) - -## Bonus - -[Assembunny assembler](../2016/assembunny/assembler/asm.py) diff --git a/2016/day1/Cargo.toml b/2016/day1/Cargo.toml deleted file mode 100644 index d907473c..00000000 --- a/2016/day1/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day1" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day1" -path = "day1.rs" diff --git a/2016/day10/Cargo.toml b/2016/day10/Cargo.toml deleted file mode 100644 index 1700ce22..00000000 --- a/2016/day10/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day10" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day10" -path = "day10.rs" diff --git a/2016/day11/Cargo.toml b/2016/day11/Cargo.toml deleted file mode 100644 index b546e67b..00000000 --- a/2016/day11/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day11" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -itertools = "*" -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day11" -path = "day11.rs" diff --git a/2016/day12/Cargo.toml b/2016/day12/Cargo.toml deleted file mode 100644 index 943459a7..00000000 --- a/2016/day12/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day12" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -assembunny = { path = "../assembunny/" } - -[[bin]] -name = "day12" -path = "day12.rs" diff --git a/2016/day13/Cargo.toml b/2016/day13/Cargo.toml deleted file mode 100644 index f02942c5..00000000 --- a/2016/day13/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day13" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day13" -path = "day13.rs" diff --git a/2016/day14/Cargo.toml b/2016/day14/Cargo.toml deleted file mode 100644 index bc4fa3c3..00000000 --- a/2016/day14/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day14" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -md5 = "*" -rustc-hash = "*" - -[[bin]] -name = "day14" -path = "day14.rs" diff --git a/2016/day15/Cargo.toml b/2016/day15/Cargo.toml deleted file mode 100644 index e555ab14..00000000 --- a/2016/day15/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day15" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day15" -path = "day15.rs" diff --git a/2016/day16/Cargo.toml b/2016/day16/Cargo.toml deleted file mode 100644 index 4f755eeb..00000000 --- a/2016/day16/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day16" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day16" -path = "day16.rs" diff --git a/2016/day17/Cargo.toml b/2016/day17/Cargo.toml deleted file mode 100644 index 46622276..00000000 --- a/2016/day17/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day17" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -md5 = "*" - -[[bin]] -name = "day17" -path = "day17.rs" diff --git a/2016/day18/Cargo.toml b/2016/day18/Cargo.toml deleted file mode 100644 index 86a98d20..00000000 --- a/2016/day18/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day18" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day18" -path = "day18.rs" diff --git a/2016/day19/Cargo.toml b/2016/day19/Cargo.toml deleted file mode 100644 index 39989142..00000000 --- a/2016/day19/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day19" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day19" -path = "day19.rs" diff --git a/2016/day2/Cargo.toml b/2016/day2/Cargo.toml deleted file mode 100644 index 768b1e4b..00000000 --- a/2016/day2/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day2" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day2" -path = "day2.rs" diff --git a/2016/day20/Cargo.toml b/2016/day20/Cargo.toml deleted file mode 100644 index 613f3064..00000000 --- a/2016/day20/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day20" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day20" -path = "day20.rs" diff --git a/2016/day21/Cargo.toml b/2016/day21/Cargo.toml deleted file mode 100644 index 83581643..00000000 --- a/2016/day21/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day21" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day21" -path = "day21.rs" diff --git a/2016/day22/Cargo.toml b/2016/day22/Cargo.toml deleted file mode 100644 index 046e465e..00000000 --- a/2016/day22/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day22" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day22" -path = "day22.rs" diff --git a/2016/day23/Cargo.toml b/2016/day23/Cargo.toml deleted file mode 100644 index d1e03d16..00000000 --- a/2016/day23/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day23" -version = "0.1.0" -edition = "2021" - -[dependencies] -assembunny = { path = "../assembunny/" } -aoc = { path = "../../aoc" } -num-traits = "*" - -[[bin]] -name = "day23" -path = "day23.rs" diff --git a/2016/day24/Cargo.toml b/2016/day24/Cargo.toml deleted file mode 100644 index 06cfd2d1..00000000 --- a/2016/day24/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day24" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -itertools = "*" -rustc-hash = "*" - -[[bin]] -name = "day24" -path = "day24.rs" diff --git a/2016/day25/Cargo.toml b/2016/day25/Cargo.toml deleted file mode 100644 index a682ce04..00000000 --- a/2016/day25/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day25" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -assembunny = { path = "../assembunny/" } -num-traits = "*" - -[[bin]] -name = "day25" -path = "day25.rs" diff --git a/2016/day3/Cargo.toml b/2016/day3/Cargo.toml deleted file mode 100644 index bea419dd..00000000 --- a/2016/day3/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day3" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -itertools = "*" - -[[bin]] -name = "day3" -path = "day3.rs" diff --git a/2016/day4/Cargo.toml b/2016/day4/Cargo.toml deleted file mode 100644 index 11ce32a0..00000000 --- a/2016/day4/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day4" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -lazy_static = "*" -rustc-hash = "*" - -[[bin]] -name = "day4" -path = "day4.rs" diff --git a/2016/day5/Cargo.toml b/2016/day5/Cargo.toml deleted file mode 100644 index 359b2408..00000000 --- a/2016/day5/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day5" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -md5 = "*" -indicatif = "*" - -[[bin]] -name = "day5" -path = "day5.rs" diff --git a/2016/day6/Cargo.toml b/2016/day6/Cargo.toml deleted file mode 100644 index 0c1a3cb7..00000000 --- a/2016/day6/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day6" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day6" -path = "day6.rs" diff --git a/2016/day7/Cargo.toml b/2016/day7/Cargo.toml deleted file mode 100644 index ed2e3f98..00000000 --- a/2016/day7/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day7" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day7" -path = "day7.rs" diff --git a/2016/day8/Cargo.toml b/2016/day8/Cargo.toml deleted file mode 100644 index df330ad3..00000000 --- a/2016/day8/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day8" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day8" -path = "day8.rs" diff --git a/2016/day9/Cargo.toml b/2016/day9/Cargo.toml deleted file mode 100644 index 4c086fa8..00000000 --- a/2016/day9/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day9" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day9" -path = "day9.rs" diff --git a/2017/Cargo.toml b/2017/Cargo.toml deleted file mode 100644 index 6cc30904..00000000 --- a/2017/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -# https://adventofcode.com/2017 - -[workspace] -members = ["day*"] -resolver = "2" diff --git a/2017/README.md b/2017/README.md deleted file mode 100644 index 48aa7755..00000000 --- a/2017/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Advent of Code in Rust 🦀 - -![AoC2017](https://img.shields.io/badge/Advent_of_Code-2017-8A2BE2) -![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) -![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) -![Python: 17](https://img.shields.io/badge/Python-17-cyan?logo=Python) - -## 2017 ([Calendar](https://adventofcode.com/2017)) ([Solutions](../2017/)) : 50⭐ - -Puzzle | Stars | Languages -------------------------------------------------------------------------------------- | ----- | ----------- -[Day 1: Inverse Captcha](https://adventofcode.com/2017/day/1) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day1/day1.rs) [![Python](../scripts/assets/python.png)](../2017/day1/day1.py) -[Day 2: Corruption Checksum](https://adventofcode.com/2017/day/2) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day2/day2.rs) [![Python](../scripts/assets/python.png)](../2017/day2/day2.py) -[Day 3: Spiral Memory](https://adventofcode.com/2017/day/3) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day3/day3.rs) [![Python](../scripts/assets/python.png)](../2017/day3/day3.py) -[Day 4: High-Entropy Passphrases](https://adventofcode.com/2017/day/4) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day4/day4.rs) [![Python](../scripts/assets/python.png)](../2017/day4/day4.py) -[Day 5: A Maze of Twisty Trampolines, All Alike](https://adventofcode.com/2017/day/5) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day5/day5.rs) [![Python](../scripts/assets/python.png)](../2017/day5/day5.py) -[Day 6: Memory Reallocation](https://adventofcode.com/2017/day/6) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day6/day6.rs) [![Python](../scripts/assets/python.png)](../2017/day6/day6.py) -[Day 7: Recursive Circus](https://adventofcode.com/2017/day/7) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day7/day7.rs) [![Python](../scripts/assets/python.png)](../2017/day7/day7.py) -[Day 8: I Heard You Like Registers](https://adventofcode.com/2017/day/8) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day8/day8.rs) [![Python](../scripts/assets/python.png)](../2017/day8/day8.py) -[Day 9: Stream Processing](https://adventofcode.com/2017/day/9) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day9/day9.rs) [![Python](../scripts/assets/python.png)](../2017/day9/day9.py) -[Day 10: Knot Hash](https://adventofcode.com/2017/day/10) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day10/day10.rs) -[Day 11: Hex Ed](https://adventofcode.com/2017/day/11) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day11/day11.rs) [![Python](../scripts/assets/python.png)](../2017/day11/day11.py) -[Day 12: Digital Plumber](https://adventofcode.com/2017/day/12) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day12/day12.rs) [![Python](../scripts/assets/python.png)](../2017/day12/day12.py) -[Day 13: Packet Scanners](https://adventofcode.com/2017/day/13) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day13/day13.rs) -[Day 14: Disk Defragmentation](https://adventofcode.com/2017/day/14) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day14/day14.rs) -[Day 15: Dueling Generators](https://adventofcode.com/2017/day/15) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day15/day15.rs) -[Day 16: Permutation Promenade](https://adventofcode.com/2017/day/16) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day16/day16.rs) -[Day 17: Spinlock](https://adventofcode.com/2017/day/17) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day17/day17.rs) -[Day 18: Duet](https://adventofcode.com/2017/day/18) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day18/day18.rs) -[Day 19: A Series of Tubes](https://adventofcode.com/2017/day/19) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day19/day19.rs) [![Python](../scripts/assets/python.png)](../2017/day19/day19.py) -[Day 20: Particle Swarm](https://adventofcode.com/2017/day/20) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day20/day20.rs) [![Python](../scripts/assets/python.png)](../2017/day20/day20.py) -[Day 21: Fractal Art](https://adventofcode.com/2017/day/21) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day21/day21.rs) [![Python](../scripts/assets/python.png)](../2017/day21/day21.py) -[Day 22: Sporifica Virus](https://adventofcode.com/2017/day/22) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day22/day22.rs) [![Python](../scripts/assets/python.png)](../2017/day22/day22.py) -[Day 23: Coprocessor Conflagration](https://adventofcode.com/2017/day/23) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day23/day23.rs) -[Day 24: Electromagnetic Moat](https://adventofcode.com/2017/day/24) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day24/day24.rs) [![Python](../scripts/assets/python.png)](../2017/day24/day24.py) -[Day 25: The Halting Problem](https://adventofcode.com/2017/day/25) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2017/day25/day25.rs) [![Python](../scripts/assets/python.png)](../2017/day25/day25.py) diff --git a/2017/day1/Cargo.toml b/2017/day1/Cargo.toml deleted file mode 100644 index bbf40642..00000000 --- a/2017/day1/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day1" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day1" -path = "day1.rs" diff --git a/2017/day10/Cargo.toml b/2017/day10/Cargo.toml deleted file mode 100644 index 1627df73..00000000 --- a/2017/day10/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day10" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day10" -path = "day10.rs" - -# [lib] -# path = "lib.rs" \ No newline at end of file diff --git a/2017/day11/Cargo.toml b/2017/day11/Cargo.toml deleted file mode 100644 index 6f7b3801..00000000 --- a/2017/day11/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day11" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day11" -path = "day11.rs" diff --git a/2017/day12/Cargo.toml b/2017/day12/Cargo.toml deleted file mode 100644 index 8be331ad..00000000 --- a/2017/day12/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day12" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day12" -path = "day12.rs" diff --git a/2017/day13/Cargo.toml b/2017/day13/Cargo.toml deleted file mode 100644 index f02942c5..00000000 --- a/2017/day13/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day13" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day13" -path = "day13.rs" diff --git a/2017/day14/Cargo.toml b/2017/day14/Cargo.toml deleted file mode 100644 index b21cf887..00000000 --- a/2017/day14/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day14" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day14" -path = "day14.rs" diff --git a/2017/day15/Cargo.toml b/2017/day15/Cargo.toml deleted file mode 100644 index 46c03c2c..00000000 --- a/2017/day15/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day15" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day15" -path = "day15.rs" diff --git a/2017/day16/Cargo.toml b/2017/day16/Cargo.toml deleted file mode 100644 index 4f755eeb..00000000 --- a/2017/day16/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day16" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day16" -path = "day16.rs" diff --git a/2017/day17/Cargo.toml b/2017/day17/Cargo.toml deleted file mode 100644 index 17cc3676..00000000 --- a/2017/day17/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day17" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day17" -path = "day17.rs" diff --git a/2017/day18/Cargo.toml b/2017/day18/Cargo.toml deleted file mode 100644 index b5aa9822..00000000 --- a/2017/day18/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day18" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day18" -path = "day18.rs" diff --git a/2017/day19/Cargo.toml b/2017/day19/Cargo.toml deleted file mode 100644 index 39989142..00000000 --- a/2017/day19/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day19" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day19" -path = "day19.rs" diff --git a/2017/day2/Cargo.toml b/2017/day2/Cargo.toml deleted file mode 100644 index 768b1e4b..00000000 --- a/2017/day2/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day2" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day2" -path = "day2.rs" diff --git a/2017/day20/Cargo.toml b/2017/day20/Cargo.toml deleted file mode 100644 index 03a48bb9..00000000 --- a/2017/day20/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day20" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day20" -path = "day20.rs" diff --git a/2017/day21/Cargo.toml b/2017/day21/Cargo.toml deleted file mode 100644 index 384cf73d..00000000 --- a/2017/day21/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day21" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -bytecount = "*" -rustc-hash = "*" - -[[bin]] -name = "day21" -path = "day21.rs" diff --git a/2017/day22/Cargo.toml b/2017/day22/Cargo.toml deleted file mode 100644 index 046e465e..00000000 --- a/2017/day22/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day22" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day22" -path = "day22.rs" diff --git a/2017/day23/Cargo.toml b/2017/day23/Cargo.toml deleted file mode 100644 index a8ac5bf9..00000000 --- a/2017/day23/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day23" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day23" -path = "day23.rs" diff --git a/2017/day24/Cargo.toml b/2017/day24/Cargo.toml deleted file mode 100644 index 69504340..00000000 --- a/2017/day24/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day24" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day24" -path = "day24.rs" diff --git a/2017/day25/Cargo.toml b/2017/day25/Cargo.toml deleted file mode 100644 index 7275a50e..00000000 --- a/2017/day25/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day25" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day25" -path = "day25.rs" diff --git a/2017/day3/Cargo.toml b/2017/day3/Cargo.toml deleted file mode 100644 index 985edff0..00000000 --- a/2017/day3/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day3" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day3" -path = "day3.rs" diff --git a/2017/day4/Cargo.toml b/2017/day4/Cargo.toml deleted file mode 100644 index a83fc9cd..00000000 --- a/2017/day4/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day4" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day4" -path = "day4.rs" diff --git a/2017/day5/Cargo.toml b/2017/day5/Cargo.toml deleted file mode 100644 index 64854eb5..00000000 --- a/2017/day5/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day5" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day5" -path = "day5.rs" diff --git a/2017/day6/Cargo.toml b/2017/day6/Cargo.toml deleted file mode 100644 index 54bf4c71..00000000 --- a/2017/day6/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day6" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day6" -path = "day6.rs" diff --git a/2017/day7/Cargo.toml b/2017/day7/Cargo.toml deleted file mode 100644 index f1450864..00000000 --- a/2017/day7/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day7" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day7" -path = "day7.rs" diff --git a/2017/day8/Cargo.toml b/2017/day8/Cargo.toml deleted file mode 100644 index c36bf38a..00000000 --- a/2017/day8/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day8" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -pest = { version = "*", default-features = false } -pest_derive = { version = "*", default-features = true } -rustc-hash = "*" - -[[bin]] -name = "day8" -path = "day8.rs" diff --git a/2017/day9/Cargo.toml b/2017/day9/Cargo.toml deleted file mode 100644 index 4c086fa8..00000000 --- a/2017/day9/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day9" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day9" -path = "day9.rs" diff --git a/2018/Cargo.toml b/2018/Cargo.toml deleted file mode 100644 index c6966bdf..00000000 --- a/2018/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -# https://adventofcode.com/2018 - -[workspace] -members = ["day*"] -resolver = "2" diff --git a/2018/README.md b/2018/README.md deleted file mode 100644 index 00a059b6..00000000 --- a/2018/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Advent of Code in Rust 🦀 - -![AoC2018](https://img.shields.io/badge/Advent_of_Code-2018-8A2BE2) -![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) -![Rust: 27](https://img.shields.io/badge/Rust-27-cyan?logo=Rust) -![Python: 4](https://img.shields.io/badge/Python-4-cyan?logo=Python) - -## 2018 ([Calendar](https://adventofcode.com/2018)) ([Solutions](../2018/)) : 50⭐ - -Puzzle | Stars | Languages ------------------------------------------------------------------------------------- | ----- | ----------- -[Day 1: Chronal Calibration](https://adventofcode.com/2018/day/1) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day1/day1.rs) -[Day 2: Inventory Management System](https://adventofcode.com/2018/day/2) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day2/day2.rs) -[Day 3: No Matter How You Slice It](https://adventofcode.com/2018/day/3) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day3/day3.rs) -[Day 4: Repose Record](https://adventofcode.com/2018/day/4) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day4/day4.rs) [![Python](../scripts/assets/python.png)](../2018/day4/day4.py) -[Day 5: Alchemical Reduction](https://adventofcode.com/2018/day/5) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day5/day5.rs) -[Day 6: Chronal Coordinates](https://adventofcode.com/2018/day/6) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day6/day6.rs) -[Day 7: The Sum of Its Parts](https://adventofcode.com/2018/day/7) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day7/day7.rs) -[Day 8: Memory Maneuver](https://adventofcode.com/2018/day/8) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day8/day8.rs) [![Python](../scripts/assets/python.png)](../2018/day8/day8.py) -[Day 9: Marble Mania](https://adventofcode.com/2018/day/9) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day9/day9.rs) [![Rust](../scripts/assets/rust.png)](../2018/day9_c/day9.rs) [![C](../scripts/assets/c.png)](../2018/day9_c/day9.c) -[Day 10: The Stars Align](https://adventofcode.com/2018/day/10) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day10/day10.rs) -[Day 11: Chronal Charge](https://adventofcode.com/2018/day/11) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day11/day11.rs) -[Day 12: Subterranean Sustainability](https://adventofcode.com/2018/day/12) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day12/day12.rs) -[Day 13: Mine Cart Madness](https://adventofcode.com/2018/day/13) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day13/day13.rs) -[Day 14: Chocolate Charts](https://adventofcode.com/2018/day/14) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day14/day14.rs) -[Day 15: Beverage Bandits](https://adventofcode.com/2018/day/15) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day15/day15.rs) -[Day 16: Chronal Classification](https://adventofcode.com/2018/day/16) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day16/day16.rs) [![Python](../scripts/assets/python.png)](../2018/day16/day16.py) -[Day 17: Reservoir Research](https://adventofcode.com/2018/day/17) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day17/day17.rs) -[Day 18: Settlers of The North Pole](https://adventofcode.com/2018/day/18) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day18/day18.rs) [![Python](../scripts/assets/python.png)](../2018/day18/day18.py) [🎁](../2018/day18/README.md) -[Day 19: Go With The Flow](https://adventofcode.com/2018/day/19) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day19/day19.rs) -[Day 20: A Regular Map](https://adventofcode.com/2018/day/20) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day20/day20.rs) -[Day 21: Chronal Conversion](https://adventofcode.com/2018/day/21) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day21/day21.rs) -[Day 22: Mode Maze](https://adventofcode.com/2018/day/22) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day22/day22.rs) -[Day 23: Experimental Emergency Teleportation](https://adventofcode.com/2018/day/23) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day23/day23.rs) [![Rust](../scripts/assets/rust.png)](../2018/day23_z3/day23.rs) -[Day 24: Immune System Simulator 20XX](https://adventofcode.com/2018/day/24) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day24/day24.rs) -[Day 25: Four-Dimensional Adventure](https://adventofcode.com/2018/day/25) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2018/day25/day25.rs) diff --git a/2018/day1/Cargo.toml b/2018/day1/Cargo.toml deleted file mode 100644 index d907473c..00000000 --- a/2018/day1/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day1" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day1" -path = "day1.rs" diff --git a/2018/day10/Cargo.toml b/2018/day10/Cargo.toml deleted file mode 100644 index 0c6b79d5..00000000 --- a/2018/day10/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day10" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day10" -path = "day10.rs" diff --git a/2018/day11/Cargo.toml b/2018/day11/Cargo.toml deleted file mode 100644 index 6f7b3801..00000000 --- a/2018/day11/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day11" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day11" -path = "day11.rs" diff --git a/2018/day12/Cargo.toml b/2018/day12/Cargo.toml deleted file mode 100644 index 8be331ad..00000000 --- a/2018/day12/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day12" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day12" -path = "day12.rs" diff --git a/2018/day13/Cargo.toml b/2018/day13/Cargo.toml deleted file mode 100644 index f02942c5..00000000 --- a/2018/day13/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day13" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day13" -path = "day13.rs" diff --git a/2018/day14/Cargo.toml b/2018/day14/Cargo.toml deleted file mode 100644 index b21cf887..00000000 --- a/2018/day14/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day14" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day14" -path = "day14.rs" diff --git a/2018/day15/Cargo.toml b/2018/day15/Cargo.toml deleted file mode 100644 index 0cbdff01..00000000 --- a/2018/day15/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day15" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day15" -path = "day15.rs" diff --git a/2018/day16/Cargo.toml b/2018/day16/Cargo.toml deleted file mode 100644 index 3b422d4f..00000000 --- a/2018/day16/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day16" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -itertools = "*" -rustc-hash = "*" - -[[bin]] -name = "day16" -path = "day16.rs" diff --git a/2018/day17/Cargo.toml b/2018/day17/Cargo.toml deleted file mode 100644 index 770e2f00..00000000 --- a/2018/day17/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day17" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -nom = "*" -rustc-hash = "*" - -[[bin]] -name = "day17" -path = "day17.rs" diff --git a/2018/day18/Cargo.toml b/2018/day18/Cargo.toml deleted file mode 100644 index b5aa9822..00000000 --- a/2018/day18/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day18" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day18" -path = "day18.rs" diff --git a/2018/day19/Cargo.toml b/2018/day19/Cargo.toml deleted file mode 100644 index 39989142..00000000 --- a/2018/day19/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day19" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day19" -path = "day19.rs" diff --git a/2018/day2/Cargo.toml b/2018/day2/Cargo.toml deleted file mode 100644 index 768b1e4b..00000000 --- a/2018/day2/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day2" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day2" -path = "day2.rs" diff --git a/2018/day20/Cargo.toml b/2018/day20/Cargo.toml deleted file mode 100644 index 7870325e..00000000 --- a/2018/day20/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day20" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day20" -path = "day20.rs" diff --git a/2018/day21/Cargo.toml b/2018/day21/Cargo.toml deleted file mode 100644 index a85a420a..00000000 --- a/2018/day21/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day21" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day21" -path = "day21.rs" diff --git a/2018/day22/Cargo.toml b/2018/day22/Cargo.toml deleted file mode 100644 index 046e465e..00000000 --- a/2018/day22/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day22" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day22" -path = "day22.rs" diff --git a/2018/day23/Cargo.toml b/2018/day23/Cargo.toml deleted file mode 100644 index 9f75d345..00000000 --- a/2018/day23/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day23" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - - -[[bin]] -name = "day23" -path = "day23.rs" diff --git a/2018/day23_z3/Cargo.toml b/2018/day23_z3/Cargo.toml deleted file mode 100644 index ee9f649e..00000000 --- a/2018/day23_z3/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day23_z3" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -z3 = "*" - -[[bin]] -name = "day23_z3" -path = "day23.rs" diff --git a/2018/day24/Cargo.toml b/2018/day24/Cargo.toml deleted file mode 100644 index eec9b882..00000000 --- a/2018/day24/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day24" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day24" -path = "day24.rs" diff --git a/2018/day25/Cargo.toml b/2018/day25/Cargo.toml deleted file mode 100644 index 2fd9f876..00000000 --- a/2018/day25/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day25" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustworkx-core = "*" - -[[bin]] -name = "day25" -path = "day25.rs" diff --git a/2018/day3/Cargo.toml b/2018/day3/Cargo.toml deleted file mode 100644 index 5ad3a759..00000000 --- a/2018/day3/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day3" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day3" -path = "day3.rs" diff --git a/2018/day4/Cargo.toml b/2018/day4/Cargo.toml deleted file mode 100644 index a83fc9cd..00000000 --- a/2018/day4/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day4" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day4" -path = "day4.rs" diff --git a/2018/day5/Cargo.toml b/2018/day5/Cargo.toml deleted file mode 100644 index 64854eb5..00000000 --- a/2018/day5/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day5" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day5" -path = "day5.rs" diff --git a/2018/day6/Cargo.toml b/2018/day6/Cargo.toml deleted file mode 100644 index 54bf4c71..00000000 --- a/2018/day6/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day6" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day6" -path = "day6.rs" diff --git a/2018/day7/Cargo.toml b/2018/day7/Cargo.toml deleted file mode 100644 index ed2e3f98..00000000 --- a/2018/day7/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day7" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day7" -path = "day7.rs" diff --git a/2018/day8/Cargo.toml b/2018/day8/Cargo.toml deleted file mode 100644 index 63ccc8ce..00000000 --- a/2018/day8/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day8" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day8" -path = "day8.rs" diff --git a/2018/day9/Cargo.toml b/2018/day9/Cargo.toml deleted file mode 100644 index 01a7aa09..00000000 --- a/2018/day9/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day9" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "2.1.0" - -[[bin]] -name = "day9" -path = "day9.rs" diff --git a/2018/day9_c/Cargo.toml b/2018/day9_c/Cargo.toml deleted file mode 100644 index c9125d2e..00000000 --- a/2018/day9_c/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day9_c" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[build-dependencies] -cc = "*" - -[[bin]] -name = "day9_c" -path = "day9.rs" diff --git a/2018/day9_c/build.rs b/2018/day9_c/build.rs deleted file mode 100644 index 95ac01c4..00000000 --- a/2018/day9_c/build.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn main() { - println!("cargo:rerun-if-changed=day9.c"); - - cc::Build::new().file("day9.c").compile("day9"); -} diff --git a/2019/Cargo.toml b/2019/Cargo.toml deleted file mode 100644 index b18a42bd..00000000 --- a/2019/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -# https://adventofcode.com/2019 - -[workspace] -members = ["day*", "intcode-rs"] -resolver = "2" diff --git a/2019/README.md b/2019/README.md deleted file mode 100644 index 4793b9fa..00000000 --- a/2019/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Advent of Code in Rust 🦀 - -![AoC2019](https://img.shields.io/badge/Advent_of_Code-2019-8A2BE2) -![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) -![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) -![Python: 23](https://img.shields.io/badge/Python-23-cyan?logo=Python) - -## 2019 ([Calendar](https://adventofcode.com/2019)) ([Solutions](../2019/)) : 50⭐ - -Puzzle | Stars | Languages --------------------------------------------------------------------------------- | ----- | ----------- -[Day 1: The Tyranny of the Rocket Equation](https://adventofcode.com/2019/day/1) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day1/day1.rs) [![Python](../scripts/assets/python.png)](../2019/day1/day1.py) -[Day 2: 1202 Program Alarm](https://adventofcode.com/2019/day/2) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day2/day2.rs) [![Python](../scripts/assets/python.png)](../2019/day2/day2.py) -[Day 3: Crossed Wires](https://adventofcode.com/2019/day/3) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day3/day3.rs) [![Python](../scripts/assets/python.png)](../2019/day3/day3.py) -[Day 4: Secure Container](https://adventofcode.com/2019/day/4) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day4/day4.rs) [![Python](../scripts/assets/python.png)](../2019/day4/day4.py) -[Day 5: Sunny with a Chance of Asteroids](https://adventofcode.com/2019/day/5) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day5/day5.rs) [![Python](../scripts/assets/python.png)](../2019/day5/day5.py) -[Day 6: Universal Orbit Map](https://adventofcode.com/2019/day/6) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day6/day6.rs) [![Python](../scripts/assets/python.png)](../2019/day6/day6.py) -[Day 7: Amplification Circuit](https://adventofcode.com/2019/day/7) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day7/day7.rs) [![Python](../scripts/assets/python.png)](../2019/day7/day7.py) -[Day 8: Space Image Format](https://adventofcode.com/2019/day/8) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day8/day8.rs) [![Python](../scripts/assets/python.png)](../2019/day8/day8.py) -[Day 9: Sensor Boost](https://adventofcode.com/2019/day/9) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day9/day9.rs) [![Python](../scripts/assets/python.png)](../2019/day9/day9.py) -[Day 10: Monitoring Station](https://adventofcode.com/2019/day/10) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day10/day10.rs) [![Python](../scripts/assets/python.png)](../2019/day10/day10.py) -[Day 11: Space Police](https://adventofcode.com/2019/day/11) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day11/day11.rs) [![Python](../scripts/assets/python.png)](../2019/day11/day11.py) -[Day 12: The N-Body Problem](https://adventofcode.com/2019/day/12) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day12/day12.rs) [![Python](../scripts/assets/python.png)](../2019/day12/day12.py) -[Day 13: Care Package](https://adventofcode.com/2019/day/13) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day13/day13.rs) [![Python](../scripts/assets/python.png)](../2019/day13/day13.py) [🎁](../2019/day13/README.md) -[Day 14: Space Stoichiometry](https://adventofcode.com/2019/day/14) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day14/day14.rs) [![Python](../scripts/assets/python.png)](../2019/day14/day14.py) -[Day 15: Oxygen System](https://adventofcode.com/2019/day/15) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day15/day15.rs) [![Python](../scripts/assets/python.png)](../2019/day15/day15.py) [🎁](../2019/day15/README.md) -[Day 16: Flawed Frequency Transmission](https://adventofcode.com/2019/day/16) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day16/day16.rs) [![Python](../scripts/assets/python.png)](../2019/day16/day16.py) [![C](../scripts/assets/c.png)](../2019/day16/day16.c) -[Day 17: Set and Forget](https://adventofcode.com/2019/day/17) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day17/day17.rs) [![Python](../scripts/assets/python.png)](../2019/day17/day17.py) -[Day 18: Many-Worlds Interpretation](https://adventofcode.com/2019/day/18) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day18/day18.rs) -[Day 19: Tractor Beam](https://adventofcode.com/2019/day/19) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day19/day19.rs) [![Python](../scripts/assets/python.png)](../2019/day19/day19.py) -[Day 20: Donut Maze](https://adventofcode.com/2019/day/20) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day20/day20.rs) [![Python](../scripts/assets/python.png)](../2019/day20/day20.py) -[Day 21: Springdroid Adventure](https://adventofcode.com/2019/day/21) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day21/day21.rs) [![Python](../scripts/assets/python.png)](../2019/day21/day21.py) -[Day 22: Slam Shuffle](https://adventofcode.com/2019/day/22) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day22/day22.rs) -[Day 23: Category Six](https://adventofcode.com/2019/day/23) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day23/day23.rs) [![Python](../scripts/assets/python.png)](../2019/day23/day23.py) -[Day 24: Planet of Discord](https://adventofcode.com/2019/day/24) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day24/day24.rs) [![Python](../scripts/assets/python.png)](../2019/day24/day24.py) -[Day 25: Cryostasis](https://adventofcode.com/2019/day/25) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2019/day25/day25.rs) [![Python](../scripts/assets/python.png)](../2019/day25/day25.py) diff --git a/2019/day1/Cargo.toml b/2019/day1/Cargo.toml deleted file mode 100644 index bbf40642..00000000 --- a/2019/day1/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day1" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day1" -path = "day1.rs" diff --git a/2019/day10/Cargo.toml b/2019/day10/Cargo.toml deleted file mode 100644 index adee8e9c..00000000 --- a/2019/day10/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day10" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day10" -path = "day10.rs" diff --git a/2019/day11/Cargo.toml b/2019/day11/Cargo.toml deleted file mode 100644 index ae41626d..00000000 --- a/2019/day11/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day11" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -intcode = { path = "../intcode-rs" } -rustc-hash = "*" - -[[bin]] -name = "day11" -path = "day11.rs" diff --git a/2019/day12/Cargo.toml b/2019/day12/Cargo.toml deleted file mode 100644 index 81b416b9..00000000 --- a/2019/day12/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day12" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day12" -path = "day12.rs" diff --git a/2019/day13/Cargo.toml b/2019/day13/Cargo.toml deleted file mode 100644 index a0ef1ffa..00000000 --- a/2019/day13/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day13" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -intcode = { path = "../intcode-rs" } - -[[bin]] -name = "day13" -path = "day13.rs" diff --git a/2019/day14/Cargo.toml b/2019/day14/Cargo.toml deleted file mode 100644 index abba6d6f..00000000 --- a/2019/day14/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day14" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day14" -path = "day14.rs" diff --git a/2019/day15/Cargo.toml b/2019/day15/Cargo.toml deleted file mode 100644 index 7baac4a5..00000000 --- a/2019/day15/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day15" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -intcode = { path = "../intcode-rs" } -rustc-hash = "*" - -[[bin]] -name = "day15" -path = "day15.rs" diff --git a/2019/day16/Cargo.toml b/2019/day16/Cargo.toml deleted file mode 100644 index 4f755eeb..00000000 --- a/2019/day16/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day16" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day16" -path = "day16.rs" diff --git a/2019/day17/Cargo.toml b/2019/day17/Cargo.toml deleted file mode 100644 index ff2f4162..00000000 --- a/2019/day17/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day17" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -intcode = { path = "../intcode-rs" } -rustc-hash = "*" - -[[bin]] -name = "day17" -path = "day17.rs" diff --git a/2019/day18/Cargo.toml b/2019/day18/Cargo.toml deleted file mode 100644 index b35dcc61..00000000 --- a/2019/day18/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day18" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day18" -path = "day18.rs" \ No newline at end of file diff --git a/2019/day19/Cargo.toml b/2019/day19/Cargo.toml deleted file mode 100644 index ee43e103..00000000 --- a/2019/day19/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day19" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -intcode = { path = "../intcode-rs" } - -[[bin]] -name = "day19" -path = "day19.rs" diff --git a/2019/day2/Cargo.toml b/2019/day2/Cargo.toml deleted file mode 100644 index 768b1e4b..00000000 --- a/2019/day2/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day2" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day2" -path = "day2.rs" diff --git a/2019/day20/Cargo.toml b/2019/day20/Cargo.toml deleted file mode 100644 index 7870325e..00000000 --- a/2019/day20/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day20" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day20" -path = "day20.rs" diff --git a/2019/day21/Cargo.toml b/2019/day21/Cargo.toml deleted file mode 100644 index 4360f764..00000000 --- a/2019/day21/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day21" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -intcode = { path = "../intcode-rs" } - -[[bin]] -name = "day21" -path = "day21.rs" diff --git a/2019/day22/Cargo.toml b/2019/day22/Cargo.toml deleted file mode 100644 index b16e4075..00000000 --- a/2019/day22/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day22" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day22" -path = "day22.rs" diff --git a/2019/day23/Cargo.toml b/2019/day23/Cargo.toml deleted file mode 100644 index 3d4d76de..00000000 --- a/2019/day23/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day23" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -intcode = { path = "../intcode-rs" } - -[[bin]] -name = "day23" -path = "day23.rs" diff --git a/2019/day24/Cargo.toml b/2019/day24/Cargo.toml deleted file mode 100644 index 9802ce8d..00000000 --- a/2019/day24/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day24" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day24" -path = "day24.rs" diff --git a/2019/day25/Cargo.toml b/2019/day25/Cargo.toml deleted file mode 100644 index 03e2563f..00000000 --- a/2019/day25/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day25" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -intcode = { path = "../intcode-rs" } -regex = "*" - -[[bin]] -name = "day25" -path = "day25.rs" diff --git a/2019/day3/Cargo.toml b/2019/day3/Cargo.toml deleted file mode 100644 index 4f561a74..00000000 --- a/2019/day3/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day3" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day3" -path = "day3.rs" diff --git a/2019/day4/Cargo.toml b/2019/day4/Cargo.toml deleted file mode 100644 index a83fc9cd..00000000 --- a/2019/day4/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day4" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day4" -path = "day4.rs" diff --git a/2019/day5/Cargo.toml b/2019/day5/Cargo.toml deleted file mode 100644 index b7d348ec..00000000 --- a/2019/day5/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day5" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -intcode = { path = "../intcode-rs" } - -[[bin]] -name = "day5" -path = "day5.rs" diff --git a/2019/day6/Cargo.toml b/2019/day6/Cargo.toml deleted file mode 100644 index 54bf4c71..00000000 --- a/2019/day6/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day6" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day6" -path = "day6.rs" diff --git a/2019/day7/Cargo.toml b/2019/day7/Cargo.toml deleted file mode 100644 index effb5a3b..00000000 --- a/2019/day7/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day7" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -intcode = { path = "../intcode-rs" } -itertools = "*" - -[[bin]] -name = "day7" -path = "day7.rs" diff --git a/2019/day8/Cargo.toml b/2019/day8/Cargo.toml deleted file mode 100644 index 63ccc8ce..00000000 --- a/2019/day8/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day8" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day8" -path = "day8.rs" diff --git a/2019/day9/Cargo.toml b/2019/day9/Cargo.toml deleted file mode 100644 index 24ea4303..00000000 --- a/2019/day9/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day9" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -intcode = { path = "../intcode-rs" } - -[[bin]] -name = "day9" -path = "day9.rs" diff --git a/2019/ocr/ocr.py b/2019/ocr/ocr.py deleted file mode 120000 index f908f680..00000000 --- a/2019/ocr/ocr.py +++ /dev/null @@ -1 +0,0 @@ -../../2022/ocr/ocr.py \ No newline at end of file diff --git a/2020/Cargo.toml b/2020/Cargo.toml deleted file mode 100644 index 1fcf6591..00000000 --- a/2020/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -# https://adventofcode.com/2020 - -[workspace] -members = ["day*"] -resolver = "2" diff --git a/2020/README.md b/2020/README.md deleted file mode 100644 index d927b886..00000000 --- a/2020/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Advent of Code in Rust 🦀 - -![AoC2020](https://img.shields.io/badge/Advent_of_Code-2020-8A2BE2) -![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) -![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) -![Python: 23](https://img.shields.io/badge/Python-23-cyan?logo=Python) - -## 2020 ([Calendar](https://adventofcode.com/2020)) ([Solutions](../2020/)) : 50⭐ - -Puzzle | Stars | Languages ------------------------------------------------------------------------ | ----- | ----------- -[Day 1: Report Repair](https://adventofcode.com/2020/day/1) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day1/day1.rs) [![Python](../scripts/assets/python.png)](../2020/day1/day1.py) -[Day 2: Password Philosophy](https://adventofcode.com/2020/day/2) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day2/day2.rs) [![Python](../scripts/assets/python.png)](../2020/day2/day2.py) -[Day 3: Toboggan Trajectory](https://adventofcode.com/2020/day/3) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day3/day3.rs) [![Python](../scripts/assets/python.png)](../2020/day3/day3.py) -[Day 4: Passport Processing](https://adventofcode.com/2020/day/4) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day4/day4.rs) [![Python](../scripts/assets/python.png)](../2020/day4/day4.py) -[Day 5: Binary Boarding](https://adventofcode.com/2020/day/5) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day5/day5.rs) [![Python](../scripts/assets/python.png)](../2020/day5/day5.py) -[Day 6: Custom Customs](https://adventofcode.com/2020/day/6) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day6/day6.rs) [![Python](../scripts/assets/python.png)](../2020/day6/day6.py) -[Day 7: Handy Haversacks](https://adventofcode.com/2020/day/7) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day7/day7.rs) [![Python](../scripts/assets/python.png)](../2020/day7/day7.py) -[Day 8: Handheld Halting](https://adventofcode.com/2020/day/8) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day8/day8.rs) [![Python](../scripts/assets/python.png)](../2020/day8/day8.py) -[Day 9: Encoding Error](https://adventofcode.com/2020/day/9) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day9/day9.rs) [![Python](../scripts/assets/python.png)](../2020/day9/day9.py) -[Day 10: Adapter Array](https://adventofcode.com/2020/day/10) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day10/day10.rs) [![Python](../scripts/assets/python.png)](../2020/day10/day10.py) -[Day 11: Seating System](https://adventofcode.com/2020/day/11) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day11/day11.rs) [![Python](../scripts/assets/python.png)](../2020/day11/day11.py) -[Day 12: Rain Risk](https://adventofcode.com/2020/day/12) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day12/day12.rs) [![Python](../scripts/assets/python.png)](../2020/day12/day12.py) -[Day 13: Shuttle Search](https://adventofcode.com/2020/day/13) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day13/day13.rs) [![Python](../scripts/assets/python.png)](../2020/day13/day13.py) -[Day 14: Docking Data](https://adventofcode.com/2020/day/14) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day14/day14.rs) [![Python](../scripts/assets/python.png)](../2020/day14/day14.py) -[Day 15: Rambunctious Recitation](https://adventofcode.com/2020/day/15) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day15/day15.rs) [![Python](../scripts/assets/python.png)](../2020/day15/day15.py) -[Day 16: Ticket Translation](https://adventofcode.com/2020/day/16) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day16/day16.rs) [![Python](../scripts/assets/python.png)](../2020/day16/day16.py) -[Day 17: Conway Cubes](https://adventofcode.com/2020/day/17) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day17/day17.rs) [![Python](../scripts/assets/python.png)](../2020/day17/day17.py) -[Day 18: Operation Order](https://adventofcode.com/2020/day/18) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day18/day18.rs) [![Python](../scripts/assets/python.png)](../2020/day18/day18.py) -[Day 19: Monster Messages](https://adventofcode.com/2020/day/19) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day19/day19.rs) -[Day 20: Jurassic Jigsaw](https://adventofcode.com/2020/day/20) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day20/day20.rs) [![Python](../scripts/assets/python.png)](../2020/day20/day20.py) -[Day 21: Allergen Assessment](https://adventofcode.com/2020/day/21) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day21/day21.rs) [![Python](../scripts/assets/python.png)](../2020/day21/day21.py) -[Day 22: Crab Combat](https://adventofcode.com/2020/day/22) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day22/day22.rs) [![Python](../scripts/assets/python.png)](../2020/day22/day22.py) -[Day 23: Crab Cups](https://adventofcode.com/2020/day/23) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day23/day23.rs) -[Day 24: Lobby Layout](https://adventofcode.com/2020/day/24) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day24/day24.rs) [![Python](../scripts/assets/python.png)](../2020/day24/day24.py) -[Day 25: Combo Breaker](https://adventofcode.com/2020/day/25) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2020/day25/day25.rs) [![Python](../scripts/assets/python.png)](../2020/day25/day25.py) diff --git a/2020/day1/Cargo.toml b/2020/day1/Cargo.toml deleted file mode 100644 index d907473c..00000000 --- a/2020/day1/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day1" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day1" -path = "day1.rs" diff --git a/2020/day10/Cargo.toml b/2020/day10/Cargo.toml deleted file mode 100644 index adee8e9c..00000000 --- a/2020/day10/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day10" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day10" -path = "day10.rs" diff --git a/2020/day11/Cargo.toml b/2020/day11/Cargo.toml deleted file mode 100644 index 4230f46e..00000000 --- a/2020/day11/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day11" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day11" -path = "day11.rs" diff --git a/2020/day12/Cargo.toml b/2020/day12/Cargo.toml deleted file mode 100644 index ee7e2717..00000000 --- a/2020/day12/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day12" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day12" -path = "day12.rs" diff --git a/2020/day13/Cargo.toml b/2020/day13/Cargo.toml deleted file mode 100644 index 017a743d..00000000 --- a/2020/day13/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day13" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day13" -path = "day13.rs" diff --git a/2020/day14/Cargo.toml b/2020/day14/Cargo.toml deleted file mode 100644 index abba6d6f..00000000 --- a/2020/day14/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day14" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day14" -path = "day14.rs" diff --git a/2020/day15/Cargo.toml b/2020/day15/Cargo.toml deleted file mode 100644 index 0cbdff01..00000000 --- a/2020/day15/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day15" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day15" -path = "day15.rs" diff --git a/2020/day16/Cargo.toml b/2020/day16/Cargo.toml deleted file mode 100644 index cc47be34..00000000 --- a/2020/day16/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day16" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day16" -path = "day16.rs" diff --git a/2020/day17/Cargo.toml b/2020/day17/Cargo.toml deleted file mode 100644 index 1f55d0ae..00000000 --- a/2020/day17/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day17" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day17" -path = "day17.rs" diff --git a/2020/day18/Cargo.toml b/2020/day18/Cargo.toml deleted file mode 100644 index 86a98d20..00000000 --- a/2020/day18/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day18" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day18" -path = "day18.rs" diff --git a/2020/day19/Cargo.toml b/2020/day19/Cargo.toml deleted file mode 100644 index c46af131..00000000 --- a/2020/day19/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day19" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day19" -path = "day19.rs" diff --git a/2020/day2/Cargo.toml b/2020/day2/Cargo.toml deleted file mode 100644 index 768b1e4b..00000000 --- a/2020/day2/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day2" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day2" -path = "day2.rs" diff --git a/2020/day20/Cargo.toml b/2020/day20/Cargo.toml deleted file mode 100644 index 7870325e..00000000 --- a/2020/day20/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day20" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day20" -path = "day20.rs" diff --git a/2020/day21/Cargo.toml b/2020/day21/Cargo.toml deleted file mode 100644 index a85a420a..00000000 --- a/2020/day21/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day21" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day21" -path = "day21.rs" diff --git a/2020/day22/Cargo.toml b/2020/day22/Cargo.toml deleted file mode 100644 index 046e465e..00000000 --- a/2020/day22/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day22" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day22" -path = "day22.rs" diff --git a/2020/day23/Cargo.toml b/2020/day23/Cargo.toml deleted file mode 100644 index 8a51b172..00000000 --- a/2020/day23/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day23" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day23" -path = "day23.rs" diff --git a/2020/day24/Cargo.toml b/2020/day24/Cargo.toml deleted file mode 100644 index 9802ce8d..00000000 --- a/2020/day24/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day24" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day24" -path = "day24.rs" diff --git a/2020/day25/Cargo.toml b/2020/day25/Cargo.toml deleted file mode 100644 index 7275a50e..00000000 --- a/2020/day25/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day25" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day25" -path = "day25.rs" diff --git a/2020/day3/Cargo.toml b/2020/day3/Cargo.toml deleted file mode 100644 index 985edff0..00000000 --- a/2020/day3/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day3" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day3" -path = "day3.rs" diff --git a/2020/day4/Cargo.toml b/2020/day4/Cargo.toml deleted file mode 100644 index a83fc9cd..00000000 --- a/2020/day4/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day4" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day4" -path = "day4.rs" diff --git a/2020/day5/Cargo.toml b/2020/day5/Cargo.toml deleted file mode 100644 index 64854eb5..00000000 --- a/2020/day5/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day5" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day5" -path = "day5.rs" diff --git a/2020/day6/Cargo.toml b/2020/day6/Cargo.toml deleted file mode 100644 index 54bf4c71..00000000 --- a/2020/day6/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day6" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day6" -path = "day6.rs" diff --git a/2020/day7/Cargo.toml b/2020/day7/Cargo.toml deleted file mode 100644 index f1450864..00000000 --- a/2020/day7/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day7" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day7" -path = "day7.rs" diff --git a/2020/day8/Cargo.toml b/2020/day8/Cargo.toml deleted file mode 100644 index 27274c34..00000000 --- a/2020/day8/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day8" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day8" -path = "day8.rs" diff --git a/2020/day9/Cargo.toml b/2020/day9/Cargo.toml deleted file mode 100644 index 4c086fa8..00000000 --- a/2020/day9/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day9" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day9" -path = "day9.rs" diff --git a/2021/Cargo.toml b/2021/Cargo.toml deleted file mode 100644 index a18509ba..00000000 --- a/2021/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -# https://adventofcode.com/2021 - -[workspace] -members = ["day*"] -resolver = "2" diff --git a/2021/README.md b/2021/README.md deleted file mode 100644 index 20af5248..00000000 --- a/2021/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Advent of Code in Rust 🦀 - -![AoC2021](https://img.shields.io/badge/Advent_of_Code-2021-8A2BE2) -![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) -![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) -![Python: 13](https://img.shields.io/badge/Python-13-cyan?logo=Python) - -## 2021 ([Calendar](https://adventofcode.com/2021)) ([Solutions](../2021/)) : 50⭐ - -Puzzle | Stars | Languages ------------------------------------------------------------------------ | ----- | ----------- -[Day 1: Sonar Sweep](https://adventofcode.com/2021/day/1) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day1/day1.rs) [![Python](../scripts/assets/python.png)](../2021/day1/day1.py) -[Day 2: Dive!](https://adventofcode.com/2021/day/2) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day2/day2.rs) -[Day 3: Binary Diagnostic](https://adventofcode.com/2021/day/3) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day3/day3.rs) -[Day 4: Giant Squid](https://adventofcode.com/2021/day/4) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day4/day4.rs) [![Python](../scripts/assets/python.png)](../2021/day4/day4_bug.py) -[Day 5: Hydrothermal Venture](https://adventofcode.com/2021/day/5) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day5/day5.rs) [![Python](../scripts/assets/python.png)](../2021/day5/day5.py) -[Day 6: Lanternfish](https://adventofcode.com/2021/day/6) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day6/day6.rs) [![Python](../scripts/assets/python.png)](../2021/day6/day6.py) -[Day 7: The Treachery of Whales](https://adventofcode.com/2021/day/7) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day7/day7.rs) -[Day 8: Seven Segment Search](https://adventofcode.com/2021/day/8) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day8/day8.rs) [![Python](../scripts/assets/python.png)](../2021/day8/day8.py) -[Day 9: Smoke Basin](https://adventofcode.com/2021/day/9) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day9/day9.rs) [![Python](../scripts/assets/python.png)](../2021/day9/day9.py) -[Day 10: Syntax Scoring](https://adventofcode.com/2021/day/10) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day10/day10.rs) [![Python](../scripts/assets/python.png)](../2021/day10/day10.py) -[Day 11: Dumbo Octopus](https://adventofcode.com/2021/day/11) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day11/day11.rs) -[Day 12: Passage Pathing](https://adventofcode.com/2021/day/12) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day12/day12.rs) [![Python](../scripts/assets/python.png)](../2021/day12/day12.py) -[Day 13: Transparent Origami](https://adventofcode.com/2021/day/13) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day13/day13.rs) [![Python](../scripts/assets/python.png)](../2021/day13/day13.py) -[Day 14: Extended Polymerization](https://adventofcode.com/2021/day/14) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day14/day14.rs) -[Day 15: Chiton](https://adventofcode.com/2021/day/15) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day15/day15.rs) -[Day 16: Packet Decoder](https://adventofcode.com/2021/day/16) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day16/day16.rs) [![Python](../scripts/assets/python.png)](../2021/day16/day16.py) -[Day 17: Trick Shot](https://adventofcode.com/2021/day/17) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day17/day17.rs) -[Day 18: Snailfish](https://adventofcode.com/2021/day/18) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day18/day18.rs) [![Python](../scripts/assets/python.png)](../2021/day18/day18_eval.py) [![Python](../scripts/assets/python.png)](../2021/day18/day18.py) -[Day 19: Beacon Scanner](https://adventofcode.com/2021/day/19) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day19/day19.rs) -[Day 20: Trench Map](https://adventofcode.com/2021/day/20) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day20/day20.rs) -[Day 21: Dirac Dice](https://adventofcode.com/2021/day/21) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day21/day21.rs) -[Day 22: Reactor Reboot](https://adventofcode.com/2021/day/22) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day22/day22.rs) -[Day 23: Amphipod](https://adventofcode.com/2021/day/23) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day23/day23.rs) -[Day 24: Arithmetic Logic Unit](https://adventofcode.com/2021/day/24) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day24/day24.rs) -[Day 25: Sea Cucumber](https://adventofcode.com/2021/day/25) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2021/day25/day25.rs) [![Python](../scripts/assets/python.png)](../2021/day25/day25.py) diff --git a/2021/day1/Cargo.toml b/2021/day1/Cargo.toml deleted file mode 100644 index 8d833bf3..00000000 --- a/2021/day1/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day1" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day1" -path = "day1.rs" diff --git a/2021/day10/Cargo.toml b/2021/day10/Cargo.toml deleted file mode 100644 index 435928e0..00000000 --- a/2021/day10/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day10" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day10" -path = "day10.rs" diff --git a/2021/day11/Cargo.toml b/2021/day11/Cargo.toml deleted file mode 100644 index 6f7b3801..00000000 --- a/2021/day11/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day11" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day11" -path = "day11.rs" diff --git a/2021/day12/Cargo.toml b/2021/day12/Cargo.toml deleted file mode 100644 index acd35751..00000000 --- a/2021/day12/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day12" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day12" -path = "day12.rs" diff --git a/2021/day13/Cargo.toml b/2021/day13/Cargo.toml deleted file mode 100644 index 017a743d..00000000 --- a/2021/day13/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day13" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day13" -path = "day13.rs" diff --git a/2021/day14/Cargo.toml b/2021/day14/Cargo.toml deleted file mode 100644 index abba6d6f..00000000 --- a/2021/day14/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day14" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day14" -path = "day14.rs" diff --git a/2021/day15/Cargo.toml b/2021/day15/Cargo.toml deleted file mode 100644 index 0112912b..00000000 --- a/2021/day15/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day15" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day15" -path = "day15.rs" diff --git a/2021/day16/Cargo.toml b/2021/day16/Cargo.toml deleted file mode 100644 index 4f755eeb..00000000 --- a/2021/day16/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day16" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day16" -path = "day16.rs" diff --git a/2021/day17/Cargo.toml b/2021/day17/Cargo.toml deleted file mode 100644 index f32e4217..00000000 --- a/2021/day17/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day17" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } -text_io = "*" - -[[bin]] -name = "day17" -path = "day17.rs" diff --git a/2021/day18/Cargo.toml b/2021/day18/Cargo.toml deleted file mode 100644 index a0ebc2c1..00000000 --- a/2021/day18/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day18" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -itertools = "*" - -[[bin]] -name = "day18" -path = "day18.rs" diff --git a/2021/day19/Cargo.toml b/2021/day19/Cargo.toml deleted file mode 100644 index e265a699..00000000 --- a/2021/day19/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day19" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" -scan_fmt = "*" - -[[bin]] -name = "day19" -path = "day19.rs" diff --git a/2021/day2/Cargo.toml b/2021/day2/Cargo.toml deleted file mode 100644 index eb906174..00000000 --- a/2021/day2/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day2" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day2" -path = "day2.rs" diff --git a/2021/day20/Cargo.toml b/2021/day20/Cargo.toml deleted file mode 100644 index 613f3064..00000000 --- a/2021/day20/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day20" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day20" -path = "day20.rs" diff --git a/2021/day21/Cargo.toml b/2021/day21/Cargo.toml deleted file mode 100644 index a85a420a..00000000 --- a/2021/day21/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day21" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day21" -path = "day21.rs" diff --git a/2021/day22/Cargo.toml b/2021/day22/Cargo.toml deleted file mode 100644 index 0b7b488e..00000000 --- a/2021/day22/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day22" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day22" -path = "day22.rs" diff --git a/2021/day23/Cargo.toml b/2021/day23/Cargo.toml deleted file mode 100644 index a8ac5bf9..00000000 --- a/2021/day23/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day23" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day23" -path = "day23.rs" diff --git a/2021/day24/Cargo.toml b/2021/day24/Cargo.toml deleted file mode 100644 index 5f93b1bf..00000000 --- a/2021/day24/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day24" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rand = "*" - -[[bin]] -name = "day24" -path = "day24.rs" diff --git a/2021/day25/Cargo.toml b/2021/day25/Cargo.toml deleted file mode 100644 index 9fd6995b..00000000 --- a/2021/day25/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day25" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day25" -path = "day25.rs" diff --git a/2021/day3/Cargo.toml b/2021/day3/Cargo.toml deleted file mode 100644 index a6c3509d..00000000 --- a/2021/day3/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day3" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day3" -path = "day3.rs" diff --git a/2021/day4/Cargo.toml b/2021/day4/Cargo.toml deleted file mode 100644 index 9de3563a..00000000 --- a/2021/day4/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day4" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day4" -path = "day4.rs" diff --git a/2021/day5/Cargo.toml b/2021/day5/Cargo.toml deleted file mode 100644 index 4b4f594a..00000000 --- a/2021/day5/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day5" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day5" -path = "day5.rs" diff --git a/2021/day6/Cargo.toml b/2021/day6/Cargo.toml deleted file mode 100644 index 0c1a3cb7..00000000 --- a/2021/day6/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day6" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day6" -path = "day6.rs" diff --git a/2021/day7/Cargo.toml b/2021/day7/Cargo.toml deleted file mode 100644 index 0efe2d44..00000000 --- a/2021/day7/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day7" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day7" -path = "day7.rs" diff --git a/2021/day8/Cargo.toml b/2021/day8/Cargo.toml deleted file mode 100644 index 27274c34..00000000 --- a/2021/day8/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day8" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day8" -path = "day8.rs" diff --git a/2021/day9/Cargo.toml b/2021/day9/Cargo.toml deleted file mode 100644 index 4c086fa8..00000000 --- a/2021/day9/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day9" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day9" -path = "day9.rs" diff --git a/2021/ocr/ocr.py b/2021/ocr/ocr.py deleted file mode 120000 index f908f680..00000000 --- a/2021/ocr/ocr.py +++ /dev/null @@ -1 +0,0 @@ -../../2022/ocr/ocr.py \ No newline at end of file diff --git a/2022/Cargo.toml b/2022/Cargo.toml deleted file mode 100644 index 3237f3e7..00000000 --- a/2022/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -# https://adventofcode.com/2022 - -[workspace] -members = ["day*"] -resolver = "2" diff --git a/2022/README.md b/2022/README.md deleted file mode 100644 index d4cefd57..00000000 --- a/2022/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Advent of Code in Rust 🦀 - -![AoC2022](https://img.shields.io/badge/Advent_of_Code-2022-8A2BE2) -![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) -![Rust: 26](https://img.shields.io/badge/Rust-26-cyan?logo=Rust) -![Python: 19](https://img.shields.io/badge/Python-19-cyan?logo=Python) - -## 2022 ([Calendar](https://adventofcode.com/2022)) ([Solutions](../2022/)) : 50⭐ - -Puzzle | Stars | Languages ------------------------------------------------------------------------- | ----- | ----------- -[Day 1: Calorie Counting](https://adventofcode.com/2022/day/1) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day1/day1.rs) [![Python](../scripts/assets/python.png)](../2022/day1/day1_oneliner.py) [![Python](../scripts/assets/python.png)](../2022/day1/day1.py) -[Day 2: Rock Paper Scissors](https://adventofcode.com/2022/day/2) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day2/day2.rs) [![Python](../scripts/assets/python.png)](../2022/day2/day2.py) -[Day 3: Rucksack Reorganization](https://adventofcode.com/2022/day/3) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day3/day3.rs) [![Python](../scripts/assets/python.png)](../2022/day3/day3.py) [![C](../scripts/assets/c.png)](../2022/day3/day3.c) -[Day 4: Camp Cleanup](https://adventofcode.com/2022/day/4) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day4/day4.rs) [![Python](../scripts/assets/python.png)](../2022/day4/day4.py) -[Day 5: Supply Stacks](https://adventofcode.com/2022/day/5) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day5/day5.rs) [![Python](../scripts/assets/python.png)](../2022/day5/day5.py) -[Day 6: Tuning Trouble](https://adventofcode.com/2022/day/6) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day6/day6.rs) [![Python](../scripts/assets/python.png)](../2022/day6/day6.py) -[Day 7: No Space Left On Device](https://adventofcode.com/2022/day/7) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day7/day7.rs) [![Python](../scripts/assets/python.png)](../2022/day7/day7.py) -[Day 8: Treetop Tree House](https://adventofcode.com/2022/day/8) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day8/day8.rs) [![Python](../scripts/assets/python.png)](../2022/day8/day8.py) -[Day 9: Rope Bridge](https://adventofcode.com/2022/day/9) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day9/day9.rs) [![Python](../scripts/assets/python.png)](../2022/day9/day9.py) -[Day 10: Cathode-Ray Tube](https://adventofcode.com/2022/day/10) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day10/day10.rs) [![Python](../scripts/assets/python.png)](../2022/day10/day10.py) -[Day 11: Monkey in the Middle](https://adventofcode.com/2022/day/11) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day11/day11.rs) [![Python](../scripts/assets/python.png)](../2022/day11/day11.py) [![C++](../scripts/assets/cpp.png)](../2022/day11/day11.cpp) -[Day 12: Hill Climbing Algorithm](https://adventofcode.com/2022/day/12) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day12/day12.rs) [![Python](../scripts/assets/python.png)](../2022/day12/day12.py) -[Day 13: Distress Signal](https://adventofcode.com/2022/day/13) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day13/day13.rs) [![Rust](../scripts/assets/rust.png)](../2022/day13_pest/day13.rs) [![Python](../scripts/assets/python.png)](../2022/day13_pest/day13.py) -[Day 14: Regolith Reservoir](https://adventofcode.com/2022/day/14) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day14/day14.rs) [![Python](../scripts/assets/python.png)](../2022/day14/day14.py) -[Day 15: Beacon Exclusion Zone](https://adventofcode.com/2022/day/15) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day15/day15.rs) [![Python](../scripts/assets/python.png)](../2022/day15/day15.py) -[Day 16: Proboscidea Volcanium](https://adventofcode.com/2022/day/16) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day16/day16.rs) -[Day 17: Pyroclastic Flow](https://adventofcode.com/2022/day/17) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day17/day17.rs) [![Python](../scripts/assets/python.png)](../2022/day17/day17.py) [🎁](../2022/day17/README.md) -[Day 18: Boiling Boulders](https://adventofcode.com/2022/day/18) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day18/day18.rs) -[Day 19: Not Enough Minerals](https://adventofcode.com/2022/day/19) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day19/day19.rs) -[Day 20: Grove Positioning System](https://adventofcode.com/2022/day/20) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day20/day20.rs) -[Day 21: Monkey Math](https://adventofcode.com/2022/day/21) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day21/day21.rs) [![Python](../scripts/assets/python.png)](../2022/day21/day21.py) -[Day 22: Monkey Map](https://adventofcode.com/2022/day/22) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day22/day22.rs) -[Day 23: Unstable Diffusion](https://adventofcode.com/2022/day/23) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day23/day23.rs) -[Day 24: Blizzard Basin](https://adventofcode.com/2022/day/24) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day24/day24.rs) -[Day 25: Full of Hot Air](https://adventofcode.com/2022/day/25) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2022/day25/day25.rs) [![Python](../scripts/assets/python.png)](../2022/day25/day25.py) diff --git a/2022/day1/Cargo.toml b/2022/day1/Cargo.toml deleted file mode 100644 index 8d833bf3..00000000 --- a/2022/day1/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day1" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day1" -path = "day1.rs" diff --git a/2022/day10/Cargo.toml b/2022/day10/Cargo.toml deleted file mode 100644 index 0c6b79d5..00000000 --- a/2022/day10/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day10" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day10" -path = "day10.rs" diff --git a/2022/day11/Cargo.toml b/2022/day11/Cargo.toml deleted file mode 100644 index 6f7b3801..00000000 --- a/2022/day11/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day11" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day11" -path = "day11.rs" diff --git a/2022/day12/Cargo.toml b/2022/day12/Cargo.toml deleted file mode 100644 index 8be331ad..00000000 --- a/2022/day12/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day12" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day12" -path = "day12.rs" diff --git a/2022/day13/Cargo.toml b/2022/day13/Cargo.toml deleted file mode 100644 index 214659de..00000000 --- a/2022/day13/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day13" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -nom = "*" - -[[bin]] -name = "day13" -path = "day13.rs" diff --git a/2022/day13_pest/Cargo.toml b/2022/day13_pest/Cargo.toml deleted file mode 100644 index 68c43381..00000000 --- a/2022/day13_pest/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day13_pest" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -pest = "*" -pest_derive = "*" - -[[bin]] -name = "day13_pest" -path = "day13.rs" diff --git a/2022/day14/Cargo.toml b/2022/day14/Cargo.toml deleted file mode 100644 index abba6d6f..00000000 --- a/2022/day14/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day14" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day14" -path = "day14.rs" diff --git a/2022/day15/Cargo.toml b/2022/day15/Cargo.toml deleted file mode 100644 index b534bcd8..00000000 --- a/2022/day15/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day15" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day15" -path = "day15.rs" diff --git a/2022/day16/Cargo.toml b/2022/day16/Cargo.toml deleted file mode 100644 index cc47be34..00000000 --- a/2022/day16/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day16" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day16" -path = "day16.rs" diff --git a/2022/day17/Cargo.toml b/2022/day17/Cargo.toml deleted file mode 100644 index 17cc3676..00000000 --- a/2022/day17/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day17" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day17" -path = "day17.rs" diff --git a/2022/day18/Cargo.toml b/2022/day18/Cargo.toml deleted file mode 100644 index b5aa9822..00000000 --- a/2022/day18/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day18" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day18" -path = "day18.rs" diff --git a/2022/day19/Cargo.toml b/2022/day19/Cargo.toml deleted file mode 100644 index fc447add..00000000 --- a/2022/day19/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day19" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day19" -path = "day19.rs" diff --git a/2022/day2/Cargo.toml b/2022/day2/Cargo.toml deleted file mode 100644 index eb906174..00000000 --- a/2022/day2/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day2" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day2" -path = "day2.rs" diff --git a/2022/day20/Cargo.toml b/2022/day20/Cargo.toml deleted file mode 100644 index 613f3064..00000000 --- a/2022/day20/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day20" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day20" -path = "day20.rs" diff --git a/2022/day21/Cargo.toml b/2022/day21/Cargo.toml deleted file mode 100644 index 217378ac..00000000 --- a/2022/day21/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day21" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -fraction = "*" -num = "*" -rustc-hash = "*" - -[[bin]] -name = "day21" -path = "day21.rs" diff --git a/2022/day22/Cargo.toml b/2022/day22/Cargo.toml deleted file mode 100644 index 84490cac..00000000 --- a/2022/day22/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day22" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day22" -path = "day22.rs" diff --git a/2022/day23/Cargo.toml b/2022/day23/Cargo.toml deleted file mode 100644 index a8ac5bf9..00000000 --- a/2022/day23/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day23" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day23" -path = "day23.rs" diff --git a/2022/day24/Cargo.toml b/2022/day24/Cargo.toml deleted file mode 100644 index 9802ce8d..00000000 --- a/2022/day24/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day24" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day24" -path = "day24.rs" diff --git a/2022/day25/Cargo.toml b/2022/day25/Cargo.toml deleted file mode 100644 index 9fd6995b..00000000 --- a/2022/day25/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day25" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day25" -path = "day25.rs" diff --git a/2022/day3/Cargo.toml b/2022/day3/Cargo.toml deleted file mode 100644 index a6c3509d..00000000 --- a/2022/day3/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day3" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day3" -path = "day3.rs" diff --git a/2022/day4/Cargo.toml b/2022/day4/Cargo.toml deleted file mode 100644 index 20cc1b6d..00000000 --- a/2022/day4/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day4" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day4" -path = "day4.rs" diff --git a/2022/day5/Cargo.toml b/2022/day5/Cargo.toml deleted file mode 100644 index f7603d61..00000000 --- a/2022/day5/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day5" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day5" -path = "day5.rs" diff --git a/2022/day6/Cargo.toml b/2022/day6/Cargo.toml deleted file mode 100644 index 54bf4c71..00000000 --- a/2022/day6/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day6" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day6" -path = "day6.rs" diff --git a/2022/day7/Cargo.toml b/2022/day7/Cargo.toml deleted file mode 100644 index ed2e3f98..00000000 --- a/2022/day7/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day7" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day7" -path = "day7.rs" diff --git a/2022/day8/Cargo.toml b/2022/day8/Cargo.toml deleted file mode 100644 index 63ccc8ce..00000000 --- a/2022/day8/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day8" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day8" -path = "day8.rs" diff --git a/2022/day9/Cargo.toml b/2022/day9/Cargo.toml deleted file mode 100644 index 94d4993b..00000000 --- a/2022/day9/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day9" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day9" -path = "day9.rs" diff --git a/2023/Cargo.toml b/2023/Cargo.toml deleted file mode 100644 index 1b18b227..00000000 --- a/2023/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -# https://adventofcode.com/2023 - -[workspace] -members = ["day*"] -resolver = "2" diff --git a/2023/README.md b/2023/README.md deleted file mode 100644 index be23d232..00000000 --- a/2023/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Advent of Code in Rust 🦀 - -![AoC2023](https://img.shields.io/badge/Advent_of_Code-2023-8A2BE2) -![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) -![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) -![Python: 11](https://img.shields.io/badge/Python-11-cyan?logo=Python) - -## 2023 ([Calendar](https://adventofcode.com/2023)) ([Solutions](../2023/)) : 50⭐ - -Puzzle | Stars | Languages ------------------------------------------------------------------------------ | ----- | ----------- -[Day 1: Trebuchet?!](https://adventofcode.com/2023/day/1) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day1/day1.rs) [![Python](../scripts/assets/python.png)](../2023/day1/day1.py) -[Day 2: Cube Conundrum](https://adventofcode.com/2023/day/2) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day2/day2.rs) [![Python](../scripts/assets/python.png)](../2023/day2/day2.py) -[Day 3: Gear Ratios](https://adventofcode.com/2023/day/3) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day3/day3.rs) [![Python](../scripts/assets/python.png)](../2023/day3/day3.py) -[Day 4: Scratchcards](https://adventofcode.com/2023/day/4) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day4/day4.rs) [![Python](../scripts/assets/python.png)](../2023/day4/day4.py) -[Day 5: If You Give A Seed A Fertilizer](https://adventofcode.com/2023/day/5) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day5/day5.rs) [![Python](../scripts/assets/python.png)](../2023/day5/day5_bruteforce.py) -[Day 6: Wait For It](https://adventofcode.com/2023/day/6) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day6/day6.rs) [![Python](../scripts/assets/python.png)](../2023/day6/day6.py) -[Day 7: Camel Cards](https://adventofcode.com/2023/day/7) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day7/day7.rs) -[Day 8: Haunted Wasteland](https://adventofcode.com/2023/day/8) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day8/day8.rs) -[Day 9: Mirage Maintenance](https://adventofcode.com/2023/day/9) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day9/day9.rs) [![Python](../scripts/assets/python.png)](../2023/day9/day9.py) -[Day 10: Pipe Maze](https://adventofcode.com/2023/day/10) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day10/day10.rs) [![Python](../scripts/assets/python.png)](../2023/day10/day10.py) [🎁](../2023/day10/README.md) -[Day 11: Cosmic Expansion](https://adventofcode.com/2023/day/11) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day11/day11.rs) -[Day 12: Hot Springs](https://adventofcode.com/2023/day/12) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day12/day12.rs) -[Day 13: Point of Incidence](https://adventofcode.com/2023/day/13) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day13/day13.rs) -[Day 14: Parabolic Reflector Dish](https://adventofcode.com/2023/day/14) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day14/day14.rs) -[Day 15: Lens Library](https://adventofcode.com/2023/day/15) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day15/day15.rs) -[Day 16: The Floor Will Be Lava](https://adventofcode.com/2023/day/16) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day16/day16.rs) [![Python](../scripts/assets/python.png)](../2023/day16/day16.py) -[Day 17: Clumsy Crucible](https://adventofcode.com/2023/day/17) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day17/day17.rs) -[Day 18: Lavaduct Lagoon](https://adventofcode.com/2023/day/18) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day18/day18.rs) -[Day 19: Aplenty](https://adventofcode.com/2023/day/19) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day19/day19.rs) -[Day 20: Pulse Propagation](https://adventofcode.com/2023/day/20) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day20/day20.rs) -[Day 21: Step Counter](https://adventofcode.com/2023/day/21) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day21/day21.rs) -[Day 22: Sand Slabs](https://adventofcode.com/2023/day/22) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day22/day22.rs) -[Day 23: A Long Walk](https://adventofcode.com/2023/day/23) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day23/day23.rs) -[Day 24: Never Tell Me The Odds](https://adventofcode.com/2023/day/24) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day24/day24.rs) [![Python](../scripts/assets/python.png)](../2023/day24/day24.py) -[Day 25: Snowverload](https://adventofcode.com/2023/day/25) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2023/day25/day25.rs) [![Python](../scripts/assets/python.png)](../2023/day25/day25.py) diff --git a/2023/day1/Cargo.toml b/2023/day1/Cargo.toml deleted file mode 100644 index 8d833bf3..00000000 --- a/2023/day1/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day1" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day1" -path = "day1.rs" diff --git a/2023/day10/Cargo.toml b/2023/day10/Cargo.toml deleted file mode 100644 index e7fac469..00000000 --- a/2023/day10/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "day10" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -geo = "*" -geo-types = "*" -itertools = "*" -rustc-hash = "*" - -[[bin]] -name = "day10" -path = "day10.rs" diff --git a/2023/day11/Cargo.toml b/2023/day11/Cargo.toml deleted file mode 100644 index 6f7b3801..00000000 --- a/2023/day11/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day11" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day11" -path = "day11.rs" diff --git a/2023/day12/Cargo.toml b/2023/day12/Cargo.toml deleted file mode 100644 index 8be331ad..00000000 --- a/2023/day12/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day12" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day12" -path = "day12.rs" diff --git a/2023/day13/Cargo.toml b/2023/day13/Cargo.toml deleted file mode 100644 index 017a743d..00000000 --- a/2023/day13/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day13" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day13" -path = "day13.rs" diff --git a/2023/day14/Cargo.toml b/2023/day14/Cargo.toml deleted file mode 100644 index abba6d6f..00000000 --- a/2023/day14/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day14" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day14" -path = "day14.rs" diff --git a/2023/day15/Cargo.toml b/2023/day15/Cargo.toml deleted file mode 100644 index 46c03c2c..00000000 --- a/2023/day15/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day15" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day15" -path = "day15.rs" diff --git a/2023/day16/Cargo.toml b/2023/day16/Cargo.toml deleted file mode 100644 index 4f755eeb..00000000 --- a/2023/day16/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day16" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day16" -path = "day16.rs" diff --git a/2023/day17/Cargo.toml b/2023/day17/Cargo.toml deleted file mode 100644 index 1f55d0ae..00000000 --- a/2023/day17/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day17" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day17" -path = "day17.rs" diff --git a/2023/day18/Cargo.toml b/2023/day18/Cargo.toml deleted file mode 100644 index 86a98d20..00000000 --- a/2023/day18/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day18" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day18" -path = "day18.rs" diff --git a/2023/day19/Cargo.toml b/2023/day19/Cargo.toml deleted file mode 100644 index fc447add..00000000 --- a/2023/day19/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day19" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day19" -path = "day19.rs" diff --git a/2023/day2/Cargo.toml b/2023/day2/Cargo.toml deleted file mode 100644 index eb906174..00000000 --- a/2023/day2/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day2" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day2" -path = "day2.rs" diff --git a/2023/day20/Cargo.toml b/2023/day20/Cargo.toml deleted file mode 100644 index 01b081e8..00000000 --- a/2023/day20/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day20" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -num = "*" -rustc-hash = "*" - -[[bin]] -name = "day20" -path = "day20.rs" diff --git a/2023/day21/Cargo.toml b/2023/day21/Cargo.toml deleted file mode 100644 index 3c213730..00000000 --- a/2023/day21/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day21" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -num = "*" -rustc-hash = "*" - -[[bin]] -name = "day21" -path = "day21.rs" diff --git a/2023/day22/Cargo.toml b/2023/day22/Cargo.toml deleted file mode 100644 index 046e465e..00000000 --- a/2023/day22/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day22" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day22" -path = "day22.rs" diff --git a/2023/day23/Cargo.toml b/2023/day23/Cargo.toml deleted file mode 100644 index a8ac5bf9..00000000 --- a/2023/day23/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day23" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day23" -path = "day23.rs" diff --git a/2023/day24/Cargo.toml b/2023/day24/Cargo.toml deleted file mode 100644 index d060451e..00000000 --- a/2023/day24/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day24" -version = "0.1.0" -edition = "2021" -build = "build.rs" - -[dependencies] -aoc = { path = "../../aoc" } -fraction = "*" -z3 = "*" - -[[bin]] -name = "day24" -path = "day24.rs" diff --git a/2023/day25/Cargo.toml b/2023/day25/Cargo.toml deleted file mode 100644 index fba5095a..00000000 --- a/2023/day25/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day25" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" -rustworkx-core = "*" - -[[bin]] -name = "day25" -path = "day25.rs" diff --git a/2023/day3/Cargo.toml b/2023/day3/Cargo.toml deleted file mode 100644 index 4f561a74..00000000 --- a/2023/day3/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day3" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day3" -path = "day3.rs" diff --git a/2023/day4/Cargo.toml b/2023/day4/Cargo.toml deleted file mode 100644 index a83fc9cd..00000000 --- a/2023/day4/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day4" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day4" -path = "day4.rs" diff --git a/2023/day5/Cargo.toml b/2023/day5/Cargo.toml deleted file mode 100644 index 64854eb5..00000000 --- a/2023/day5/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day5" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day5" -path = "day5.rs" diff --git a/2023/day6/Cargo.toml b/2023/day6/Cargo.toml deleted file mode 100644 index 0c1a3cb7..00000000 --- a/2023/day6/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day6" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day6" -path = "day6.rs" diff --git a/2023/day7/Cargo.toml b/2023/day7/Cargo.toml deleted file mode 100644 index ed2e3f98..00000000 --- a/2023/day7/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day7" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day7" -path = "day7.rs" diff --git a/2023/day8/Cargo.toml b/2023/day8/Cargo.toml deleted file mode 100644 index 0f4c5cb9..00000000 --- a/2023/day8/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day8" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -num = "*" -rustc-hash = "*" - -[[bin]] -name = "day8" -path = "day8.rs" diff --git a/2023/day9/Cargo.toml b/2023/day9/Cargo.toml deleted file mode 100644 index 4c086fa8..00000000 --- a/2023/day9/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day9" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day9" -path = "day9.rs" diff --git a/2024/Cargo.toml b/2024/Cargo.toml deleted file mode 100644 index ef08b4e9..00000000 --- a/2024/Cargo.toml +++ /dev/null @@ -1,5 +0,0 @@ -# https://adventofcode.com/2024 - -[workspace] -members = ["day*"] -resolver = "2" diff --git a/2024/README.md b/2024/README.md deleted file mode 100644 index 9c530af5..00000000 --- a/2024/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Advent of Code in Rust 🦀 - -![AoC2024](https://img.shields.io/badge/Advent_of_Code-2024-8A2BE2) -![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) -![Rust: 26](https://img.shields.io/badge/Rust-26-cyan?logo=Rust) -![Python: 10](https://img.shields.io/badge/Python-10-cyan?logo=Python) - -## 2024 ([Calendar](https://adventofcode.com/2024)) ([Solutions](../2024/)) : 50⭐ - -Puzzle | Stars | Languages ----------------------------------------------------------------------- | ----- | ----------- -[Day 1: Historian Hysteria](https://adventofcode.com/2024/day/1) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day1/day1.rs) [![Python](../scripts/assets/python.png)](../2024/day1/day1.py) [![C](../scripts/assets/c.png)](../2024/day1/day1.c) [![C++](../scripts/assets/cpp.png)](../2024/day1/day1.cpp) [![Go](../scripts/assets/go.png)](../2024/day1/day1.go) [![Ruby](../scripts/assets/ruby.png)](../2024/day1/day1.rb) [![Perl](../scripts/assets/perl.png)](../2024/day1/day1.pl) [![Lua](../scripts/assets/lua.png)](../2024/day1/day1.lua) [![JS](../scripts/assets/javascript.png)](../2024/day1/day1.js) [![Bash](../scripts/assets/bash.png)](../2024/day1/day1.sh) [![Swift](../scripts/assets/swift.png)](../2024/day1/day1.swift) [![Java](../scripts/assets/java.png)](../2024/day1/day1.java) [![C#](../scripts/assets/csharp.png)](../2024/day1/day1.cs) [![SQLite](../scripts/assets/sqlite.png)](../2024/day1/day1.sql) [![Linux Kernel](../scripts/assets/kernel.png)](../2024/day1/day1.kernel) -[Day 2: Red-Nosed Reports](https://adventofcode.com/2024/day/2) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day2/day2.rs) [![Python](../scripts/assets/python.png)](../2024/day2/day2.py) [![Go](../scripts/assets/go.png)](../2024/day2/day2.go) -[Day 3: Mull It Over](https://adventofcode.com/2024/day/3) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day3/day3.rs) [![Python](../scripts/assets/python.png)](../2024/day3/day3.py) [![Go](../scripts/assets/go.png)](../2024/day3/day3.go) [![Perl](../scripts/assets/perl.png)](../2024/day3/day3.pl) -[Day 4: Ceres Search](https://adventofcode.com/2024/day/4) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day4/day4.rs) [![Python](../scripts/assets/python.png)](../2024/day4/day4.py) -[Day 5: Print Queue](https://adventofcode.com/2024/day/5) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day5/day5.rs) -[Day 6: Guard Gallivant](https://adventofcode.com/2024/day/6) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day6/day6.rs) -[Day 7: Bridge Repair](https://adventofcode.com/2024/day/7) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day7/day7.rs) [![Python](../scripts/assets/python.png)](../2024/day7/day7.py) [![Go](../scripts/assets/go.png)](../2024/day7/day7.go) -[Day 8: Resonant Collinearity](https://adventofcode.com/2024/day/8) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day8/day8.rs) [![Python](../scripts/assets/python.png)](../2024/day8/day8.py) -[Day 9: Disk Fragmenter](https://adventofcode.com/2024/day/9) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day9/day9.rs) -[Day 10: Hoof It](https://adventofcode.com/2024/day/10) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day10/day10.rs) -[Day 11: Plutonian Pebbles](https://adventofcode.com/2024/day/11) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day11/day11.rs) [![Go](../scripts/assets/go.png)](../2024/day11/day11.go) -[Day 12: Garden Groups](https://adventofcode.com/2024/day/12) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day12/day12.rs) -[Day 13: Claw Contraption](https://adventofcode.com/2024/day/13) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day13/day13.rs) [![Rust](../scripts/assets/rust.png)](../2024/day13_z3/day13.rs) [![Python](../scripts/assets/python.png)](../2024/day13_z3/day13.py) -[Day 14: Restroom Redoubt](https://adventofcode.com/2024/day/14) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day14/day14.rs) [![Python](../scripts/assets/python.png)](../2024/day14/day14.py) [🎁](../2024/day14/README.md) -[Day 15: Warehouse Woes](https://adventofcode.com/2024/day/15) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day15/day15.rs) [🎁](../2024/day15/README.md) -[Day 16: Reindeer Maze](https://adventofcode.com/2024/day/16) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day16/day16.rs) [🎁](../2024/day16/README.md) -[Day 17: Chronospatial Computer](https://adventofcode.com/2024/day/17) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day17/day17.rs) -[Day 18: RAM Run](https://adventofcode.com/2024/day/18) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day18/day18.rs) [![C++](../scripts/assets/cpp.png)](../2024/day18/day18.cpp) [![Go](../scripts/assets/go.png)](../2024/day18/day18.go) -[Day 19: Linen Layout](https://adventofcode.com/2024/day/19) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day19/day19.rs) -[Day 20: Race Condition](https://adventofcode.com/2024/day/20) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day20/day20.rs) -[Day 21: Keypad Conundrum](https://adventofcode.com/2024/day/21) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day21/day21.rs) -[Day 22: Monkey Market](https://adventofcode.com/2024/day/22) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day22/day22.rs) -[Day 23: LAN Party](https://adventofcode.com/2024/day/23) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day23/day23.rs) [![Python](../scripts/assets/python.png)](../2024/day23/day23.py) -[Day 24: Crossed Wires](https://adventofcode.com/2024/day/24) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day24/day24.rs) -[Day 25: Code Chronicle](https://adventofcode.com/2024/day/25) | ⭐⭐ | [![Rust](../scripts/assets/rust.png)](../2024/day25/day25.rs) [![Python](../scripts/assets/python.png)](../2024/day25/day25.py) [![Go](../scripts/assets/go.png)](../2024/day25/day25.go) diff --git a/2024/day1/Cargo.toml b/2024/day1/Cargo.toml deleted file mode 100644 index d907473c..00000000 --- a/2024/day1/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day1" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day1" -path = "day1.rs" diff --git a/2024/day10/Cargo.toml b/2024/day10/Cargo.toml deleted file mode 100644 index adee8e9c..00000000 --- a/2024/day10/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day10" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day10" -path = "day10.rs" diff --git a/2024/day11/Cargo.toml b/2024/day11/Cargo.toml deleted file mode 100644 index 4230f46e..00000000 --- a/2024/day11/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day11" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day11" -path = "day11.rs" diff --git a/2024/day12/Cargo.toml b/2024/day12/Cargo.toml deleted file mode 100644 index 8be331ad..00000000 --- a/2024/day12/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day12" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day12" -path = "day12.rs" diff --git a/2024/day13/Cargo.toml b/2024/day13/Cargo.toml deleted file mode 100644 index fcc8cded..00000000 --- a/2024/day13/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day13" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -fraction = "*" - -[[bin]] -name = "day13" -path = "day13.rs" diff --git a/2024/day13_z3/Cargo.toml b/2024/day13_z3/Cargo.toml deleted file mode 100644 index cd186107..00000000 --- a/2024/day13_z3/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day13_z3" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -z3 = "*" - -[[bin]] -name = "day13_z3" -path = "day13.rs" diff --git a/2024/day14/Cargo.toml b/2024/day14/Cargo.toml deleted file mode 100644 index 818669aa..00000000 --- a/2024/day14/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day14" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" -rustc-hash = "*" - -[[bin]] -name = "day14" -path = "day14.rs" diff --git a/2024/day15/Cargo.toml b/2024/day15/Cargo.toml deleted file mode 100644 index 29f0394b..00000000 --- a/2024/day15/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "day15" -version = "0.1.0" -edition = "2021" - -[features] -anim = ["image"] - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" -image = { version = "*", optional = true } - -[[bin]] -name = "day15" -path = "day15.rs" diff --git a/2024/day16/Cargo.toml b/2024/day16/Cargo.toml deleted file mode 100644 index e4dfe3ea..00000000 --- a/2024/day16/Cargo.toml +++ /dev/null @@ -1,16 +0,0 @@ -[package] -name = "day16" -version = "0.1.0" -edition = "2021" - -[features] -anim = [] - -[dependencies] -aoc = { path = "../../aoc" } -image = "*" -rustc-hash = "*" - -[[bin]] -name = "day16" -path = "day16.rs" diff --git a/2024/day17/Cargo.toml b/2024/day17/Cargo.toml deleted file mode 100644 index 17cc3676..00000000 --- a/2024/day17/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day17" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day17" -path = "day17.rs" diff --git a/2024/day18/Cargo.toml b/2024/day18/Cargo.toml deleted file mode 100644 index 86a98d20..00000000 --- a/2024/day18/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day18" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day18" -path = "day18.rs" diff --git a/2024/day19/Cargo.toml b/2024/day19/Cargo.toml deleted file mode 100644 index 39989142..00000000 --- a/2024/day19/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day19" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day19" -path = "day19.rs" diff --git a/2024/day2/Cargo.toml b/2024/day2/Cargo.toml deleted file mode 100644 index 768b1e4b..00000000 --- a/2024/day2/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day2" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day2" -path = "day2.rs" diff --git a/2024/day20/Cargo.toml b/2024/day20/Cargo.toml deleted file mode 100644 index 7870325e..00000000 --- a/2024/day20/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day20" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day20" -path = "day20.rs" diff --git a/2024/day21/Cargo.toml b/2024/day21/Cargo.toml deleted file mode 100644 index a7797abb..00000000 --- a/2024/day21/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day21" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -itertools = "*" -rustc-hash = "*" - -[[bin]] -name = "day21" -path = "day21.rs" diff --git a/2024/day22/Cargo.toml b/2024/day22/Cargo.toml deleted file mode 100644 index 046e465e..00000000 --- a/2024/day22/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day22" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day22" -path = "day22.rs" diff --git a/2024/day23/Cargo.toml b/2024/day23/Cargo.toml deleted file mode 100644 index 84133cbb..00000000 --- a/2024/day23/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "day23" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustworkx-core = "*" -petgraph = "*" -rustc-hash = "*" - -[[bin]] -name = "day23" -path = "day23.rs" diff --git a/2024/day24/Cargo.toml b/2024/day24/Cargo.toml deleted file mode 100644 index 9802ce8d..00000000 --- a/2024/day24/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day24" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day24" -path = "day24.rs" diff --git a/2024/day25/Cargo.toml b/2024/day25/Cargo.toml deleted file mode 100644 index 9fd6995b..00000000 --- a/2024/day25/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day25" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day25" -path = "day25.rs" diff --git a/2024/day3/Cargo.toml b/2024/day3/Cargo.toml deleted file mode 100644 index db5a5e90..00000000 --- a/2024/day3/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day3" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -regex = "*" - -[[bin]] -name = "day3" -path = "day3.rs" diff --git a/2024/day4/Cargo.toml b/2024/day4/Cargo.toml deleted file mode 100644 index 6ef088cb..00000000 --- a/2024/day4/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day4" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day4" -path = "day4.rs" diff --git a/2024/day5/Cargo.toml b/2024/day5/Cargo.toml deleted file mode 100644 index 2f5b39dd..00000000 --- a/2024/day5/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day5" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day5" -path = "day5.rs" diff --git a/2024/day6/Cargo.toml b/2024/day6/Cargo.toml deleted file mode 100644 index 54bf4c71..00000000 --- a/2024/day6/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day6" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day6" -path = "day6.rs" diff --git a/2024/day7/Cargo.toml b/2024/day7/Cargo.toml deleted file mode 100644 index ed2e3f98..00000000 --- a/2024/day7/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "day7" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -rustc-hash = "*" - -[[bin]] -name = "day7" -path = "day7.rs" diff --git a/2024/day8/Cargo.toml b/2024/day8/Cargo.toml deleted file mode 100644 index d3ba9490..00000000 --- a/2024/day8/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "day8" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } -itertools = "*" -rustc-hash = "*" - -[[bin]] -name = "day8" -path = "day8.rs" diff --git a/2024/day9/Cargo.toml b/2024/day9/Cargo.toml deleted file mode 100644 index 4c086fa8..00000000 --- a/2024/day9/Cargo.toml +++ /dev/null @@ -1,11 +0,0 @@ -[package] -name = "day9" -version = "0.1.0" -edition = "2021" - -[dependencies] -aoc = { path = "../../aoc" } - -[[bin]] -name = "day9" -path = "day9.rs" diff --git a/one/Cargo.toml b/Cargo.toml similarity index 82% rename from one/Cargo.toml rename to Cargo.toml index 0ec4fb9f..a3392134 100644 --- a/one/Cargo.toml +++ b/Cargo.toml @@ -7,10 +7,13 @@ edition = "2021" ascii = [] anim = ["image"] +[build-dependencies] +cc = "*" + [dependencies] -aoc = { path = "../aoc" } -assembunny = { path = "../2016/assembunny/" } -intcode = { path = "../2019/intcode-rs/" } +aoc = { path = "crates/aoc" } +assembunny = { path = "crates/assembunny" } +intcode = { path = "crates/intcode" } rustc-hash = "*" colored = "*" diff --git a/README.md b/README.md index a531bbf2..fae2f382 100644 --- a/README.md +++ b/README.md @@ -10,61 +10,61 @@ Made for fun 😎 and to practice Rust. Many thanks to [Eric Wastl](https://twitter.com/ericwastl). -## 2024 (current event) ([Calendar](https://adventofcode.com/2024)) ([Solutions](2024/)) : 50⭐ +## 2024 (current event) ([Calendar](https://adventofcode.com/2024)) ([Solutions](src/year2015/)) : 50⭐ Puzzle | Stars | Languages ---------------------------------------------------------------------- | ----- | ----------- -[Day 1: Historian Hysteria](https://adventofcode.com/2024/day/1) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day1/day1.rs) [![Python](./scripts/assets/python.png)](./2024/day1/day1.py) [![C](./scripts/assets/c.png)](./2024/day1/day1.c) [![C++](./scripts/assets/cpp.png)](./2024/day1/day1.cpp) [![Go](./scripts/assets/go.png)](./2024/day1/day1.go) [![Ruby](./scripts/assets/ruby.png)](./2024/day1/day1.rb) [![Perl](./scripts/assets/perl.png)](./2024/day1/day1.pl) [![Lua](./scripts/assets/lua.png)](./2024/day1/day1.lua) [![JS](./scripts/assets/javascript.png)](./2024/day1/day1.js) [![Bash](./scripts/assets/bash.png)](./2024/day1/day1.sh) [![Swift](./scripts/assets/swift.png)](./2024/day1/day1.swift) [![Java](./scripts/assets/java.png)](./2024/day1/day1.java) [![C#](./scripts/assets/csharp.png)](./2024/day1/day1.cs) [![SQLite](./scripts/assets/sqlite.png)](./2024/day1/day1.sql) [![Linux Kernel](./scripts/assets/kernel.png)](./2024/day1/day1.kernel) -[Day 2: Red-Nosed Reports](https://adventofcode.com/2024/day/2) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day2/day2.rs) [![Python](./scripts/assets/python.png)](./2024/day2/day2.py) [![Go](./scripts/assets/go.png)](./2024/day2/day2.go) -[Day 3: Mull It Over](https://adventofcode.com/2024/day/3) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day3/day3.rs) [![Python](./scripts/assets/python.png)](./2024/day3/day3.py) [![Go](./scripts/assets/go.png)](./2024/day3/day3.go) [![Perl](./scripts/assets/perl.png)](./2024/day3/day3.pl) -[Day 4: Ceres Search](https://adventofcode.com/2024/day/4) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day4/day4.rs) [![Python](./scripts/assets/python.png)](./2024/day4/day4.py) -[Day 5: Print Queue](https://adventofcode.com/2024/day/5) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day5/day5.rs) -[Day 6: Guard Gallivant](https://adventofcode.com/2024/day/6) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day6/day6.rs) -[Day 7: Bridge Repair](https://adventofcode.com/2024/day/7) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day7/day7.rs) [![Python](./scripts/assets/python.png)](./2024/day7/day7.py) [![Go](./scripts/assets/go.png)](./2024/day7/day7.go) -[Day 8: Resonant Collinearity](https://adventofcode.com/2024/day/8) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day8/day8.rs) [![Python](./scripts/assets/python.png)](./2024/day8/day8.py) -[Day 9: Disk Fragmenter](https://adventofcode.com/2024/day/9) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day9/day9.rs) -[Day 10: Hoof It](https://adventofcode.com/2024/day/10) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day10/day10.rs) -[Day 11: Plutonian Pebbles](https://adventofcode.com/2024/day/11) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day11/day11.rs) [![Go](./scripts/assets/go.png)](./2024/day11/day11.go) -[Day 12: Garden Groups](https://adventofcode.com/2024/day/12) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day12/day12.rs) -[Day 13: Claw Contraption](https://adventofcode.com/2024/day/13) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day13/day13.rs) [![Rust](./scripts/assets/rust.png)](./2024/day13_z3/day13.rs) [![Python](./scripts/assets/python.png)](./2024/day13_z3/day13.py) -[Day 14: Restroom Redoubt](https://adventofcode.com/2024/day/14) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day14/day14.rs) [![Python](./scripts/assets/python.png)](./2024/day14/day14.py) [🎁](./2024/day14/README.md) -[Day 15: Warehouse Woes](https://adventofcode.com/2024/day/15) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day15/day15.rs) [🎁](./2024/day15/README.md) -[Day 16: Reindeer Maze](https://adventofcode.com/2024/day/16) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day16/day16.rs) [🎁](./2024/day16/README.md) -[Day 17: Chronospatial Computer](https://adventofcode.com/2024/day/17) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day17/day17.rs) -[Day 18: RAM Run](https://adventofcode.com/2024/day/18) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day18/day18.rs) [![C++](./scripts/assets/cpp.png)](./2024/day18/day18.cpp) [![Go](./scripts/assets/go.png)](./2024/day18/day18.go) -[Day 19: Linen Layout](https://adventofcode.com/2024/day/19) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day19/day19.rs) -[Day 20: Race Condition](https://adventofcode.com/2024/day/20) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day20/day20.rs) -[Day 21: Keypad Conundrum](https://adventofcode.com/2024/day/21) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day21/day21.rs) -[Day 22: Monkey Market](https://adventofcode.com/2024/day/22) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day22/day22.rs) -[Day 23: LAN Party](https://adventofcode.com/2024/day/23) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day23/day23.rs) [![Python](./scripts/assets/python.png)](./2024/day23/day23.py) -[Day 24: Crossed Wires](https://adventofcode.com/2024/day/24) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day24/day24.rs) -[Day 25: Code Chronicle](https://adventofcode.com/2024/day/25) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](./2024/day25/day25.rs) [![Python](./scripts/assets/python.png)](./2024/day25/day25.py) [![Go](./scripts/assets/go.png)](./2024/day25/day25.go) +[Day 1: Historian Hysteria](https://adventofcode.com/2024/day/1) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day1/day1.rs) [![Python](./scripts/assets/python.png)](src/year2024/day1/day1.py) [![C](./scripts/assets/c.png)](src/year2024/day1/day1.c) [![C++](./scripts/assets/cpp.png)](src/year2024/day1/day1.cpp) [![Go](./scripts/assets/go.png)](src/year2024/day1/day1.go) [![Ruby](./scripts/assets/ruby.png)](src/year2024/day1/day1.rb) [![Perl](./scripts/assets/perl.png)](src/year2024/day1/day1.pl) [![Lua](./scripts/assets/lua.png)](src/year2024/day1/day1.lua) [![JS](./scripts/assets/javascript.png)](src/year2024/day1/day1.js) [![Bash](./scripts/assets/bash.png)](src/year2024/day1/day1.sh) [![Swift](./scripts/assets/swift.png)](src/year2024/day1/day1.swift) [![Java](./scripts/assets/java.png)](src/year2024/day1/day1.java) [![C#](./scripts/assets/csharp.png)](src/year2024/day1/day1.cs) [![SQLite](./scripts/assets/sqlite.png)](src/year2024/day1/day1.sql) +[Day 2: Red-Nosed Reports](https://adventofcode.com/2024/day/2) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day2/day2.rs) [![Python](./scripts/assets/python.png)](src/year2024/day2/day2.py) [![Go](./scripts/assets/go.png)](src/year2024/day2/day2.go) +[Day 3: Mull It Over](https://adventofcode.com/2024/day/3) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day3/day3.rs) [![Python](./scripts/assets/python.png)](src/year2024/day3/day3.py) [![Go](./scripts/assets/go.png)](src/year2024/day3/day3.go) [![Perl](./scripts/assets/perl.png)](src/year2024/day3/day3.pl) +[Day 4: Ceres Search](https://adventofcode.com/2024/day/4) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day4/day4.rs) [![Python](./scripts/assets/python.png)](src/year2024/day4/day4.py) +[Day 5: Print Queue](https://adventofcode.com/2024/day/5) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day5/day5.rs) +[Day 6: Guard Gallivant](https://adventofcode.com/2024/day/6) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day6/day6.rs) +[Day 7: Bridge Repair](https://adventofcode.com/2024/day/7) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day7/day7.rs) [![Python](./scripts/assets/python.png)](src/year2024/day7/day7.py) [![Go](./scripts/assets/go.png)](src/year2024/day7/day7.go) +[Day 8: Resonant Collinearity](https://adventofcode.com/2024/day/8) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day8/day8.rs) [![Python](./scripts/assets/python.png)](src/year2024/day8/day8.py) +[Day 9: Disk Fragmenter](https://adventofcode.com/2024/day/9) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day9/day9.rs) +[Day 10: Hoof It](https://adventofcode.com/2024/day/10) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day10/day10.rs) +[Day 11: Plutonian Pebbles](https://adventofcode.com/2024/day/11) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day11/day11.rs) [![Go](./scripts/assets/go.png)](src/year2024/day11/day11.go) +[Day 12: Garden Groups](https://adventofcode.com/2024/day/12) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day12/day12.rs) +[Day 13: Claw Contraption](https://adventofcode.com/2024/day/13) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day13/day13.rs) [![Rust](./scripts/assets/rust.png)](src/year2024/day13_z3/day13_z3.rs) [![Python](./scripts/assets/python.png)](src/year2024/day13_z3/day13.py) +[Day 14: Restroom Redoubt](https://adventofcode.com/2024/day/14) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day14/day14.rs) [![Python](./scripts/assets/python.png)](src/year2024/day14/day14.py) [🎁](src/year2024/day14/README.md) +[Day 15: Warehouse Woes](https://adventofcode.com/2024/day/15) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day15/day15.rs) [🎁](src/year2024/day15/README.md) +[Day 16: Reindeer Maze](https://adventofcode.com/2024/day/16) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day16/day16.rs) [🎁](src/year2024/day16/README.md) +[Day 17: Chronospatial Computer](https://adventofcode.com/2024/day/17) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day17/day17.rs) +[Day 18: RAM Run](https://adventofcode.com/2024/day/18) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day18/day18.rs) [![C++](./scripts/assets/cpp.png)](src/year2024/day18/day18.cpp) [![Go](./scripts/assets/go.png)](src/year2024/day18/day18.go) +[Day 19: Linen Layout](https://adventofcode.com/2024/day/19) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day19/day19.rs) +[Day 20: Race Condition](https://adventofcode.com/2024/day/20) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day20/day20.rs) +[Day 21: Keypad Conundrum](https://adventofcode.com/2024/day/21) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day21/day21.rs) +[Day 22: Monkey Market](https://adventofcode.com/2024/day/22) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day22/day22.rs) +[Day 23: LAN Party](https://adventofcode.com/2024/day/23) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day23/day23.rs) [![Python](./scripts/assets/python.png)](src/year2024/day23/day23.py) +[Day 24: Crossed Wires](https://adventofcode.com/2024/day/24) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day24/day24.rs) +[Day 25: Code Chronicle](https://adventofcode.com/2024/day/25) | ⭐⭐ | [![Rust](./scripts/assets/rust.png)](src/year2024/day25/day25.rs) [![Python](./scripts/assets/python.png)](src/year2024/day25/day25.py) [![Go](./scripts/assets/go.png)](src/year2024/day25/day25.go) ## All years Calendar | Solutions | Stars | Rust | Python | 🎁 -------- | --------- | ----- | ---- | ------ | -- -[Advent of Code 2024](https://adventofcode.com/2024) | [Solutions](2024/README.md) | 50⭐ | 25 | 10 | 3 -[Advent of Code 2023](https://adventofcode.com/2023) | [Solutions](2023/README.md) | 50⭐ | 25 | 11 | 1 -[Advent of Code 2022](https://adventofcode.com/2022) | [Solutions](2022/README.md) | 50⭐ | 25 | 18 | 1 -[Advent of Code 2021](https://adventofcode.com/2021) | [Solutions](2021/README.md) | 50⭐ | 25 | 12 | -[Advent of Code 2020](https://adventofcode.com/2020) | [Solutions](2020/README.md) | 50⭐ | 25 | 23 | -[Advent of Code 2019](https://adventofcode.com/2019) | [Solutions](2019/README.md) | 50⭐ | 25 | 23 | 2 -[Advent of Code 2018](https://adventofcode.com/2018) | [Solutions](2018/README.md) | 50⭐ | 25 | 4 | 1 -[Advent of Code 2017](https://adventofcode.com/2017) | [Solutions](2017/README.md) | 50⭐ | 25 | 17 | -[Advent of Code 2016](https://adventofcode.com/2016) | [Solutions](2016/README.md) | 50⭐ | 25 | 0 | -[Advent of Code 2015](https://adventofcode.com/2015) | [Solutions](2015/README.md) | 50⭐ | 25 | 5 | 1 +[Advent of Code 2024](https://adventofcode.com/2024) | [Solutions](src/year2024/README.md) | 50⭐ | 25 | 10 | 3 +[Advent of Code 2023](https://adventofcode.com/2023) | [Solutions](src/year2023/README.md) | 50⭐ | 25 | 11 | 1 +[Advent of Code 2022](https://adventofcode.com/2022) | [Solutions](src/year2022/README.md) | 50⭐ | 25 | 18 | 1 +[Advent of Code 2021](https://adventofcode.com/2021) | [Solutions](src/year2021/README.md) | 50⭐ | 25 | 12 | +[Advent of Code 2020](https://adventofcode.com/2020) | [Solutions](src/year2020/README.md) | 50⭐ | 25 | 23 | +[Advent of Code 2019](https://adventofcode.com/2019) | [Solutions](src/year2019/README.md) | 50⭐ | 25 | 23 | 2 +[Advent of Code 2018](https://adventofcode.com/2018) | [Solutions](src/year2018/README.md) | 50⭐ | 25 | 4 | 1 +[Advent of Code 2017](https://adventofcode.com/2017) | [Solutions](src/year2017/README.md) | 50⭐ | 25 | 17 | +[Advent of Code 2016](https://adventofcode.com/2016) | [Solutions](src/year2016/README.md) | 50⭐ | 25 | 0 | +[Advent of Code 2015](https://adventofcode.com/2015) | [Solutions](src/year2015/README.md) | 50⭐ | 25 | 5 | 1 ## Bonus 🎁 Year | Count | Days ---- | ----- | -------------------- -2024 | 3 | [14](2024/day14/README.md) [15](2024/day15/README.md) [16](2024/day16/README.md) -2023 | 1 | [10](2023/day10/README.md) -2022 | 1 | [17](2022/day17/README.md) -2019 | 2 | [13](2019/day13/README.md) [15](2019/day15/README.md) -2018 | 1 | [18](2018/day18/README.md) -2015 | 1 | [18](2015/day18/README.md) +2024 | 3 | [14](src/year2024/day14/README.md) [15](src/year2024/day15/README.md) [16](src/year2024/day16/README.md) +2023 | 1 | [10](src/year2023/day10/README.md) +2022 | 1 | [17](src/year2022/day17/README.md) +2019 | 2 | [13](src/year2019/day13/README.md) [15](src/year2019/day15/README.md) +2018 | 1 | [18](src/year2018/day18/README.md) +2015 | 1 | [18](src/year2015/day18/README.md) ## Under the hood 🎄 diff --git a/build.rs b/build.rs new file mode 100644 index 00000000..d9ed5519 --- /dev/null +++ b/build.rs @@ -0,0 +1,9 @@ +fn main() { + // Buy a Mac  + println!(r"cargo:rustc-link-search=/opt/homebrew/lib"); + + println!("cargo:rerun-if-changed=src/year2018/day9_c/day9.c"); + cc::Build::new() + .file("src/year2018/day9_c/day9.c") + .compile("day9_c"); +} diff --git a/aoc/Cargo.toml b/crates/aoc/Cargo.toml similarity index 100% rename from aoc/Cargo.toml rename to crates/aoc/Cargo.toml diff --git a/aoc/input.txt b/crates/aoc/input.txt similarity index 100% rename from aoc/input.txt rename to crates/aoc/input.txt diff --git a/aoc/src/args.rs b/crates/aoc/src/args.rs similarity index 100% rename from aoc/src/args.rs rename to crates/aoc/src/args.rs diff --git a/aoc/src/bin/dayXX/main.rs b/crates/aoc/src/bin/dayXX/main.rs similarity index 100% rename from aoc/src/bin/dayXX/main.rs rename to crates/aoc/src/bin/dayXX/main.rs diff --git a/aoc/src/coord.rs b/crates/aoc/src/coord.rs similarity index 100% rename from aoc/src/coord.rs rename to crates/aoc/src/coord.rs diff --git a/aoc/src/counter.rs b/crates/aoc/src/counter.rs similarity index 100% rename from aoc/src/counter.rs rename to crates/aoc/src/counter.rs diff --git a/aoc/src/direction.rs b/crates/aoc/src/direction.rs similarity index 100% rename from aoc/src/direction.rs rename to crates/aoc/src/direction.rs diff --git a/aoc/src/grid.rs b/crates/aoc/src/grid.rs similarity index 100% rename from aoc/src/grid.rs rename to crates/aoc/src/grid.rs diff --git a/aoc/src/gridu.rs b/crates/aoc/src/gridu.rs similarity index 100% rename from aoc/src/gridu.rs rename to crates/aoc/src/gridu.rs diff --git a/aoc/src/hexslice.rs b/crates/aoc/src/hexslice.rs similarity index 100% rename from aoc/src/hexslice.rs rename to crates/aoc/src/hexslice.rs diff --git a/aoc/src/integer.rs b/crates/aoc/src/integer.rs similarity index 100% rename from aoc/src/integer.rs rename to crates/aoc/src/integer.rs diff --git a/aoc/src/knot.rs b/crates/aoc/src/knot.rs similarity index 100% rename from aoc/src/knot.rs rename to crates/aoc/src/knot.rs diff --git a/aoc/src/lib.rs b/crates/aoc/src/lib.rs similarity index 100% rename from aoc/src/lib.rs rename to crates/aoc/src/lib.rs diff --git a/aoc/src/math.rs b/crates/aoc/src/math.rs similarity index 100% rename from aoc/src/math.rs rename to crates/aoc/src/math.rs diff --git a/aoc/src/ocr.rs b/crates/aoc/src/ocr.rs similarity index 100% rename from aoc/src/ocr.rs rename to crates/aoc/src/ocr.rs diff --git a/aoc/src/square.rs b/crates/aoc/src/square.rs similarity index 100% rename from aoc/src/square.rs rename to crates/aoc/src/square.rs diff --git a/aoc/src/util.rs b/crates/aoc/src/util.rs similarity index 100% rename from aoc/src/util.rs rename to crates/aoc/src/util.rs diff --git a/aoc/tests/coord_test.rs b/crates/aoc/tests/coord_test.rs similarity index 100% rename from aoc/tests/coord_test.rs rename to crates/aoc/tests/coord_test.rs diff --git a/aoc/tests/grid_test.rs b/crates/aoc/tests/grid_test.rs similarity index 100% rename from aoc/tests/grid_test.rs rename to crates/aoc/tests/grid_test.rs diff --git a/aoc/tests/gridu_test.rs b/crates/aoc/tests/gridu_test.rs similarity index 100% rename from aoc/tests/gridu_test.rs rename to crates/aoc/tests/gridu_test.rs diff --git a/2016/assembunny/Cargo.toml b/crates/assembunny/Cargo.toml similarity index 75% rename from 2016/assembunny/Cargo.toml rename to crates/assembunny/Cargo.toml index ab21ad7a..f55d01fa 100644 --- a/2016/assembunny/Cargo.toml +++ b/crates/assembunny/Cargo.toml @@ -4,6 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] -aoc = { path = "../../aoc" } +aoc = { path = "../aoc" } [lib] diff --git a/2016/assembunny/assembler/asm.py b/crates/assembunny/assembler/asm.py similarity index 100% rename from 2016/assembunny/assembler/asm.py rename to crates/assembunny/assembler/asm.py diff --git a/2016/assembunny/assembler/calc.assembunny b/crates/assembunny/assembler/calc.assembunny similarity index 100% rename from 2016/assembunny/assembler/calc.assembunny rename to crates/assembunny/assembler/calc.assembunny diff --git a/2016/assembunny/assembler/heart.assembunny b/crates/assembunny/assembler/heart.assembunny similarity index 100% rename from 2016/assembunny/assembler/heart.assembunny rename to crates/assembunny/assembler/heart.assembunny diff --git a/2016/assembunny/assembler/hello1.assembunny b/crates/assembunny/assembler/hello1.assembunny similarity index 100% rename from 2016/assembunny/assembler/hello1.assembunny rename to crates/assembunny/assembler/hello1.assembunny diff --git a/2016/assembunny/assembler/hello2.assembunny b/crates/assembunny/assembler/hello2.assembunny similarity index 100% rename from 2016/assembunny/assembler/hello2.assembunny rename to crates/assembunny/assembler/hello2.assembunny diff --git a/2016/assembunny/assembler/print_a.assembunny b/crates/assembunny/assembler/print_a.assembunny similarity index 100% rename from 2016/assembunny/assembler/print_a.assembunny rename to crates/assembunny/assembler/print_a.assembunny diff --git a/2016/assembunny/bonus.txt b/crates/assembunny/bonus.txt similarity index 100% rename from 2016/assembunny/bonus.txt rename to crates/assembunny/bonus.txt diff --git a/2016/assembunny/src/bin/run.rs b/crates/assembunny/src/bin/run.rs similarity index 100% rename from 2016/assembunny/src/bin/run.rs rename to crates/assembunny/src/bin/run.rs diff --git a/2016/assembunny/src/lib.rs b/crates/assembunny/src/lib.rs similarity index 99% rename from 2016/assembunny/src/lib.rs rename to crates/assembunny/src/lib.rs index 77fc86a6..974a25f4 100644 --- a/2016/assembunny/src/lib.rs +++ b/crates/assembunny/src/lib.rs @@ -45,7 +45,8 @@ impl RegOrValue { // } else { // Self::Register(to_reg(s)) // } - s.parse::().map_or_else(|_| Self::Register(to_reg(s)), Self::Value) + s.parse::() + .map_or_else(|_| Self::Register(to_reg(s)), Self::Value) } } diff --git a/2019/intcode-rs/Cargo.toml b/crates/intcode/Cargo.toml similarity index 72% rename from 2019/intcode-rs/Cargo.toml rename to crates/intcode/Cargo.toml index 7378de58..a06cbb9f 100644 --- a/2019/intcode-rs/Cargo.toml +++ b/crates/intcode/Cargo.toml @@ -4,4 +4,4 @@ version = "0.1.0" edition = "2021" [dependencies] -aoc = { path = "../../aoc" } +aoc = { path = "../aoc" } diff --git a/2019/intcode-rs/src/day5_compare.intcode b/crates/intcode/src/day5_compare.intcode similarity index 100% rename from 2019/intcode-rs/src/day5_compare.intcode rename to crates/intcode/src/day5_compare.intcode diff --git a/2019/intcode-rs/src/lib.rs b/crates/intcode/src/lib.rs similarity index 100% rename from 2019/intcode-rs/src/lib.rs rename to crates/intcode/src/lib.rs diff --git a/2019/intcode-rs/src/main.rs b/crates/intcode/src/main.rs similarity index 100% rename from 2019/intcode-rs/src/main.rs rename to crates/intcode/src/main.rs diff --git a/one/build.rs b/one/build.rs deleted file mode 100644 index 2495fe1e..00000000 --- a/one/build.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - // Buy a Mac  - println!(r"cargo:rustc-link-search=/opt/homebrew/lib"); -} diff --git a/one/m.py b/one/m.py deleted file mode 100755 index 3db6b367..00000000 --- a/one/m.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python3 - -from pathlib import Path - - -def gen(year): - for src_dir in Path(f"../{year}").glob("day*"): - if "_" in src_dir.name: - continue - - src_file = src_dir / (src_dir.name + ".rs") - dest_dir = Path(f"src/year{year}") / src_dir.name - dest_dir.mkdir(parents=True, exist_ok=True) - - for txt in src_file.parent.glob("*.txt"): - (dest_dir / txt.name).write_bytes(txt.read_bytes()) - - dest_file = dest_dir / (src_dir.name + ".rs") - if src_file.is_file(): - - rs = src_file.read_text() - rs = rs.replace('#[grammar = "day8.pest"]', '#[grammar = "src/year2017/day8/day8.pest"]') - rs = rs.replace("\nfn main() {", "\npub fn main() {") - rs = rs.replace("\nfn solve(", "\n#[must_use]\npub fn solve(") - - dest_file.write_text(rs) - - for txt in src_file.parent.glob("*.rs"): - if txt.name != dest_file.name: - z = dest_dir / dest_file.stem - z.mkdir(parents=True, exist_ok=True) - (z / txt.name).write_bytes(txt.read_bytes()) - - for txt in src_file.parent.glob("*.txt"): - (dest_dir / txt.name).write_bytes(txt.read_bytes()) - - for txt in src_file.parent.glob("*.pest"): - (dest_dir / txt.name).write_bytes(txt.read_bytes()) - - -gen(2015) -gen(2016) -gen(2017) -gen(2018) -gen(2019) -gen(2020) -gen(2021) -gen(2022) -gen(2023) -gen(2024) diff --git a/scripts/answers.py b/scripts/answers.py index 274ef33b..33f1b014 100755 --- a/scripts/answers.py +++ b/scripts/answers.py @@ -2,6 +2,7 @@ import argparse import logging +import os import re import sqlite3 import subprocess @@ -20,12 +21,12 @@ class AocSession: rootdir = Path(__file__).parent.parent def __init__(self, cookie_session, force_update=False, dry_run=False) -> None: - self.data_dir = self.rootdir / "data" + self.stars = {} - self.data_dir.mkdir(exist_ok=True, parents=True) + (self.rootdir / "data").mkdir(exist_ok=True, parents=True) self.force_update = force_update self.dry_run = dry_run - self.db = sqlite3.connect(self.data_dir / "cache.db") + self.db = sqlite3.connect(self.rootdir / "data" / "cache.db") self.always_submit = False self.db.executescript( @@ -58,12 +59,16 @@ def __init__(self, cookie_session, force_update=False, dry_run=False) -> None: name = f"anon-{self.user_id}" self.user_name = name - self.user_dir = self.data_dir / self.user_id + self.user_dir = self.rootdir / "data" / self.user_id self.user_dir.mkdir(parents=True, exist_ok=True) - self.prefix = f"\033[1;36m[{name:<16} {self.user_id:<6}]\033[0m " + self.prefix = f"\033[1;36m[{name:<20} {self.user_id:<6}]\033[0m " + + def year_dir(self, year: int) -> Path: + + return self.rootdir / "src" / f"year{year}" - def get_cookie_sessions(): + def get_cookie_sessions() -> t.List[str]: """Return the list of cookie sessions from `session` file.""" f = AocSession.rootdir / ".session" sessions = [] @@ -113,8 +118,10 @@ def is_available(year, day): return False return True - def iter_all(func): + def iter_all(func, b=None): + def wrapper(self, year=None, day=None, *args, **kwargs): + if year is None: now = datetime.now(UTC) last_year = now.year @@ -132,6 +139,12 @@ def wrapper(self, year=None, day=None, *args, **kwargs): elif AocSession.is_available(year, day): return func(self, year, day) + # if b is not None: + # def wrapper2(year, day): + # return wrapper(func, year,day ) + + # return wrapper2 + return wrapper @iter_all @@ -324,7 +337,12 @@ def submit_parts(step, parts): cmd = [p.resolve().as_posix(), self.get_input(year, day).resolve().as_posix()] else: # run the program to solve the puzzle - cmd = [p.as_posix(), self.get_input(year, day).as_posix()] + cmd = [p.as_posix()] + if p.stem == "one": + cmd.append("-r") + cmd.append(f"{year}:{day}") + cmd.append(self.get_input(year, day).as_posix()) + try: start_time = datetime.now() parts = subprocess.check_output(cmd, stderr=subprocess.DEVNULL).decode().strip().split() @@ -337,7 +355,7 @@ def submit_parts(step, parts): if parts == answers and len(parts) > 0: print(f"{self.prefix} Solution {year} day {day:2} in {language:<6} \033[92mok\033[0m {remarks}") update_last_answers(parts) - return + return True if len(parts) == 2 and parts[1] == "???": parts.pop(1) @@ -361,8 +379,11 @@ def submit_parts(step, parts): # no solution yet or exec error pass - run(f"{year}/target/release/day{day}", "Rust") - # run(f"{year}/day{day}/day{day}.py", "Python") + ( + run(f"src/year{year}/day{day}/target/release/day{day}", "Rust") + or run("target/release/one", "Rust") + or run(f"src/year{year}/day{day}/day{day}.py", "Python") + ) @iter_all def print_stars(self, year=None, day=None): @@ -393,38 +414,19 @@ def get_title(self, year, day) -> str: def get_solutions(self, year, day) -> t.List[str]: """TODO.""" sols = [] - year_dir = Path(self.rootdir) / str(year) - days = [year_dir / f"day{day}"] - days.extend(year_dir.glob(f"day{day}_*")) - for day in days: - if day.is_dir(): - for f in day.glob("day*.*"): - if f.is_file() or (f.is_dir() and any(f.iterdir())): - sols.append(f) - f = day / "src" / "main.rs" - if f.is_file(): - sols.append(f) - return sols - - @iter_all - def set_titles(self, year=None, day=None): - """TODO.""" - markdown = self.get_title(year, day) + year_dir = self.year_dir(year) + days = [year_dir / f"day{day}"] + list(year_dir.glob(f"day{day}_*")) - for f in self.get_solutions(year, day): - original = f.read_text() - lines = original.splitlines() + [""] + for day_dir in days: + if day_dir.is_dir(): + for f in day_dir.glob("day*.*"): + if f.is_file(): + sols.append(f) - if f.suffix == ".py" and lines[1].startswith("# "): - lines[1] = f"# {markdown}" - elif f.suffix == ".rs" and lines[0].startswith("//! "): - lines[0] = f"//! {markdown}" + # print(f"solution for {year} {day}: {sols}") - content = "\n".join(lines) - if content != original: - print(f"set puzzle title in {f.relative_to(self.rootdir)}: {markdown}") - f.write_text(content) + return sols @iter_all def get_titles(self, year=None, day=None): @@ -433,40 +435,6 @@ def get_titles(self, year=None, day=None): print(self.get_title(year, day)) -def show_dstars(args): - sessions = AocSession.get_cookie_sessions() - - users = [] - - for session in sessions: - sess = AocSession(session, args.update, args.dry_run) - if args.user and args.user not in (sess.user_id, sess.user_name): - continue - users.append(sess) - - @AocSession.iter_all - def show_year(_self, year, _day): - stars = {} - for sess in users: - stars[sess.user_name] = [] - for day in range(1, 26): - stars[sess.user_name].append(sess.get_stars(year, day)) - - row = "|".join(f"\033[1;36m{sess.user_name:^12}\033[0m" for sess in users) - print(f" {year} |{row}") - separator = "+".join("-" * 12 for _ in users) - print(f"-------+{separator}") - for day in range(1, 26): - row = "|".join(f"\033[1;33m{'*' * stars[sess.user_name][day-1]:^12}\033[0m" for sess in users) - print(f"day {day:2} |{row}") - print(f"-------+{separator}") - print() - - show_year(None, args.year, 0) - - exit() - - def get_first_session(args): sessions = AocSession.get_cookie_sessions() @@ -481,9 +449,11 @@ def get_first_session(args): exit(2) -def get_languages(sols, year, year_dir, path_to_home): +def get_languages(sols, readme_dir: Path, rootdir: Path): files = [] + path_to_home = os.path.relpath(rootdir, readme_dir) + for lang, suffix, icon in ( ("Rust", ".rs", "rust"), ("Python", ".py", "python"), @@ -502,18 +472,16 @@ def get_languages(sols, year, year_dir, path_to_home): ("Linux Kernel", ".kernel", "kernel"), ): - files.extend( - f"[![{lang}]({path_to_home}/scripts/assets/{icon}.png)]({path_to_home}/{year}/{f.relative_to(year_dir)})" - for f in sols - if f.suffix == suffix - ) + for sol in sols: + if sol.suffix == suffix: + files.append(f"[![{lang}]({path_to_home}/scripts/assets/{icon}.png)]({sol.relative_to(readme_dir)})") sol_dir = sols[0].parent if sol_dir.name == "src": sol_dir = sol_dir.parent f = sol_dir / "README.md" if f.is_file(): - files.append(f"[🎁]({path_to_home}/{year}/{f.relative_to(year_dir)})") + files.append(f"[🎁]({f.relative_to(readme_dir)})") return " ".join(files) @@ -522,13 +490,15 @@ def make_readme(args): session = get_first_session(args) @AocSession.iter_all - def readme(_self, year, _day): + def readme(self, year, _day): + puzzles = [] now = datetime.now(UTC) for day in range(1, 26): available_date = datetime(year, 12, day, 5, 0, 0, 0, tzinfo=UTC) if available_date > now: continue + stars = session.get_stars(year, day) title = session.get_title(year, day) sols = session.get_solutions(year, day) @@ -538,6 +508,8 @@ def readme(_self, year, _day): rust = sum(1 for _, _, _, s in puzzles for f in s if f.suffix == ".rs") python = sum(1 for _, _, _, s in puzzles for f in s if f.suffix == ".py") + year_dir = self.year_dir(year) + md = [] md.append("# Advent of Code in Rust 🦀") md.append("") @@ -548,7 +520,7 @@ def readme(_self, year, _day): if python: md.append(f"![Python: {python}](https://img.shields.io/badge/Python-{python}-cyan?logo=Python)") md.append("") - md.append(f"## {year} ([Calendar](https://adventofcode.com/{year})) ([Solutions](../{year}/)) : {stars}⭐") + md.append(f"## {year} ([Calendar](https://adventofcode.com/{year})) ([Solutions](./)) : {stars}⭐") md.append("") width = max(len(title) for _, _, title, _ in puzzles) @@ -556,17 +528,15 @@ def readme(_self, year, _day): md.append(f"{'Puzzle':<{width}} | Stars | Languages") md.append("-" * width + " | ----- | -----------") - year_dir = session.rootdir / str(year) - for day, stars, title, sols in puzzles: if stars > 0: stars = "⭐" * stars - files = get_languages(sols, year, year_dir, "..") + files = get_languages(sols, year_dir, session.rootdir) md.append(f"{title:<{width}} | {stars:<2} | {files}") - bonus = Path(session.rootdir) / str(year) / ".bonus.md" + bonus = year_dir / ".bonus.md" if bonus.is_file(): md.append("") md.extend(bonus.read_text().strip().splitlines()) @@ -575,14 +545,14 @@ def readme(_self, year, _day): md = "\n".join(md) if args.write: - readme = Path(session.rootdir) / str(year) / "README.md" + readme = year_dir / "README.md" if not readme.is_file() or md != readme.read_text(): readme.write_text(md) print(f"{readme} written") else: print(md) - readme(None, args.year, 0) + readme(session, args.year, 0) def make_readme_main(args): @@ -591,7 +561,7 @@ def make_readme_main(args): puzzles = [] @AocSession.iter_all - def parse(_self, year, _day): + def parse(self, year, _day): now = datetime.now(UTC) for day in range(1, 26): available_date = datetime(year, 12, day, 5, 0, 0, 0, tzinfo=UTC) @@ -602,7 +572,7 @@ def parse(_self, year, _day): sols = session.get_solutions(year, day) puzzles.append((year, day, stars, title, sols)) - parse(None, None, 0) + parse(session, None, 0) stars = sum(n for _year, _day, n, _title, _sols in puzzles) # rust = sum(1 for _year, _day, _stars, _title, sols in puzzles for f in sols if f.suffix == ".rs") @@ -637,7 +607,7 @@ def parse(_self, year, _day): for year in sorted(all_stars.keys(), reverse=True): row = [ f"[Advent of Code {year}](https://adventofcode.com/{year})", - f"[Solutions]({year}/README.md)", + f"[Solutions]({session.year_dir(year).relative_to(session.rootdir)}/README.md)", f"{all_stars[year]:>3}⭐", f"{rust[year]:>3}", f"{python[year]:>3}", @@ -645,7 +615,7 @@ def parse(_self, year, _day): ] rows.append(" | ".join(row)) - readme = Path(__file__).parent.parent / "README.md" + readme = session.rootdir / "README.md" md = [] skip = False @@ -668,7 +638,7 @@ def parse(_self, year, _day): s = f"{year} | {len(bonus[year]):5} |" for b in bonus[year]: day = b.parent.stem.removeprefix("day") - s += f" [{day}]({b.relative_to(readme.parent)})" + s += f" [{day}]({b.relative_to(session.rootdir)})" md.append(s) md.append("") continue @@ -688,7 +658,7 @@ def parse(_self, year, _day): line = ( f"## {current_calendar} (current event)" f" ([Calendar](https://adventofcode.com/{current_calendar}))" - f" ([Solutions]({current_calendar}/)) :" + f" ([Solutions]({session.year_dir(year).relative_to(session.rootdir)}/)) :" f" {all_stars[current_calendar]}⭐" ) md.append(line) @@ -703,7 +673,6 @@ def parse(_self, year, _day): md.append(f"{'Puzzle':<{width}} | Stars | Languages") md.append("-" * width + " | ----- | -----------") - year_dir = session.rootdir / str(year) for year, day, stars, title, sols in puzzles: if year != current_calendar: continue @@ -711,7 +680,7 @@ def parse(_self, year, _day): if stars > 0: stars = "⭐" * stars - files = get_languages(sols, year, year_dir, ".") + files = get_languages(sols, session.rootdir, session.rootdir) md.append(f"{title:<{width}} | {stars:<2} | {files}") @@ -743,19 +712,14 @@ def parse(_self, year, _day): def main(): parser = argparse.ArgumentParser() parser.add_argument("-v", "--verbose", action="store_true", help="show request details") - parser.add_argument("-y", "--year", type=int, help="optional day, automatic if in ./\033[3mYEAR\033[0m") - parser.add_argument( - "-d", "--day", type=int, help="optional day, automatic if in ./\033[3mYEAR\033[0m/day\033[3mDAY\033[0m" - ) + parser.add_argument("-y", "--year", type=int, help="optional day") + parser.add_argument("-d", "--day", type=int, help="optional day") # parser.add_argument("-s", "--session", type=str, help="session cookie") parser.add_argument("--user", type=str, help="user") parser.add_argument("-u", "--update", action="store_true", help="force update") parser.add_argument("-n", "--dry-run", action="store_true", help="do nothing") - parser.add_argument("--dstars", action="store_true", help="show stars for each day") - parser.add_argument("--ystars", action="store_true", help="show stars by year") parser.add_argument("--yes", action="store_true", help="always yes") parser.add_argument("--inputs", action="store_true", help="download inputs") - parser.add_argument("--titles", action="store_true", help="set puzzle titles") parser.add_argument("--get-titles", action="store_true", help="get puzzle title") parser.add_argument("--readme", action="store_true", help="make readme") parser.add_argument("-w", "--write", action="store_true", help="write the readme") @@ -767,12 +731,12 @@ def main(): cwd = Path.cwd() if cwd.name.startswith("day") and args.day is None: - args.year = int(cwd.parent.name) + args.year = int(cwd.parent.name.removeprefix("year")) n = cwd.name.removeprefix("day") n = n[: n.find("_")] if "_" in n else n args.day = int(n) - if cwd.name.isdigit() and args.year is None: - args.year = int(cwd.name) + if cwd.name.startswith("year") and args.year is None: + args.year = int(cwd.name.removeprefix("year")) if args.readme: make_readme(args) @@ -783,13 +747,6 @@ def main(): session = get_first_session(args) session.get_titles(year=args.year, day=args.day) - elif args.titles: - session = get_first_session(args) - session.set_titles(year=args.year, day=args.day) - - elif args.dstars: - show_dstars(args) - else: for session in AocSession.get_cookie_sessions(): sess = AocSession(session, args.update, args.dry_run) @@ -799,10 +756,6 @@ def main(): if args.inputs: sess.get_input(year=args.year, day=args.day) - elif args.dstars: - sess.print_stars(year=args.year, day=args.day) - elif args.ystars: - sess.print_stars_year(args.year) else: sess.always_submit = args.yes sess.check(year=args.year, day=args.day) diff --git a/scripts/aoc.py b/scripts/aoc.py index eaedd1aa..b00dae45 100755 --- a/scripts/aoc.py +++ b/scripts/aoc.py @@ -163,13 +163,25 @@ def aoc_download(ctx: click.Context): @aoc.command(name="puzzle") +@click.option("-r", "--rust", is_flag=True, help="Create Rust stub") +@click.option("-p", "--python", is_flag=True, help="Create Python stub") +@click.option("-t", "--test", is_flag=True, help="Download input and test samples") @click.argument("day", type=int, default=0) @click.pass_context -def aoc_puzzle(ctx: click.Context, day: int): +def aoc_puzzle(ctx: click.Context, rust: bool, python: bool, test: bool, day: int): """ Get input and write templates. """ - ctx.obj.pass_thru("puzzle.sh", [str(day)]) + cmd = [] + if rust: + cmd.append("--rust") + if python: + cmd.append("--python") + if test: + cmd.append("--test") + if day > 0: + cmd.append(str(day)) + ctx.obj.pass_thru("puzzle.sh", cmd) @aoc.command(name="run", context_settings=dict(ignore_unknown_options=True, allow_extra_args=True)) diff --git a/scripts/bench.sh b/scripts/bench.sh deleted file mode 100755 index 05b090e1..00000000 --- a/scripts/bench.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -d=$(dirname $0) - -if [ -f /proc/cpuinfo ] ; then - cat /proc/cpuinfo > cpuinfo.txt -fi - -$d/runall.py -x 2019:25 -u me --no-slow --no-64 | tee results-fast-32-me -$d/runall.py -x 2019:25 -u me --no-slow | tee results-fast-me -$d/runall.py -x 2019:25 -u me | tee results-me -$d/runall.py -x 2019:25 --no-slow --no-64 | tee results-fast-32 -$d/runall.py -x 2019:25 --no-slow | tee results-fast -$d/runall.py -x 2019:25 | tee results - -if [ -f $d/../run.log ] ; then - cp $d/../run.log . -fi diff --git a/scripts/check.sh b/scripts/check.sh deleted file mode 100755 index c8b52796..00000000 --- a/scripts/check.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -script_dir=$(realpath $(dirname $0)) -opt_answers= - -usage() -{ - echo "Usage: $0 [options]" - echo "Options:" - echo " -a,--answers check answers too" - exit -} - -parse_args() -{ - for i ; do - case $i in - -h|--help) usage ;; - -a|--answers) opt_answers=1 ;; - *) usage ;; - esac - done -} - -c() -{ - local manifest=$1 - - cargo fmt --all --manifest-path $manifest -- - cargo fmt --all --manifest-path $manifest -- --check - cargo clippy --manifest-path $manifest -- --no-deps -W clippy::all - - cargo build --manifest-path $manifest --release - cargo test --manifest-path $manifest --release -} - -main() -{ - if [[ ! -f Cargo.toml ]] ; then - for manifest in `find . -maxdepth 2 -name Cargo.toml` ; do - c $manifest - done - else - c Cargo.toml - fi - - if [[ $opt_answers ]]; then - $script_dir/answers.py - fi -} - -parse_args "$@" -main diff --git a/scripts/puzzle.sh b/scripts/puzzle.sh index 38291937..6286c244 100755 --- a/scripts/puzzle.sh +++ b/scripts/puzzle.sh @@ -22,7 +22,7 @@ parse_args() -h|--help) usage ;; -r|--rs|--rust) features+=("rust") ;; -p|--py|--python) features+=("python") ;; - -c|--c) features+=("c") ;; + -t|--test) features+=("test_samples") ;; *) args+=$i ;; esac done @@ -30,8 +30,9 @@ parse_args() if [[ $(basename $PWD) =~ day* ]]; then day=$(basename $PWD) - day=${day/day/} + day=${day##day} year=$(basename $(realpath $PWD/..)) + year=${year##year} else if [ $# -eq 0 ]; then usage @@ -117,13 +118,11 @@ create_python() from pathlib import Path from argparse import ArgumentParser -import atexit -import time from copy import deepcopy from collections import defaultdict, deque, namedtuple, Counter -import sys, re, math, itertools, time, re from functools import reduce from operator import mul +import sys, re, math, itertools, time, atexit, re parser = ArgumentParser() parser.add_argument("-v", "--verbose", action="store_true") @@ -160,36 +159,38 @@ create_rust() cat <day$day.rs //! $title -struct Puzzle<'a> { - data: &'a str, +struct Puzzle { + // } -impl<'a> Puzzle<'a> { +impl Puzzle { /// Initialize from the puzzle input. - const fn new(data: &'a str) -> Self { - Self { data } + const fn new(data: &str) -> Self { + Self { } } /// Solve part one. - fn part1(&self) -> u64 { + fn part1(&self) -> i32 { 0 } /// Solve part two. - fn part2(&self) -> u64 { + fn part2(&self) -> i32 { 0 } } -fn main() { - let mut args = aoc::parse_args(); - - args.run(|data| { - let puzzle = Puzzle::new(data); - (puzzle.part1(), puzzle.part2()) - }); +/// # Panics +#[must_use] +pub fn solve(data: &str) -> (i32, i32) { + let puzzle = Puzzle::new(data); + (puzzle.part1(), puzzle.part2()) } +pub fn main() { + let args = aoc::parse_args(); + args.run(solve); +} #[cfg(test)] mod test { @@ -205,7 +206,6 @@ EOF EOF done - cat <>day$day.rs // #[test] @@ -216,8 +216,7 @@ EOF // #[test] // fn part2() { - // let data = aoc::load_input_data("test.txt"); - // let puzzle = Puzzle::new(data); + // let puzzle = Puzzle::new(TEST_INPUT); // assert_eq!(puzzle.part2(), 0); // } } @@ -233,7 +232,9 @@ version = "0.1.0" edition = "2021" [dependencies] -aoc = { path = "../../aoc" } +aoc = { path = "../../../crates/aoc" } +rustc-hash = "*" +itertools = "*" [[bin]] name = "day$day" @@ -242,17 +243,6 @@ EOF fi } -open_if_available() -{ - if [[ $available ]]; then - if [[ -f day$day.py ]]; then - code -n . day$day.py - else - code -n . - fi - open "https://adventofcode.com/$year/day/$day" - fi -} parse_args "$@" @@ -260,4 +250,3 @@ fetch_input fetch_samples create_python create_rust -# open_if_available diff --git a/scripts/runall.py b/scripts/runall.py index 92fe0939..d573fcb1 100755 --- a/scripts/runall.py +++ b/scripts/runall.py @@ -38,19 +38,19 @@ LANGUAGES = { - "Python": "{year}/day{day}/day{day}.py", - "Rust": "{year}/target/release/day{day}", - "C": "{year}/build/day{day}_c", - "C++": "{year}/build/day{day}_cpp", - "Lua": "{year}/day{day}/day{day}.lua", - "JavaScript": "{year}/day{day}/day{day}.js", - "Ruby": "{year}/day{day}/day{day}.rb", - "Perl": "{year}/day{day}/day{day}.pl", - "Bash": "{year}/day{day}/day{day}.sh", - "Java": "{year}/build/day{day}.class", - "Go": "{year}/build/day{day}_go", - "C#": "{year}/build/day{day}_cs.exe", - "Swift": "{year}/build/day{day}_swift", + "Rust": "src/year{year}/day{day}/day{day}.rs", + "Python": "src/year{year}/day{day}/day{day}.py", + "C": "src/year{year}/build/day{day}_c", + "C++": "src/year{year}/build/day{day}_cpp", + "Lua": "src/year{year}/day{day}/day{day}.lua", + "JavaScript": "src/year{year}/day{day}/day{day}.js", + "Ruby": "src/year{year}/day{day}/day{day}.rb", + "Perl": "src/year{year}/day{day}/day{day}.pl", + "Bash": "src/year{year}/day{day}/day{day}.sh", + "Java": "src/year{year}/build/day{day}.class", + "Go": "src/year{year}/build/day{day}_go", + "C#": "src/year{year}/build/day{day}_cs.exe", + "Swift": "src/year{year}/build/day{day}_swift", } INTERPRETERS = { @@ -154,30 +154,50 @@ def run( file: Path, expected: t.List, nb_expected: int, + year: int, + day: int, ) -> t.Dict[str, t.Any]: """ TODO """ - if prog.suffix == ".class": - cmd = ["java", "-cp", prog.parent, prog.stem] - elif prog.suffix == ".exe": - cmd = ["mono", prog.absolute().as_posix()] + if lang == "Rust": + + cmd = [] + + f = Path("src/year{year}/day{day}/day{day}/target/release/day{day}") + if f.is_file(): + cmd.append(f) + else: + cmd.append("target/release/one") + cmd.append("-r") + cmd.append(f"{year}:{day}") + else: - cmd = [prog.absolute().as_posix()] - # add the interpreter - if interpreter: - cmd.insert(0, interpreter) + if prog.suffix == ".class": + cmd = ["java", "-cp", prog.parent, prog.stem] + elif prog.suffix == ".exe": + cmd = ["mono", prog.absolute().as_posix()] + else: + cmd = [prog.absolute().as_posix()] + + # add the interpreter + if interpreter: + cmd.insert(0, interpreter) cmd.append(file.absolute().as_posix()) - cmd.append("--elapsed") + env = os.environ + env["NO_COLOR"] = "1" + cmdline = " ".join(map(str, cmd)) + cmdline = cmdline.replace(Path(__file__).parent.parent.as_posix() + "/", "") + cmdline = cmdline.replace(Path.home().as_posix(), "~") + print(f"{FEINT}{cmdline}{RESET}", end=CR) + start = time.time_ns() try: - env = os.environ - env["NO_COLOR"] = "1" out = subprocess.run(cmd, stdout=subprocess.PIPE, env=env) elapsed = time.time_ns() - start @@ -281,6 +301,16 @@ def build_all(filter_year: int, filter_lang: t.Iterable[str]): print(f"{FEINT}{ITALIC}cargo build {m}{RESET}", end=TRANSIENT) subprocess.check_call(["cargo", "build", "--manifest-path", m, "--release", "--quiet"], env=env_copy) + else: + m = Path(__file__).parent.parent / "Cargo.toml" + if m.is_file(): + env_copy = os.environ.copy() + # env_copy["RUSTFLAGS"] = "-C target-cpu=native" + print(f"{FEINT}{ITALIC}cargo build {m}{RESET}", end=TRANSIENT) + subprocess.check_call( + ["cargo", "build", "--manifest-path", m, "--release", "--quiet"], env=env_copy + ) + for day in range(1, 26): if not filter_lang or "c" in filter_lang: src = Path(str(year)) / f"day{day}" / f"day{day}.c" @@ -411,6 +441,7 @@ def run_day( results = set() for lang, (pattern, interpreter) in languages.items(): + prog = Path(pattern.format(year=year, day=mday)) key = ":".join(map(str, (year, day, crc, prog, lang.lower()))) @@ -418,6 +449,7 @@ def run_day( # special case for day13_alt/day13.py if "_" in prog.stem and prog.stem == prog.parent.name: prog = prog.with_stem(prog.stem[: prog.stem.find("_")]) + if not prog.is_file(): continue @@ -432,7 +464,7 @@ def run_day( nb_expected = 1 if day == 25 else 2 - e = run(prog, lang, interpreter, file, day_answers.get(crc), nb_expected) + e = run(prog, lang, interpreter, file, day_answers.get(crc), nb_expected, year, day) if e: update_cache(key, prog, "solutions", e) @@ -704,23 +736,6 @@ def main(): if args.consistency: return consistency(filter_year, filter_day) - # WTF ? why I have kept this ? get_languages() seems to do the job - # # resolve interpreters - # for lang, variants in INTERPRETERS.items(): - # for variant in list(variants.keys()): - # interpreters = variants[variant] - # if isinstance(interpreters, tuple) or isinstance(interpreters, list): - # for prog in interpreters: - # prog = shutil.which(prog) - # if prog: - # variants[variant] = prog - # break - # else: - # variants.pop(variant) - # else: - # if not shutil.which(interpreters): - # variants.pop(variant) - # prepare the language filtering filter_lang = set(map(str.casefold, args.language or ())) languages = get_languages(filter_lang) @@ -762,7 +777,10 @@ def main(): if filter_day and day not in filter_day: continue - for mday in list(Path(f"{year}").glob(f"day{day}")) + list(Path(f"{year}").glob(f"day{day}_*")): + day_solutions = list(Path(f"src/year{year}").glob(f"day{day}")) + day_solutions += Path(f"src/year{year}").glob(f"day{day}_*") + + for mday in day_solutions: mday = mday.name.removeprefix("day") elapsed, nb_samples = run_day( diff --git a/one/src/lib.rs b/src/lib.rs similarity index 85% rename from one/src/lib.rs rename to src/lib.rs index 76d6805d..58ded279 100644 --- a/one/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,7 @@ use std::iter::empty; +use itertools::Itertools; + /// Get the array of all available solutions. #[must_use] pub fn solutions() -> Vec { @@ -12,7 +14,9 @@ pub fn solutions() -> Vec { .chain(year2020()) .chain(year2021()) .chain(year2022()) + .chain(year2023()) .chain(year2024()) + .sorted_unstable_by_key(|sol| (sol.year, sol.day, sol.alt.is_some())) .collect() } @@ -24,6 +28,7 @@ pub fn solutions() -> Vec { pub struct Solution { pub year: u16, pub day: u8, + pub alt: Option, pub solve: fn(&str) -> (String, String), pub main: fn() -> (), } @@ -38,7 +43,10 @@ macro_rules! make_year { pub fn $year() -> Vec { vec![$({ let year = stringify!($year)[4..].parse().unwrap(); - let day = stringify!($day)[3..].parse().unwrap(); + let day = &stringify!($day)[3..]; + + let (day, alt) = day.split_once('_').map_or((day,None), |(day,alt)| (day,Some(alt.to_string())) ); + let day = day.parse().unwrap(); let solve = |data: &str| { use crate::$year::$day::$day::solve; @@ -51,7 +59,7 @@ macro_rules! make_year { main(); }; - Solution { year, day, solve, main } + Solution { year, day, alt, solve, main } },)*] } } @@ -74,7 +82,8 @@ make_year!(year2017 make_year!(year2018 day1,day2,day3,day4,day5,day6,day7,day8,day9,day10,day11,day12,day13, - day14,day15,day16,day17,day18,day19,day20,day21,day22,day23,day24,day25 + day14,day15,day16,day17,day18,day19,day20,day21,day22,day23,day24,day25, + day9_c,day23_z3 ); make_year!(year2019 @@ -94,7 +103,8 @@ make_year!(year2021 make_year!(year2022 day1,day2,day3,day4,day5,day6,day7,day8,day9,day10,day11,day12,day13, - day14,day15,day16,day17,day18,day19,day20,day21,day22,day23,day24,day25 + day14,day15,day16,day17,day18,day19,day20,day21,day22,day23,day24,day25, + day13_pest ); make_year!(year2023 @@ -104,5 +114,6 @@ make_year!(year2023 make_year!(year2024 day1,day2,day3,day4,day5,day6,day7,day8,day9,day10,day11,day12,day13, - day14,day15,day16,day17,day18,day19,day20,day21,day22,day23,day24,day25 + day14,day15,day16,day17,day18,day19,day20,day21,day22,day23,day24,day25, + day13_z3 ); diff --git a/one/src/main.rs b/src/main.rs similarity index 63% rename from one/src/main.rs rename to src/main.rs index 6f85c1ef..275b3c1f 100644 --- a/one/src/main.rs +++ b/src/main.rs @@ -1,16 +1,18 @@ use colored::Colorize; +use itertools::Itertools; use one::{solutions, Solution}; -use std::path::Path; +use std::os::unix::ffi::OsStrExt; +use std::path::{Path, PathBuf}; use std::time::{Duration, Instant}; fn main() -> std::io::Result<()> { + let args = aoc::parse_args_raw(); + // in a YEAR/dayDAY directory, we act as the standalone binary - if run_day()? { + if !args.has_option("-r") && !args.has_option("-l") && run_day()? { return Ok(()); } - let args = aoc::parse_args_raw(); - // get the year or year/day filter let mut year: Option = None; let mut day: Option = None; @@ -36,10 +38,19 @@ fn main() -> std::io::Result<()> { .cloned() .collect::>(); + // print list of solutions, can be filtered + if args.has_option("-l") { + for sol in &sols { + println!("Year {} day {:2} {:?}", sol.year, sol.day, sol.alt); + } + } // in raw mode (for runall.py) we need a file input path - if args.has_option("-r") { + else if args.has_option("-r") { + // remove alternative solutions, if any + let sols: Vec<_> = sols.iter().filter(|sol| sol.alt.is_none()).collect(); + if sols.len() != 1 { - println!("-r requires a filter"); + println!("-r requires a filter ({})", sols.len()); return Ok(()); } @@ -53,8 +64,11 @@ fn main() -> std::io::Result<()> { let sol = &sols[0]; args.run_data(sol.solve, &data); - } else { - run_all(&sols); + } + // else run all solutions + else { + let alt = args.has_option("-a"); + run_all(&sols, alt); } Ok(()) @@ -65,6 +79,11 @@ fn run_day() -> std::io::Result { if let Some(day) = path.file_name() { if let Some(day) = day.to_str().unwrap().strip_prefix("day") { + // + let (day, alt) = day + .split_once('_') + .map_or((day, None), |(day, alt)| (day, Some(alt.to_string()))); + if let Some(year) = path.parent() { if let Some(year) = year .file_name() @@ -77,7 +96,7 @@ fn run_day() -> std::io::Result { let day: u8 = day.parse().unwrap(); for sol in &solutions() { - if sol.day == day && sol.year == year { + if sol.day == day && sol.year == year && sol.alt == alt { (sol.main)(); break; } @@ -111,7 +130,54 @@ fn print_part_result(part: u8, answer: &str, ok: &str, day: u8) { } } -fn run_all(sols: &[Solution]) { +fn find_path(sol: &Solution) -> PathBuf { + let hint = Path::new("input") + .join(sol.year.to_string()) + .join(sol.day.to_string()) + .with_extension("in"); + + let mut path = hint.clone(); + + if !path.is_file() { + path = Path::new("input") + .join(sol.year.to_string()) + .join(format!("day{}", sol.day)) + .with_extension("txt"); + } + + if !path.is_file() { + let manifest_dir = std::env::var("CARGO_MANIFEST_DIR") + .ok() + .unwrap_or_else(|| ".".to_string()); + + let data_dir = Path::new(&manifest_dir).join("data"); + + if let Ok(data_dir) = std::fs::read_dir(data_dir) { + let user_sol = data_dir + .filter_map(std::result::Result::ok) + .filter(|f| f.path().is_dir()) + .filter(|f| f.file_name().as_bytes().iter().all(u8::is_ascii_digit)) + .sorted_by_key(std::fs::DirEntry::file_name) + .next(); + + if let Some(user_sol) = user_sol { + path = user_sol + .path() + .join(sol.year.to_string()) + .join(sol.day.to_string()) + .with_extension("in"); + } + } + } + + if path.is_file() { + path + } else { + hint + } +} + +fn run_all(sols: &[Solution], alt: bool) { println!("💫 {} 🎄✨ 💫", "Advent of Code".green()); let mut total_elapsed = Duration::ZERO; @@ -120,15 +186,24 @@ fn run_all(sols: &[Solution]) { let mut failed = 0; for sol in sols { - let path = Path::new("input") - .join(sol.year.to_string()) - .join(sol.day.to_string()) - .with_extension("in"); + if sol.alt.is_some() && !alt { + continue; + } + + // if sol.alt.is_none() { + // continue; + // } + + let path = find_path(sol); let ok = path.with_extension("ok"); println!(); - println!("{} day {}:", sol.year, sol.day); + if let Some(alt) = &sol.alt { + println!("{} day {} ({}):", sol.year, sol.day, alt.magenta()); + } else { + println!("{} day {}:", sol.year, sol.day); + } if path.is_file() { if let Ok(data) = std::fs::read_to_string(&path) { diff --git a/src/year2015/README.md b/src/year2015/README.md new file mode 100644 index 00000000..ee67ec46 --- /dev/null +++ b/src/year2015/README.md @@ -0,0 +1,36 @@ +# Advent of Code in Rust 🦀 + +![AoC2015](https://img.shields.io/badge/Advent_of_Code-2015-8A2BE2) +![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) +![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) +![Python: 5](https://img.shields.io/badge/Python-5-cyan?logo=Python) + +## 2015 ([Calendar](https://adventofcode.com/2015)) ([Solutions](./)) : 50⭐ + +Puzzle | Stars | Languages +------------------------------------------------------------------------------------ | ----- | ----------- +[Day 1: Not Quite Lisp](https://adventofcode.com/2015/day/1) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day1/day1.rs) +[Day 2: I Was Told There Would Be No Math](https://adventofcode.com/2015/day/2) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day2/day2.rs) +[Day 3: Perfectly Spherical Houses in a Vacuum](https://adventofcode.com/2015/day/3) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day3/day3.rs) +[Day 4: The Ideal Stocking Stuffer](https://adventofcode.com/2015/day/4) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day4/day4.rs) +[Day 5: Doesn't He Have Intern-Elves For This?](https://adventofcode.com/2015/day/5) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day5/day5.rs) +[Day 6: Probably a Fire Hazard](https://adventofcode.com/2015/day/6) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day6/day6.rs) +[Day 7: Some Assembly Required](https://adventofcode.com/2015/day/7) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day7/day7.rs) +[Day 8: Matchsticks](https://adventofcode.com/2015/day/8) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day8/day8.rs) +[Day 9: All in a Single Night](https://adventofcode.com/2015/day/9) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day9/day9.rs) +[Day 10: Elves Look, Elves Say](https://adventofcode.com/2015/day/10) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day10/day10.rs) +[Day 11: Corporate Policy](https://adventofcode.com/2015/day/11) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day11/day11.rs) +[Day 12: JSAbacusFramework.io](https://adventofcode.com/2015/day/12) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day12/day12.rs) +[Day 13: Knights of the Dinner Table](https://adventofcode.com/2015/day/13) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day13/day13.rs) [![Python](../../scripts/assets/python.png)](day13/day13.py) +[Day 14: Reindeer Olympics](https://adventofcode.com/2015/day/14) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day14/day14.rs) +[Day 15: Science for Hungry People](https://adventofcode.com/2015/day/15) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day15/day15.rs) +[Day 16: Aunt Sue](https://adventofcode.com/2015/day/16) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day16/day16.rs) [![Python](../../scripts/assets/python.png)](day16/day16.py) +[Day 17: No Such Thing as Too Much](https://adventofcode.com/2015/day/17) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day17/day17.rs) +[Day 18: Like a GIF For Your Yard](https://adventofcode.com/2015/day/18) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day18/day18.rs) [🎁](day18/README.md) +[Day 19: Medicine for Rudolph](https://adventofcode.com/2015/day/19) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day19/day19.rs) +[Day 20: Infinite Elves and Infinite Houses](https://adventofcode.com/2015/day/20) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day20/day20.rs) +[Day 21: RPG Simulator 20XX](https://adventofcode.com/2015/day/21) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day21/day21.rs) [![Python](../../scripts/assets/python.png)](day21/day21.py) +[Day 22: Wizard Simulator 20XX](https://adventofcode.com/2015/day/22) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day22/day22.rs) +[Day 23: Opening the Turing Lock](https://adventofcode.com/2015/day/23) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day23/day23.rs) [![Python](../../scripts/assets/python.png)](day23/day23.py) +[Day 24: It Hangs in the Balance](https://adventofcode.com/2015/day/24) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day24/day24.rs) [![Python](../../scripts/assets/python.png)](day24/day24.py) +[Day 25: Let It Snow](https://adventofcode.com/2015/day/25) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day25/day25.rs) diff --git a/2015/day1/day1.rs b/src/year2015/day1/day1.rs similarity index 100% rename from 2015/day1/day1.rs rename to src/year2015/day1/day1.rs diff --git a/2015/day10/day10.rs b/src/year2015/day10/day10.rs similarity index 96% rename from 2015/day10/day10.rs rename to src/year2015/day10/day10.rs index 2c9d4df8..8fe811fd 100644 --- a/2015/day10/day10.rs +++ b/src/year2015/day10/day10.rs @@ -1,13 +1,11 @@ //! [Day 10: Elves Look, Elves Say](https://adventofcode.com/2015/day/10) -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let data = data.trim_ascii(); diff --git a/2015/day11/day11.rs b/src/year2015/day11/day11.rs similarity index 98% rename from 2015/day11/day11.rs rename to src/year2015/day11/day11.rs index 71e26059..45b72d81 100644 --- a/2015/day11/day11.rs +++ b/src/year2015/day11/day11.rs @@ -91,7 +91,6 @@ impl fmt::Display for Password { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (Password, Password) { let mut pwd: Password = Password::new(data.trim_ascii()); @@ -99,7 +98,6 @@ pub fn solve(data: &str) -> (Password, Password) { (pwd.next_valid(), pwd.next_valid()) } -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); diff --git a/2015/day12/day12.rs b/src/year2015/day12/day12.rs similarity index 97% rename from 2015/day12/day12.rs rename to src/year2015/day12/day12.rs index 579cc7cb..3728fe5b 100644 --- a/2015/day12/day12.rs +++ b/src/year2015/day12/day12.rs @@ -3,14 +3,12 @@ use regex::Regex; use serde_json::Value; -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { (part1(data), part2(data)) diff --git a/2015/day13/day13.py b/src/year2015/day13/day13.py similarity index 100% rename from 2015/day13/day13.py rename to src/year2015/day13/day13.py diff --git a/2015/day13/day13.rs b/src/year2015/day13/day13.rs similarity index 97% rename from 2015/day13/day13.rs rename to src/year2015/day13/day13.rs index 49b316f7..7f677958 100644 --- a/2015/day13/day13.rs +++ b/src/year2015/day13/day13.rs @@ -25,7 +25,6 @@ fn calc<'a>(names: &FxHashSet<&'a str>, happiness: &FxHashMap<(&'a str, &'a str) } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let mut names: FxHashSet<&str> = FxHashSet::default(); @@ -66,7 +65,6 @@ pub fn solve(data: &str) -> (i32, i32) { (part1, part2) } -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); diff --git a/2015/day13/test.txt b/src/year2015/day13/test.txt similarity index 100% rename from 2015/day13/test.txt rename to src/year2015/day13/test.txt diff --git a/2015/day14/day14.rs b/src/year2015/day14/day14.rs similarity index 99% rename from 2015/day14/day14.rs rename to src/year2015/day14/day14.rs index f1e689df..4df64602 100644 --- a/2015/day14/day14.rs +++ b/src/year2015/day14/day14.rs @@ -81,7 +81,6 @@ fn solve_duration(data: &str, max_duration: u32) -> (u32, u32) { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { solve_duration(data, 2503) diff --git a/2015/day14/test.txt b/src/year2015/day14/test.txt similarity index 100% rename from 2015/day14/test.txt rename to src/year2015/day14/test.txt diff --git a/2015/day15/day15.rs b/src/year2015/day15/day15.rs similarity index 98% rename from 2015/day15/day15.rs rename to src/year2015/day15/day15.rs index 80616605..4258f405 100644 --- a/2015/day15/day15.rs +++ b/src/year2015/day15/day15.rs @@ -13,7 +13,6 @@ struct Ingredient { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { // load data @@ -108,7 +107,6 @@ pub fn solve(data: &str) -> (i64, i64) { (score(1), score(2)) } -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); diff --git a/2015/day15/test.txt b/src/year2015/day15/test.txt similarity index 100% rename from 2015/day15/test.txt rename to src/year2015/day15/test.txt diff --git a/2015/day16/day16.py b/src/year2015/day16/day16.py similarity index 100% rename from 2015/day16/day16.py rename to src/year2015/day16/day16.py diff --git a/2015/day16/day16.rs b/src/year2015/day16/day16.rs similarity index 99% rename from 2015/day16/day16.rs rename to src/year2015/day16/day16.rs index 3a9304e1..ca27dfc4 100644 --- a/2015/day16/day16.rs +++ b/src/year2015/day16/day16.rs @@ -66,7 +66,6 @@ impl<'a> Puzzle<'a> { } } -/// main function #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2015/day17/day17.rs b/src/year2015/day17/day17.rs similarity index 96% rename from 2015/day17/day17.rs rename to src/year2015/day17/day17.rs index dd56aa67..730b56ad 100644 --- a/2015/day17/day17.rs +++ b/src/year2015/day17/day17.rs @@ -3,14 +3,12 @@ use itertools::Itertools; use rustc_hash::FxHashMap; -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, usize) { solve_eggnot(data, 150) diff --git a/2015/day17/test.txt b/src/year2015/day17/test.txt similarity index 100% rename from 2015/day17/test.txt rename to src/year2015/day17/test.txt diff --git a/2015/day18/README.md b/src/year2015/day18/README.md similarity index 100% rename from 2015/day18/README.md rename to src/year2015/day18/README.md diff --git a/2015/day18/anim.sh b/src/year2015/day18/anim.sh similarity index 100% rename from 2015/day18/anim.sh rename to src/year2015/day18/anim.sh diff --git a/2015/day18/anim1.gif b/src/year2015/day18/anim1.gif similarity index 100% rename from 2015/day18/anim1.gif rename to src/year2015/day18/anim1.gif diff --git a/2015/day18/anim2.gif b/src/year2015/day18/anim2.gif similarity index 100% rename from 2015/day18/anim2.gif rename to src/year2015/day18/anim2.gif diff --git a/2015/day18/day18.rs b/src/year2015/day18/day18.rs similarity index 99% rename from 2015/day18/day18.rs rename to src/year2015/day18/day18.rs index f08e6333..52de5d88 100644 --- a/2015/day18/day18.rs +++ b/src/year2015/day18/day18.rs @@ -3,14 +3,12 @@ type Grid = [[u8; 100]; 100]; const STEPS: u32 = 100; -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { (part1(data), part2(data)) diff --git a/2015/day18/demo.txt b/src/year2015/day18/demo.txt similarity index 100% rename from 2015/day18/demo.txt rename to src/year2015/day18/demo.txt diff --git a/2015/day19/day19.rs b/src/year2015/day19/day19.rs similarity index 99% rename from 2015/day19/day19.rs rename to src/year2015/day19/day19.rs index c54af16d..4a59447f 100644 --- a/2015/day19/day19.rs +++ b/src/year2015/day19/day19.rs @@ -98,7 +98,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2015/day19/sample_1.txt b/src/year2015/day19/sample_1.txt similarity index 100% rename from 2015/day19/sample_1.txt rename to src/year2015/day19/sample_1.txt diff --git a/2015/day19/sample_2.txt b/src/year2015/day19/sample_2.txt similarity index 100% rename from 2015/day19/sample_2.txt rename to src/year2015/day19/sample_2.txt diff --git a/2015/day2/day2.rs b/src/year2015/day2/day2.rs similarity index 97% rename from 2015/day2/day2.rs rename to src/year2015/day2/day2.rs index 101d8280..1688c5ca 100644 --- a/2015/day2/day2.rs +++ b/src/year2015/day2/day2.rs @@ -1,7 +1,6 @@ //! [Day 2: I Was Told There Would Be No Math](https://adventofcode.com/2015/day/2) /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let mut total_paper = 0; @@ -45,7 +44,6 @@ pub fn solve(data: &str) -> (u32, u32) { (total_paper, total_ribbon) } -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); diff --git a/2015/day20/day20.rs b/src/year2015/day20/day20.rs similarity index 99% rename from 2015/day20/day20.rs rename to src/year2015/day20/day20.rs index aa177c9b..9763febc 100644 --- a/2015/day20/day20.rs +++ b/src/year2015/day20/day20.rs @@ -68,7 +68,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2015/day21/day21.py b/src/year2015/day21/day21.py similarity index 100% rename from 2015/day21/day21.py rename to src/year2015/day21/day21.py diff --git a/2015/day21/day21.rs b/src/year2015/day21/day21.rs similarity index 99% rename from 2015/day21/day21.rs rename to src/year2015/day21/day21.rs index 77f64268..fab4e810 100644 --- a/2015/day21/day21.rs +++ b/src/year2015/day21/day21.rs @@ -153,7 +153,6 @@ Defense +3 80 0 3 } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let mut boss = Character::new("boss", 0, 0, 0); diff --git a/2015/day22/day22.rs b/src/year2015/day22/day22.rs similarity index 99% rename from 2015/day22/day22.rs rename to src/year2015/day22/day22.rs index 8e9d5d31..34fa6ad0 100644 --- a/2015/day22/day22.rs +++ b/src/year2015/day22/day22.rs @@ -212,7 +212,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let puzzle = Puzzle::new(data); diff --git a/2015/day23/day23.py b/src/year2015/day23/day23.py similarity index 100% rename from 2015/day23/day23.py rename to src/year2015/day23/day23.py diff --git a/2015/day23/day23.rs b/src/year2015/day23/day23.rs similarity index 99% rename from 2015/day23/day23.rs rename to src/year2015/day23/day23.rs index 048796f6..c879f7aa 100644 --- a/2015/day23/day23.rs +++ b/src/year2015/day23/day23.rs @@ -111,7 +111,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2015/day23/test.txt b/src/year2015/day23/test.txt similarity index 100% rename from 2015/day23/test.txt rename to src/year2015/day23/test.txt diff --git a/2015/day24/day24.py b/src/year2015/day24/day24.py similarity index 100% rename from 2015/day24/day24.py rename to src/year2015/day24/day24.py diff --git a/2015/day24/day24.rs b/src/year2015/day24/day24.rs similarity index 98% rename from 2015/day24/day24.rs rename to src/year2015/day24/day24.rs index 3a432dfa..b26f6515 100644 --- a/2015/day24/day24.rs +++ b/src/year2015/day24/day24.rs @@ -43,7 +43,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2015/day24/test.txt b/src/year2015/day24/test.txt similarity index 100% rename from 2015/day24/test.txt rename to src/year2015/day24/test.txt diff --git a/2015/day25/day25.rs b/src/year2015/day25/day25.rs similarity index 97% rename from 2015/day25/day25.rs rename to src/year2015/day25/day25.rs index 91a96d4a..022e8315 100644 --- a/2015/day25/day25.rs +++ b/src/year2015/day25/day25.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, aoc::Christmas) { let (row, column) = read_data(data); diff --git a/2015/day3/day3.rs b/src/year2015/day3/day3.rs similarity index 97% rename from 2015/day3/day3.rs rename to src/year2015/day3/day3.rs index c5e06851..b68937a7 100644 --- a/2015/day3/day3.rs +++ b/src/year2015/day3/day3.rs @@ -2,14 +2,12 @@ use rustc_hash::FxHashSet; -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let line = data.trim_ascii(); diff --git a/2015/day4/day4.rs b/src/year2015/day4/day4.rs similarity index 97% rename from 2015/day4/day4.rs rename to src/year2015/day4/day4.rs index 0437e9d8..d0370d19 100644 --- a/2015/day4/day4.rs +++ b/src/year2015/day4/day4.rs @@ -1,6 +1,5 @@ //! [Day 4: The Ideal Stocking Stuffer](https://adventofcode.com/2015/day/4) -/// main function pub fn main() { let args = aoc::parse_args(); @@ -8,7 +7,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let mut secret = [0u8; 32]; diff --git a/2015/day4/demo.txt b/src/year2015/day4/demo.txt similarity index 100% rename from 2015/day4/demo.txt rename to src/year2015/day4/demo.txt diff --git a/2015/day5/day5.rs b/src/year2015/day5/day5.rs similarity index 97% rename from 2015/day5/day5.rs rename to src/year2015/day5/day5.rs index 151b95fc..0a50996a 100644 --- a/2015/day5/day5.rs +++ b/src/year2015/day5/day5.rs @@ -1,13 +1,11 @@ //! [Day 5: Doesn't He Have Intern-Elves For This?](https://adventofcode.com/2015/day/5) -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { (part1(data), part2(data)) diff --git a/2015/day6/day6.rs b/src/year2015/day6/day6.rs similarity index 98% rename from 2015/day6/day6.rs rename to src/year2015/day6/day6.rs index 721ddba8..37018076 100644 --- a/2015/day6/day6.rs +++ b/src/year2015/day6/day6.rs @@ -2,14 +2,12 @@ use regex::Regex; -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let data = data.lines().collect::>(); diff --git a/2015/day7/day7.rs b/src/year2015/day7/day7.rs similarity index 98% rename from 2015/day7/day7.rs rename to src/year2015/day7/day7.rs index 2f7c2474..08efcb50 100644 --- a/2015/day7/day7.rs +++ b/src/year2015/day7/day7.rs @@ -109,7 +109,6 @@ fn wires(parser: &Parser, opcodes: &FxHashMap, wire: &str) -> u1 } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u16, u16) { let parser = Parser::new(); @@ -132,7 +131,6 @@ pub fn solve(data: &str) -> (u16, u16) { (wire_a, wire_a_bis) } -/// main function pub fn main() { let args = aoc::parse_args(); diff --git a/2015/day7/demo.txt b/src/year2015/day7/demo.txt similarity index 100% rename from 2015/day7/demo.txt rename to src/year2015/day7/demo.txt diff --git a/2015/day8/day8.rs b/src/year2015/day8/day8.rs similarity index 97% rename from 2015/day8/day8.rs rename to src/year2015/day8/day8.rs index a3df6c28..642649cc 100644 --- a/2015/day8/day8.rs +++ b/src/year2015/day8/day8.rs @@ -1,13 +1,11 @@ //! [Day 8: Matchsticks](https://adventofcode.com/2015/day/8) -/// main function pub fn main() { let args = aoc::parse_args(); args.run(solve); } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let mut total_raw = 0; diff --git a/2015/day8/test.txt b/src/year2015/day8/test.txt similarity index 100% rename from 2015/day8/test.txt rename to src/year2015/day8/test.txt diff --git a/2015/day9/day9.rs b/src/year2015/day9/day9.rs similarity index 97% rename from 2015/day9/day9.rs rename to src/year2015/day9/day9.rs index 56112ca6..d6d0b576 100644 --- a/2015/day9/day9.rs +++ b/src/year2015/day9/day9.rs @@ -5,14 +5,12 @@ use regex::Regex; use rustc_hash::{FxHashMap, FxHashSet}; /// # Panics -/// over malformed input pub fn main() { let args = aoc::parse_args(); args.run(solve); } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let mut places: FxHashSet = FxHashSet::default(); diff --git a/2015/day9/test.txt b/src/year2015/day9/test.txt similarity index 100% rename from 2015/day9/test.txt rename to src/year2015/day9/test.txt diff --git a/src/year2016/.bonus.md b/src/year2016/.bonus.md new file mode 100644 index 00000000..b2690c6c --- /dev/null +++ b/src/year2016/.bonus.md @@ -0,0 +1,3 @@ +## Bonus + +[Assembunny assembler](../../crates/assembunny/assembler/asm.py) \ No newline at end of file diff --git a/2016/.rustfmt.toml b/src/year2016/.rustfmt.toml similarity index 100% rename from 2016/.rustfmt.toml rename to src/year2016/.rustfmt.toml diff --git a/src/year2016/README.md b/src/year2016/README.md new file mode 100644 index 00000000..5fd15712 --- /dev/null +++ b/src/year2016/README.md @@ -0,0 +1,39 @@ +# Advent of Code in Rust 🦀 + +![AoC2016](https://img.shields.io/badge/Advent_of_Code-2016-8A2BE2) +![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) +![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) + +## 2016 ([Calendar](https://adventofcode.com/2016)) ([Solutions](./)) : 50⭐ + +Puzzle | Stars | Languages +-------------------------------------------------------------------------------------- | ----- | ----------- +[Day 1: No Time for a Taxicab](https://adventofcode.com/2016/day/1) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day1/day1.rs) +[Day 2: Bathroom Security](https://adventofcode.com/2016/day/2) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day2/day2.rs) +[Day 3: Squares With Three Sides](https://adventofcode.com/2016/day/3) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day3/day3.rs) +[Day 4: Security Through Obscurity](https://adventofcode.com/2016/day/4) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day4/day4.rs) +[Day 5: How About a Nice Game of Chess?](https://adventofcode.com/2016/day/5) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day5/day5.rs) +[Day 6: Signals and Noise](https://adventofcode.com/2016/day/6) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day6/day6.rs) +[Day 7: Internet Protocol Version 7](https://adventofcode.com/2016/day/7) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day7/day7.rs) +[Day 8: Two-Factor Authentication](https://adventofcode.com/2016/day/8) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day8/day8.rs) +[Day 9: Explosives in Cyberspace](https://adventofcode.com/2016/day/9) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day9/day9.rs) +[Day 10: Balance Bots](https://adventofcode.com/2016/day/10) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day10/day10.rs) +[Day 11: Radioisotope Thermoelectric Generators](https://adventofcode.com/2016/day/11) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day11/day11.rs) +[Day 12: Leonardo's Monorail](https://adventofcode.com/2016/day/12) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day12/day12.rs) +[Day 13: A Maze of Twisty Little Cubicles](https://adventofcode.com/2016/day/13) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day13/day13.rs) +[Day 14: One-Time Pad](https://adventofcode.com/2016/day/14) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day14/day14.rs) +[Day 15: Timing is Everything](https://adventofcode.com/2016/day/15) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day15/day15.rs) +[Day 16: Dragon Checksum](https://adventofcode.com/2016/day/16) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day16/day16.rs) +[Day 17: Two Steps Forward](https://adventofcode.com/2016/day/17) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day17/day17.rs) +[Day 18: Like a Rogue](https://adventofcode.com/2016/day/18) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day18/day18.rs) +[Day 19: An Elephant Named Joseph](https://adventofcode.com/2016/day/19) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day19/day19.rs) +[Day 20: Firewall Rules](https://adventofcode.com/2016/day/20) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day20/day20.rs) +[Day 21: Scrambled Letters and Hash](https://adventofcode.com/2016/day/21) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day21/day21.rs) +[Day 22: Grid Computing](https://adventofcode.com/2016/day/22) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day22/day22.rs) +[Day 23: Safe Cracking](https://adventofcode.com/2016/day/23) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day23/day23.rs) +[Day 24: Air Duct Spelunking](https://adventofcode.com/2016/day/24) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day24/day24.rs) +[Day 25: Clock Signal](https://adventofcode.com/2016/day/25) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day25/day25.rs) + +## Bonus + +[Assembunny assembler](../2016/assembunny/assembler/asm.py) diff --git a/2016/day1/day1.rs b/src/year2016/day1/day1.rs similarity index 98% rename from 2016/day1/day1.rs rename to src/year2016/day1/day1.rs index 0ba22e81..da0ae365 100644 --- a/2016/day1/day1.rs +++ b/src/year2016/day1/day1.rs @@ -8,7 +8,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let mut x = 0_i32; diff --git a/2016/day10/day10.rs b/src/year2016/day10/day10.rs similarity index 99% rename from 2016/day10/day10.rs rename to src/year2016/day10/day10.rs index 1a7456ec..c32a477c 100644 --- a/2016/day10/day10.rs +++ b/src/year2016/day10/day10.rs @@ -43,7 +43,6 @@ struct BotInstruction { /// First, it loads the move instructions and initializes the bots. /// Then, it runs the instructions until the puzzle is done. /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let re_init = Regex::new(r"value ([\d]+) goes to bot (\d+)").unwrap(); diff --git a/2016/day11/day11.rs b/src/year2016/day11/day11.rs similarity index 99% rename from 2016/day11/day11.rs rename to src/year2016/day11/day11.rs index 99b611d5..e00e8785 100644 --- a/2016/day11/day11.rs +++ b/src/year2016/day11/day11.rs @@ -214,7 +214,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2016/day11/test.txt b/src/year2016/day11/test.txt similarity index 100% rename from 2016/day11/test.txt rename to src/year2016/day11/test.txt diff --git a/2016/day12/day12.rs b/src/year2016/day12/day12.rs similarity index 95% rename from 2016/day12/day12.rs rename to src/year2016/day12/day12.rs index 50c6802a..ffe3a4c6 100644 --- a/2016/day12/day12.rs +++ b/src/year2016/day12/day12.rs @@ -12,7 +12,6 @@ fn run_program(bunny_vm: &mut BunnyVM, c: i32) -> i32 { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let mut bunny_vm = BunnyVM::new(data); diff --git a/2016/day13/day13.rs b/src/year2016/day13/day13.rs similarity index 99% rename from 2016/day13/day13.rs rename to src/year2016/day13/day13.rs index 2c464abc..fa58f0a2 100644 --- a/2016/day13/day13.rs +++ b/src/year2016/day13/day13.rs @@ -99,7 +99,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2016/day14/day14.rs b/src/year2016/day14/day14.rs similarity index 99% rename from 2016/day14/day14.rs rename to src/year2016/day14/day14.rs index a5595469..d1e3e0b8 100644 --- a/2016/day14/day14.rs +++ b/src/year2016/day14/day14.rs @@ -9,7 +9,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { (find_key(data, 0), find_key(data, 2016)) diff --git a/2016/day15/day15.rs b/src/year2016/day15/day15.rs similarity index 97% rename from 2016/day15/day15.rs rename to src/year2016/day15/day15.rs index 6bdb24fd..a75657a6 100644 --- a/2016/day15/day15.rs +++ b/src/year2016/day15/day15.rs @@ -8,7 +8,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let mut discs = Vec::new(); diff --git a/2016/day16/day16.rs b/src/year2016/day16/day16.rs similarity index 98% rename from 2016/day16/day16.rs rename to src/year2016/day16/day16.rs index cd05feca..7a3d49c6 100644 --- a/2016/day16/day16.rs +++ b/src/year2016/day16/day16.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, String) { let data = data.trim_ascii(); diff --git a/2016/day17/day17.rs b/src/year2016/day17/day17.rs similarity index 99% rename from 2016/day17/day17.rs rename to src/year2016/day17/day17.rs index c2df9ea9..0125241c 100644 --- a/2016/day17/day17.rs +++ b/src/year2016/day17/day17.rs @@ -124,7 +124,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, u32) { let puzzle = Puzzle::new(data); diff --git a/2016/day18/day18.rs b/src/year2016/day18/day18.rs similarity index 98% rename from 2016/day18/day18.rs rename to src/year2016/day18/day18.rs index dbe912e8..e4a2f075 100644 --- a/2016/day18/day18.rs +++ b/src/year2016/day18/day18.rs @@ -51,7 +51,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2016/day19/day19.rs b/src/year2016/day19/day19.rs similarity index 98% rename from 2016/day19/day19.rs rename to src/year2016/day19/day19.rs index 2e378cd8..1929108e 100644 --- a/2016/day19/day19.rs +++ b/src/year2016/day19/day19.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let elves = data.trim_ascii().parse().unwrap(); diff --git a/2016/day2/day2.rs b/src/year2016/day2/day2.rs similarity index 99% rename from 2016/day2/day2.rs rename to src/year2016/day2/day2.rs index b6b96573..5f526b06 100644 --- a/2016/day2/day2.rs +++ b/src/year2016/day2/day2.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, String) { (part1(data), part2(data)) diff --git a/2016/day2/test.txt b/src/year2016/day2/test.txt similarity index 100% rename from 2016/day2/test.txt rename to src/year2016/day2/test.txt diff --git a/2016/day20/day20.rs b/src/year2016/day20/day20.rs similarity index 98% rename from 2016/day20/day20.rs rename to src/year2016/day20/day20.rs index 92ce373c..f6f5f205 100644 --- a/2016/day20/day20.rs +++ b/src/year2016/day20/day20.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { // load the blacklist and sort it ascending diff --git a/2016/day21/day21.rs b/src/year2016/day21/day21.rs similarity index 99% rename from 2016/day21/day21.rs rename to src/year2016/day21/day21.rs index 528b8fd5..6182df32 100644 --- a/2016/day21/day21.rs +++ b/src/year2016/day21/day21.rs @@ -175,7 +175,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, String) { let puzzle = Puzzle::new(data); diff --git a/2016/day22/day22.rs b/src/year2016/day22/day22.rs similarity index 99% rename from 2016/day22/day22.rs rename to src/year2016/day22/day22.rs index 4074ee01..e42d932c 100644 --- a/2016/day22/day22.rs +++ b/src/year2016/day22/day22.rs @@ -110,7 +110,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, u32) { let puzzle = Puzzle::new(data); diff --git a/2016/day22/sample_1.txt b/src/year2016/day22/sample_1.txt similarity index 100% rename from 2016/day22/sample_1.txt rename to src/year2016/day22/sample_1.txt diff --git a/2016/day23/day23.rs b/src/year2016/day23/day23.rs similarity index 97% rename from 2016/day23/day23.rs rename to src/year2016/day23/day23.rs index 2994d45a..462bfe89 100644 --- a/2016/day23/day23.rs +++ b/src/year2016/day23/day23.rs @@ -24,7 +24,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(program: &str) -> (i32, i32) { let part1 = compute_until_safe(7, program); diff --git a/2016/day24/day24.rs b/src/year2016/day24/day24.rs similarity index 61% rename from 2016/day24/day24.rs rename to src/year2016/day24/day24.rs index 67281d5a..8e8461f5 100644 --- a/2016/day24/day24.rs +++ b/src/year2016/day24/day24.rs @@ -1,51 +1,55 @@ //! [Day 24: Air Duct Spelunking](https://adventofcode.com/2016/day/24) -#![allow(clippy::cast_possible_truncation)] -#![allow(clippy::cast_possible_wrap)] - use itertools::Itertools; use rustc_hash::FxHashSet; use std::collections::VecDeque; +fn digit_usize(c: u8) -> Option { + match c { + b'0'..=b'9' => Some(usize::from(c - b'0')), + _ => None, + } +} + struct Puzzle { - grid: aoc::Grid, + grid: aoc::GridU, } impl Puzzle { fn new(data: &str) -> Self { Self { - grid: aoc::Grid::::parse(data), + grid: aoc::GridU::::parse(data), } } - fn solve(&self) -> (u32, u32) { + fn solve(&self) -> (usize, usize) { let mut points = vec![]; - for (xy, c) in &self.grid { + for (xy, c) in self.grid.iter() { if c.is_ascii_digit() { points.push(xy); } } let n = points.len(); - let mut distances = aoc::Grid::::with_size(n as i32, n as i32, 0, 0); + let mut distances = aoc::GridU::::with_size(n, n); for &start in &points { - let from = self.grid[start].to_digit(10).unwrap(); + let from = digit_usize(self.grid[start]).unwrap(); let mut seen = FxHashSet::default(); let mut q = VecDeque::new(); - q.push_back((start, 0u32)); + q.push_back((start, 0)); while let Some((point, steps)) = q.pop_front() { // distance from 'start' to current point - if let Some(to) = self.grid[point].to_digit(10) { - distances[(from as i32, to as i32)] = steps; + if let Some(to) = digit_usize(self.grid[point]) { + distances[(from, to)] = steps; } // walk if possible north, east, south and west - self.grid.iter_directions(point).for_each(|(_, p)| { - if self.grid[p] != '#' && !seen.contains(&p) { + self.grid.iter_directions(point).for_each(|p| { + if self.grid[p] != b'#' && !seen.contains(&p) { seen.insert(p); q.push_back((p, steps + 1)); } @@ -53,13 +57,13 @@ impl Puzzle { } } - let mut part1 = u32::MAX; - let mut part2 = u32::MAX; + let mut part1 = usize::MAX; + let mut part2 = usize::MAX; (1..n).permutations(n - 1).for_each(|path| { - let first = distances[(0, path[0] as i32)]; - let middle: u32 = path.windows(2).map(|x| distances[(x[0] as i32, x[1] as i32)]).sum(); - let last = distances[(path[n - 2] as i32, 0)]; + let first = distances[(0, path[0])]; + let middle: usize = path.windows(2).map(|x| distances[(x[0], x[1])]).sum(); + let last = distances[(path[n - 2], 0)]; part1 = part1.min(first + middle); part2 = part2.min(first + middle + last); @@ -69,20 +73,19 @@ impl Puzzle { } /// Solve part one. - fn part1(&self) -> u32 { + fn part1(&self) -> usize { self.solve().0 } /// Solve part two. - fn part2(&self) -> u32 { + fn part2(&self) -> usize { self.solve().1 } } /// # Panics -/// over malformed input #[must_use] -pub fn solve(data: &str) -> (u32, u32) { +pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); (puzzle.part1(), puzzle.part2()) } diff --git a/2016/day24/sample_1.txt b/src/year2016/day24/sample_1.txt similarity index 100% rename from 2016/day24/sample_1.txt rename to src/year2016/day24/sample_1.txt diff --git a/2016/day25/day25.rs b/src/year2016/day25/day25.rs similarity index 97% rename from 2016/day25/day25.rs rename to src/year2016/day25/day25.rs index 6331a827..f694927f 100644 --- a/2016/day25/day25.rs +++ b/src/year2016/day25/day25.rs @@ -26,7 +26,6 @@ fn run_clock_signal(bunny_vm: &mut BunnyVM, a: i32) -> bool { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, aoc::Christmas) { let mut bunny_vm = BunnyVM::new(data); diff --git a/2016/day3/day3.rs b/src/year2016/day3/day3.rs similarity index 98% rename from 2016/day3/day3.rs rename to src/year2016/day3/day3.rs index 22c4a81f..61584e6d 100644 --- a/2016/day3/day3.rs +++ b/src/year2016/day3/day3.rs @@ -8,7 +8,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { (part1(data), part2(data)) diff --git a/2016/day4/day4.rs b/src/year2016/day4/day4.rs similarity index 99% rename from 2016/day4/day4.rs rename to src/year2016/day4/day4.rs index ae01ed3a..7ca4682f 100644 --- a/2016/day4/day4.rs +++ b/src/year2016/day4/day4.rs @@ -16,7 +16,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { (part1(data), part2(data)) diff --git a/2016/day5/day5.rs b/src/year2016/day5/day5.rs similarity index 99% rename from 2016/day5/day5.rs rename to src/year2016/day5/day5.rs index 914c6587..a43ad364 100644 --- a/2016/day5/day5.rs +++ b/src/year2016/day5/day5.rs @@ -15,7 +15,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, String) { solve_verbose(data, false) diff --git a/2016/day6/day6.rs b/src/year2016/day6/day6.rs similarity index 98% rename from 2016/day6/day6.rs rename to src/year2016/day6/day6.rs index 084fd534..785e4822 100644 --- a/2016/day6/day6.rs +++ b/src/year2016/day6/day6.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, String) { let mut freq = [[0; 26]; 8]; diff --git a/2016/day6/test.txt b/src/year2016/day6/test.txt similarity index 100% rename from 2016/day6/test.txt rename to src/year2016/day6/test.txt diff --git a/2016/day7/day7.rs b/src/year2016/day7/day7.rs similarity index 99% rename from 2016/day7/day7.rs rename to src/year2016/day7/day7.rs index b225c19d..574eb288 100644 --- a/2016/day7/day7.rs +++ b/src/year2016/day7/day7.rs @@ -8,7 +8,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { (part1(data), part2(data)) diff --git a/2016/day8/day8.rs b/src/year2016/day8/day8.rs similarity index 98% rename from 2016/day8/day8.rs rename to src/year2016/day8/day8.rs index d491e039..a8528581 100644 --- a/2016/day8/day8.rs +++ b/src/year2016/day8/day8.rs @@ -12,7 +12,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, String) { const WIDTH: usize = 50; diff --git a/2016/day9/day9.rs b/src/year2016/day9/day9.rs similarity index 99% rename from 2016/day9/day9.rs rename to src/year2016/day9/day9.rs index 764bd966..a24b05e4 100644 --- a/2016/day9/day9.rs +++ b/src/year2016/day9/day9.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { (part1(data), part2(data)) diff --git a/src/year2017/README.md b/src/year2017/README.md new file mode 100644 index 00000000..1f9f7c58 --- /dev/null +++ b/src/year2017/README.md @@ -0,0 +1,36 @@ +# Advent of Code in Rust 🦀 + +![AoC2017](https://img.shields.io/badge/Advent_of_Code-2017-8A2BE2) +![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) +![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) +![Python: 17](https://img.shields.io/badge/Python-17-cyan?logo=Python) + +## 2017 ([Calendar](https://adventofcode.com/2017)) ([Solutions](./)) : 50⭐ + +Puzzle | Stars | Languages +------------------------------------------------------------------------------------- | ----- | ----------- +[Day 1: Inverse Captcha](https://adventofcode.com/2017/day/1) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day1/day1.rs) [![Python](../../scripts/assets/python.png)](day1/day1.py) +[Day 2: Corruption Checksum](https://adventofcode.com/2017/day/2) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day2/day2.rs) [![Python](../../scripts/assets/python.png)](day2/day2.py) +[Day 3: Spiral Memory](https://adventofcode.com/2017/day/3) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day3/day3.rs) [![Python](../../scripts/assets/python.png)](day3/day3.py) +[Day 4: High-Entropy Passphrases](https://adventofcode.com/2017/day/4) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day4/day4.rs) [![Python](../../scripts/assets/python.png)](day4/day4.py) +[Day 5: A Maze of Twisty Trampolines, All Alike](https://adventofcode.com/2017/day/5) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day5/day5.rs) [![Python](../../scripts/assets/python.png)](day5/day5.py) +[Day 6: Memory Reallocation](https://adventofcode.com/2017/day/6) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day6/day6.rs) [![Python](../../scripts/assets/python.png)](day6/day6.py) +[Day 7: Recursive Circus](https://adventofcode.com/2017/day/7) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day7/day7.rs) [![Python](../../scripts/assets/python.png)](day7/day7.py) +[Day 8: I Heard You Like Registers](https://adventofcode.com/2017/day/8) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day8/day8.rs) [![Python](../../scripts/assets/python.png)](day8/day8.py) +[Day 9: Stream Processing](https://adventofcode.com/2017/day/9) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day9/day9.rs) [![Python](../../scripts/assets/python.png)](day9/day9.py) +[Day 10: Knot Hash](https://adventofcode.com/2017/day/10) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day10/day10.rs) +[Day 11: Hex Ed](https://adventofcode.com/2017/day/11) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day11/day11.rs) [![Python](../../scripts/assets/python.png)](day11/day11.py) +[Day 12: Digital Plumber](https://adventofcode.com/2017/day/12) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day12/day12.rs) [![Python](../../scripts/assets/python.png)](day12/day12.py) +[Day 13: Packet Scanners](https://adventofcode.com/2017/day/13) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day13/day13.rs) +[Day 14: Disk Defragmentation](https://adventofcode.com/2017/day/14) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day14/day14.rs) +[Day 15: Dueling Generators](https://adventofcode.com/2017/day/15) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day15/day15.rs) +[Day 16: Permutation Promenade](https://adventofcode.com/2017/day/16) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day16/day16.rs) +[Day 17: Spinlock](https://adventofcode.com/2017/day/17) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day17/day17.rs) +[Day 18: Duet](https://adventofcode.com/2017/day/18) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day18/day18.rs) +[Day 19: A Series of Tubes](https://adventofcode.com/2017/day/19) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day19/day19.rs) [![Python](../../scripts/assets/python.png)](day19/day19.py) +[Day 20: Particle Swarm](https://adventofcode.com/2017/day/20) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day20/day20.rs) [![Python](../../scripts/assets/python.png)](day20/day20.py) +[Day 21: Fractal Art](https://adventofcode.com/2017/day/21) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day21/day21.rs) [![Python](../../scripts/assets/python.png)](day21/day21.py) +[Day 22: Sporifica Virus](https://adventofcode.com/2017/day/22) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day22/day22.rs) [![Python](../../scripts/assets/python.png)](day22/day22.py) +[Day 23: Coprocessor Conflagration](https://adventofcode.com/2017/day/23) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day23/day23.rs) +[Day 24: Electromagnetic Moat](https://adventofcode.com/2017/day/24) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day24/day24.rs) [![Python](../../scripts/assets/python.png)](day24/day24.py) +[Day 25: The Halting Problem](https://adventofcode.com/2017/day/25) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day25/day25.rs) [![Python](../../scripts/assets/python.png)](day25/day25.py) diff --git a/2017/day1/day1.py b/src/year2017/day1/day1.py similarity index 100% rename from 2017/day1/day1.py rename to src/year2017/day1/day1.py diff --git a/2017/day1/day1.rs b/src/year2017/day1/day1.rs similarity index 98% rename from 2017/day1/day1.rs rename to src/year2017/day1/day1.rs index 64a7f816..cde596ba 100644 --- a/2017/day1/day1.rs +++ b/src/year2017/day1/day1.rs @@ -38,7 +38,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2017/day10/day10.rs b/src/year2017/day10/day10.rs similarity index 97% rename from 2017/day10/day10.rs rename to src/year2017/day10/day10.rs index 14f6f443..da43482a 100644 --- a/2017/day10/day10.rs +++ b/src/year2017/day10/day10.rs @@ -37,7 +37,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, String) { let puzzle = Puzzle::new(data); diff --git a/2017/day11/day11.py b/src/year2017/day11/day11.py similarity index 100% rename from 2017/day11/day11.py rename to src/year2017/day11/day11.py diff --git a/2017/day11/day11.rs b/src/year2017/day11/day11.rs similarity index 98% rename from 2017/day11/day11.rs rename to src/year2017/day11/day11.rs index 390c938e..21212a53 100644 --- a/2017/day11/day11.rs +++ b/src/year2017/day11/day11.rs @@ -74,7 +74,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let mut puzzle = Puzzle::new(data); diff --git a/2017/day12/day12.py b/src/year2017/day12/day12.py similarity index 100% rename from 2017/day12/day12.py rename to src/year2017/day12/day12.py diff --git a/2017/day12/day12.rs b/src/year2017/day12/day12.rs similarity index 98% rename from 2017/day12/day12.rs rename to src/year2017/day12/day12.rs index c8d0fa1f..8c910d2d 100644 --- a/2017/day12/day12.rs +++ b/src/year2017/day12/day12.rs @@ -59,7 +59,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, u64) { let puzzle = Puzzle::new(data); diff --git a/2017/day12/test.txt b/src/year2017/day12/test.txt similarity index 100% rename from 2017/day12/test.txt rename to src/year2017/day12/test.txt diff --git a/2017/day13/day13.rs b/src/year2017/day13/day13.rs similarity index 98% rename from 2017/day13/day13.rs rename to src/year2017/day13/day13.rs index 98f6df4a..8f1e23af 100644 --- a/2017/day13/day13.rs +++ b/src/year2017/day13/day13.rs @@ -45,7 +45,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2017/day13/test.txt b/src/year2017/day13/test.txt similarity index 100% rename from 2017/day13/test.txt rename to src/year2017/day13/test.txt diff --git a/2017/day14/day14.rs b/src/year2017/day14/day14.rs similarity index 99% rename from 2017/day14/day14.rs rename to src/year2017/day14/day14.rs index 7c37c4cf..91cc84e7 100644 --- a/2017/day14/day14.rs +++ b/src/year2017/day14/day14.rs @@ -90,7 +90,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2017/day14/test.txt b/src/year2017/day14/test.txt similarity index 100% rename from 2017/day14/test.txt rename to src/year2017/day14/test.txt diff --git a/2017/day15/day15.rs b/src/year2017/day15/day15.rs similarity index 98% rename from 2017/day15/day15.rs rename to src/year2017/day15/day15.rs index eef8060c..5545c36f 100644 --- a/2017/day15/day15.rs +++ b/src/year2017/day15/day15.rs @@ -65,7 +65,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2017/day16/day16.rs b/src/year2017/day16/day16.rs similarity index 98% rename from 2017/day16/day16.rs rename to src/year2017/day16/day16.rs index 58ddee63..3abeb8d1 100644 --- a/2017/day16/day16.rs +++ b/src/year2017/day16/day16.rs @@ -75,7 +75,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, String) { let puzzle = Puzzle::new(data); diff --git a/2017/day17/day17.rs b/src/year2017/day17/day17.rs similarity index 97% rename from 2017/day17/day17.rs rename to src/year2017/day17/day17.rs index 82e4a9c6..9d0c46c8 100644 --- a/2017/day17/day17.rs +++ b/src/year2017/day17/day17.rs @@ -43,7 +43,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, usize) { let puzzle = Puzzle::new(data); diff --git a/2017/day18/day18.rs b/src/year2017/day18/day18.rs similarity index 99% rename from 2017/day18/day18.rs rename to src/year2017/day18/day18.rs index 986107be..923638fe 100644 --- a/2017/day18/day18.rs +++ b/src/year2017/day18/day18.rs @@ -168,7 +168,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, u32) { let puzzle = Puzzle::new(data); diff --git a/2017/day18/sample_1.txt b/src/year2017/day18/sample_1.txt similarity index 100% rename from 2017/day18/sample_1.txt rename to src/year2017/day18/sample_1.txt diff --git a/2017/day18/sample_2.txt b/src/year2017/day18/sample_2.txt similarity index 100% rename from 2017/day18/sample_2.txt rename to src/year2017/day18/sample_2.txt diff --git a/2017/day19/day19.py b/src/year2017/day19/day19.py similarity index 100% rename from 2017/day19/day19.py rename to src/year2017/day19/day19.py diff --git a/2017/day19/day19.rs b/src/year2017/day19/day19.rs similarity index 98% rename from 2017/day19/day19.rs rename to src/year2017/day19/day19.rs index 9adb4a6c..e1aeac47 100644 --- a/2017/day19/day19.rs +++ b/src/year2017/day19/day19.rs @@ -67,7 +67,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, u32) { let puzzle = Puzzle::new(data); diff --git a/2017/day19/test.txt b/src/year2017/day19/test.txt similarity index 100% rename from 2017/day19/test.txt rename to src/year2017/day19/test.txt diff --git a/2017/day2/day2.py b/src/year2017/day2/day2.py similarity index 100% rename from 2017/day2/day2.py rename to src/year2017/day2/day2.py diff --git a/2017/day2/day2.rs b/src/year2017/day2/day2.rs similarity index 98% rename from 2017/day2/day2.rs rename to src/year2017/day2/day2.rs index 986e4a8f..6e4099d6 100644 --- a/2017/day2/day2.rs +++ b/src/year2017/day2/day2.rs @@ -44,7 +44,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2017/day2/sample_1.txt b/src/year2017/day2/sample_1.txt similarity index 100% rename from 2017/day2/sample_1.txt rename to src/year2017/day2/sample_1.txt diff --git a/2017/day2/sample_2.txt b/src/year2017/day2/sample_2.txt similarity index 100% rename from 2017/day2/sample_2.txt rename to src/year2017/day2/sample_2.txt diff --git a/2017/day20/day20.py b/src/year2017/day20/day20.py similarity index 100% rename from 2017/day20/day20.py rename to src/year2017/day20/day20.py diff --git a/2017/day20/day20.rs b/src/year2017/day20/day20.rs similarity index 99% rename from 2017/day20/day20.rs rename to src/year2017/day20/day20.rs index f0aa6594..ab95e926 100644 --- a/2017/day20/day20.rs +++ b/src/year2017/day20/day20.rs @@ -96,7 +96,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2017/day21/day21.py b/src/year2017/day21/day21.py similarity index 100% rename from 2017/day21/day21.py rename to src/year2017/day21/day21.py diff --git a/2017/day21/day21.rs b/src/year2017/day21/day21.rs similarity index 98% rename from 2017/day21/day21.rs rename to src/year2017/day21/day21.rs index 9d2ffe17..8f3e6a5d 100644 --- a/2017/day21/day21.rs +++ b/src/year2017/day21/day21.rs @@ -78,7 +78,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2017/day21/test.txt b/src/year2017/day21/test.txt similarity index 100% rename from 2017/day21/test.txt rename to src/year2017/day21/test.txt diff --git a/2017/day22/day22.py b/src/year2017/day22/day22.py similarity index 100% rename from 2017/day22/day22.py rename to src/year2017/day22/day22.py diff --git a/2017/day22/day22.rs b/src/year2017/day22/day22.rs similarity index 99% rename from 2017/day22/day22.rs rename to src/year2017/day22/day22.rs index 0c726723..60eb8a1d 100644 --- a/2017/day22/day22.rs +++ b/src/year2017/day22/day22.rs @@ -111,7 +111,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2017/day22/test.txt b/src/year2017/day22/test.txt similarity index 100% rename from 2017/day22/test.txt rename to src/year2017/day22/test.txt diff --git a/2017/day23/day23.rs b/src/year2017/day23/day23.rs similarity index 99% rename from 2017/day23/day23.rs rename to src/year2017/day23/day23.rs index 8a8411cb..a9239c6e 100644 --- a/2017/day23/day23.rs +++ b/src/year2017/day23/day23.rs @@ -130,7 +130,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, i64) { let puzzle = Puzzle::new(data); diff --git a/2017/day24/day24.py b/src/year2017/day24/day24.py similarity index 100% rename from 2017/day24/day24.py rename to src/year2017/day24/day24.py diff --git a/2017/day24/day24.rs b/src/year2017/day24/day24.rs similarity index 98% rename from 2017/day24/day24.rs rename to src/year2017/day24/day24.rs index 65da9fed..d7486194 100644 --- a/2017/day24/day24.rs +++ b/src/year2017/day24/day24.rs @@ -3,7 +3,6 @@ use std::collections::VecDeque; /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let ports: Vec<_> = data diff --git a/2017/day24/test.txt b/src/year2017/day24/test.txt similarity index 100% rename from 2017/day24/test.txt rename to src/year2017/day24/test.txt diff --git a/2017/day25/day25.py b/src/year2017/day25/day25.py similarity index 100% rename from 2017/day25/day25.py rename to src/year2017/day25/day25.py diff --git a/2017/day25/day25.rs b/src/year2017/day25/day25.rs similarity index 99% rename from 2017/day25/day25.rs rename to src/year2017/day25/day25.rs index 56fe8865..082aad09 100644 --- a/2017/day25/day25.rs +++ b/src/year2017/day25/day25.rs @@ -10,7 +10,6 @@ struct Blueprint<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, aoc::Christmas) { let mut blueprints: FxHashMap<&str, Blueprint> = FxHashMap::default(); diff --git a/2017/day25/test.txt b/src/year2017/day25/test.txt similarity index 100% rename from 2017/day25/test.txt rename to src/year2017/day25/test.txt diff --git a/2017/day3/day3.py b/src/year2017/day3/day3.py similarity index 100% rename from 2017/day3/day3.py rename to src/year2017/day3/day3.py diff --git a/2017/day3/day3.rs b/src/year2017/day3/day3.rs similarity index 99% rename from 2017/day3/day3.rs rename to src/year2017/day3/day3.rs index 6cac5013..54814bdf 100644 --- a/2017/day3/day3.rs +++ b/src/year2017/day3/day3.rs @@ -115,7 +115,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let puzzle = Puzzle::new(data); diff --git a/2017/day4/day4.py b/src/year2017/day4/day4.py similarity index 100% rename from 2017/day4/day4.py rename to src/year2017/day4/day4.py diff --git a/2017/day4/day4.rs b/src/year2017/day4/day4.rs similarity index 98% rename from 2017/day4/day4.rs rename to src/year2017/day4/day4.rs index f231bf5c..ab4ddc6f 100644 --- a/2017/day4/day4.rs +++ b/src/year2017/day4/day4.rs @@ -47,7 +47,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2017/day5/day5.py b/src/year2017/day5/day5.py similarity index 100% rename from 2017/day5/day5.py rename to src/year2017/day5/day5.py diff --git a/2017/day5/day5.rs b/src/year2017/day5/day5.rs similarity index 98% rename from 2017/day5/day5.rs rename to src/year2017/day5/day5.rs index da9a6eae..d79386ce 100644 --- a/2017/day5/day5.rs +++ b/src/year2017/day5/day5.rs @@ -57,7 +57,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2017/day5/test.txt b/src/year2017/day5/test.txt similarity index 100% rename from 2017/day5/test.txt rename to src/year2017/day5/test.txt diff --git a/2017/day6/day6.py b/src/year2017/day6/day6.py similarity index 100% rename from 2017/day6/day6.py rename to src/year2017/day6/day6.py diff --git a/2017/day6/day6.rs b/src/year2017/day6/day6.rs similarity index 98% rename from 2017/day6/day6.rs rename to src/year2017/day6/day6.rs index 184c6ef5..4f62c677 100644 --- a/2017/day6/day6.rs +++ b/src/year2017/day6/day6.rs @@ -3,7 +3,6 @@ use rustc_hash::FxHashSet; /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let mut banks: Vec = data diff --git a/2017/day6/test.txt b/src/year2017/day6/test.txt similarity index 100% rename from 2017/day6/test.txt rename to src/year2017/day6/test.txt diff --git a/2017/day7/day7.py b/src/year2017/day7/day7.py similarity index 100% rename from 2017/day7/day7.py rename to src/year2017/day7/day7.py diff --git a/2017/day7/day7.rs b/src/year2017/day7/day7.rs similarity index 99% rename from 2017/day7/day7.rs rename to src/year2017/day7/day7.rs index ea3a7168..7b453705 100644 --- a/2017/day7/day7.rs +++ b/src/year2017/day7/day7.rs @@ -136,7 +136,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, u32) { let puzzle = Puzzle::new(data); diff --git a/2017/day7/test.txt b/src/year2017/day7/test.txt similarity index 100% rename from 2017/day7/test.txt rename to src/year2017/day7/test.txt diff --git a/2017/day8/day8.pest b/src/year2017/day8/day8.pest similarity index 100% rename from 2017/day8/day8.pest rename to src/year2017/day8/day8.pest diff --git a/2017/day8/day8.py b/src/year2017/day8/day8.py similarity index 100% rename from 2017/day8/day8.py rename to src/year2017/day8/day8.py diff --git a/2017/day8/day8.rs b/src/year2017/day8/day8.rs similarity index 97% rename from 2017/day8/day8.rs rename to src/year2017/day8/day8.rs index f370c63d..57177658 100644 --- a/2017/day8/day8.rs +++ b/src/year2017/day8/day8.rs @@ -6,7 +6,7 @@ use pest::Parser; use pest_derive::Parser; #[derive(Parser)] -#[grammar = "day8.pest"] +#[grammar = "./src/year2017/day8/day8.pest"] struct MyParser; struct Cpu { @@ -59,7 +59,6 @@ impl Cpu { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let mut cpu = Cpu { diff --git a/2017/day8/test.txt b/src/year2017/day8/test.txt similarity index 100% rename from 2017/day8/test.txt rename to src/year2017/day8/test.txt diff --git a/2017/day9/day9.py b/src/year2017/day9/day9.py similarity index 100% rename from 2017/day9/day9.py rename to src/year2017/day9/day9.py diff --git a/2017/day9/day9.rs b/src/year2017/day9/day9.rs similarity index 100% rename from 2017/day9/day9.rs rename to src/year2017/day9/day9.rs diff --git a/src/year2018/README.md b/src/year2018/README.md new file mode 100644 index 00000000..933b92ad --- /dev/null +++ b/src/year2018/README.md @@ -0,0 +1,36 @@ +# Advent of Code in Rust 🦀 + +![AoC2018](https://img.shields.io/badge/Advent_of_Code-2018-8A2BE2) +![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) +![Rust: 27](https://img.shields.io/badge/Rust-27-cyan?logo=Rust) +![Python: 4](https://img.shields.io/badge/Python-4-cyan?logo=Python) + +## 2018 ([Calendar](https://adventofcode.com/2018)) ([Solutions](./)) : 50⭐ + +Puzzle | Stars | Languages +------------------------------------------------------------------------------------ | ----- | ----------- +[Day 1: Chronal Calibration](https://adventofcode.com/2018/day/1) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day1/day1.rs) +[Day 2: Inventory Management System](https://adventofcode.com/2018/day/2) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day2/day2.rs) +[Day 3: No Matter How You Slice It](https://adventofcode.com/2018/day/3) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day3/day3.rs) +[Day 4: Repose Record](https://adventofcode.com/2018/day/4) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day4/day4.rs) [![Python](../../scripts/assets/python.png)](day4/day4.py) +[Day 5: Alchemical Reduction](https://adventofcode.com/2018/day/5) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day5/day5.rs) +[Day 6: Chronal Coordinates](https://adventofcode.com/2018/day/6) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day6/day6.rs) +[Day 7: The Sum of Its Parts](https://adventofcode.com/2018/day/7) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day7/day7.rs) +[Day 8: Memory Maneuver](https://adventofcode.com/2018/day/8) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day8/day8.rs) [![Python](../../scripts/assets/python.png)](day8/day8.py) +[Day 9: Marble Mania](https://adventofcode.com/2018/day/9) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day9/day9.rs) [![Rust](../../scripts/assets/rust.png)](day9_c/day9_c.rs) [![C](../../scripts/assets/c.png)](day9_c/day9.c) +[Day 10: The Stars Align](https://adventofcode.com/2018/day/10) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day10/day10.rs) +[Day 11: Chronal Charge](https://adventofcode.com/2018/day/11) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day11/day11.rs) +[Day 12: Subterranean Sustainability](https://adventofcode.com/2018/day/12) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day12/day12.rs) +[Day 13: Mine Cart Madness](https://adventofcode.com/2018/day/13) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day13/day13.rs) +[Day 14: Chocolate Charts](https://adventofcode.com/2018/day/14) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day14/day14.rs) +[Day 15: Beverage Bandits](https://adventofcode.com/2018/day/15) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day15/day15.rs) +[Day 16: Chronal Classification](https://adventofcode.com/2018/day/16) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day16/day16.rs) [![Python](../../scripts/assets/python.png)](day16/day16.py) +[Day 17: Reservoir Research](https://adventofcode.com/2018/day/17) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day17/day17.rs) +[Day 18: Settlers of The North Pole](https://adventofcode.com/2018/day/18) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day18/day18.rs) [![Python](../../scripts/assets/python.png)](day18/day18.py) [🎁](day18/README.md) +[Day 19: Go With The Flow](https://adventofcode.com/2018/day/19) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day19/day19.rs) +[Day 20: A Regular Map](https://adventofcode.com/2018/day/20) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day20/day20.rs) +[Day 21: Chronal Conversion](https://adventofcode.com/2018/day/21) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day21/day21.rs) +[Day 22: Mode Maze](https://adventofcode.com/2018/day/22) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day22/day22.rs) +[Day 23: Experimental Emergency Teleportation](https://adventofcode.com/2018/day/23) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day23/day23.rs) [![Rust](../../scripts/assets/rust.png)](day23_z3/day23_z3.rs) +[Day 24: Immune System Simulator 20XX](https://adventofcode.com/2018/day/24) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day24/day24.rs) +[Day 25: Four-Dimensional Adventure](https://adventofcode.com/2018/day/25) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day25/day25.rs) diff --git a/2018/day1/day1.rs b/src/year2018/day1/day1.rs similarity index 98% rename from 2018/day1/day1.rs rename to src/year2018/day1/day1.rs index 9f5fbba3..9fce7544 100644 --- a/2018/day1/day1.rs +++ b/src/year2018/day1/day1.rs @@ -33,7 +33,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let puzzle = Puzzle::new(data); diff --git a/2018/day1/test1.txt b/src/year2018/day1/test1.txt similarity index 100% rename from 2018/day1/test1.txt rename to src/year2018/day1/test1.txt diff --git a/2018/day1/test2.txt b/src/year2018/day1/test2.txt similarity index 100% rename from 2018/day1/test2.txt rename to src/year2018/day1/test2.txt diff --git a/2018/day10/day10.rs b/src/year2018/day10/day10.rs similarity index 99% rename from 2018/day10/day10.rs rename to src/year2018/day10/day10.rs index 07416fff..3bca4bdf 100644 --- a/2018/day10/day10.rs +++ b/src/year2018/day10/day10.rs @@ -116,7 +116,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, u32) { let mut puzzle = Puzzle::new(data); diff --git a/2018/day11/day11.rs b/src/year2018/day11/day11.rs similarity index 98% rename from 2018/day11/day11.rs rename to src/year2018/day11/day11.rs index 91c12aaf..fa9ac306 100644 --- a/2018/day11/day11.rs +++ b/src/year2018/day11/day11.rs @@ -66,7 +66,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, String) { let puzzle = Puzzle::new(data); diff --git a/2018/day12/day12.rs b/src/year2018/day12/day12.rs similarity index 99% rename from 2018/day12/day12.rs rename to src/year2018/day12/day12.rs index cb336d93..d3217a67 100644 --- a/2018/day12/day12.rs +++ b/src/year2018/day12/day12.rs @@ -133,7 +133,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i64) { let puzzle = Puzzle::new(data); diff --git a/2018/day12/test.txt b/src/year2018/day12/test.txt similarity index 100% rename from 2018/day12/test.txt rename to src/year2018/day12/test.txt diff --git a/2018/day13/day13.rs b/src/year2018/day13/day13.rs similarity index 99% rename from 2018/day13/day13.rs rename to src/year2018/day13/day13.rs index 0f8ddbda..cc3ffe03 100644 --- a/2018/day13/day13.rs +++ b/src/year2018/day13/day13.rs @@ -267,7 +267,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, String) { let puzzle = Puzzle::new(data); diff --git a/2018/day13/sample_4.txt b/src/year2018/day13/sample_4.txt similarity index 100% rename from 2018/day13/sample_4.txt rename to src/year2018/day13/sample_4.txt diff --git a/2018/day13/sample_6.txt b/src/year2018/day13/sample_6.txt similarity index 100% rename from 2018/day13/sample_6.txt rename to src/year2018/day13/sample_6.txt diff --git a/2018/day14/day14.rs b/src/year2018/day14/day14.rs similarity index 99% rename from 2018/day14/day14.rs rename to src/year2018/day14/day14.rs index d614c4a3..20ea7bce 100644 --- a/2018/day14/day14.rs +++ b/src/year2018/day14/day14.rs @@ -84,7 +84,6 @@ fn appear(recipes: &str) -> usize { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, usize) { (score(data), appear(data)) diff --git a/2018/day15/day15.rs b/src/year2018/day15/day15.rs similarity index 99% rename from 2018/day15/day15.rs rename to src/year2018/day15/day15.rs index 8166b9e7..c78e39d9 100644 --- a/2018/day15/day15.rs +++ b/src/year2018/day15/day15.rs @@ -250,7 +250,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2018/day15/sample_10.txt b/src/year2018/day15/sample_10.txt similarity index 100% rename from 2018/day15/sample_10.txt rename to src/year2018/day15/sample_10.txt diff --git a/2018/day15/sample_11.txt b/src/year2018/day15/sample_11.txt similarity index 100% rename from 2018/day15/sample_11.txt rename to src/year2018/day15/sample_11.txt diff --git a/2018/day15/sample_6.txt b/src/year2018/day15/sample_6.txt similarity index 100% rename from 2018/day15/sample_6.txt rename to src/year2018/day15/sample_6.txt diff --git a/2018/day15/sample_7.txt b/src/year2018/day15/sample_7.txt similarity index 100% rename from 2018/day15/sample_7.txt rename to src/year2018/day15/sample_7.txt diff --git a/2018/day15/sample_8.txt b/src/year2018/day15/sample_8.txt similarity index 100% rename from 2018/day15/sample_8.txt rename to src/year2018/day15/sample_8.txt diff --git a/2018/day15/sample_9.txt b/src/year2018/day15/sample_9.txt similarity index 100% rename from 2018/day15/sample_9.txt rename to src/year2018/day15/sample_9.txt diff --git a/2018/day16/day16.py b/src/year2018/day16/day16.py similarity index 100% rename from 2018/day16/day16.py rename to src/year2018/day16/day16.py diff --git a/2018/day16/day16.rs b/src/year2018/day16/day16.rs similarity index 99% rename from 2018/day16/day16.rs rename to src/year2018/day16/day16.rs index 9f0be6b9..808fcd5e 100644 --- a/2018/day16/day16.rs +++ b/src/year2018/day16/day16.rs @@ -35,7 +35,6 @@ fn emulate(opcode: &str, a: u32, b: u32, c: u32, regs: &[u32]) -> Vec { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let (samples, program) = data.split_once("\n\n\n\n").unwrap(); diff --git a/2018/day17/day17.rs b/src/year2018/day17/day17.rs similarity index 99% rename from 2018/day17/day17.rs rename to src/year2018/day17/day17.rs index aa0d4801..16023bea 100644 --- a/2018/day17/day17.rs +++ b/src/year2018/day17/day17.rs @@ -192,7 +192,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let mut puzzle = Puzzle::new(data); diff --git a/2018/day17/test.txt b/src/year2018/day17/test.txt similarity index 100% rename from 2018/day17/test.txt rename to src/year2018/day17/test.txt diff --git a/2018/day18/README.md b/src/year2018/day18/README.md similarity index 100% rename from 2018/day18/README.md rename to src/year2018/day18/README.md diff --git a/2018/day18/day18.py b/src/year2018/day18/day18.py similarity index 100% rename from 2018/day18/day18.py rename to src/year2018/day18/day18.py diff --git a/2018/day18/day18.rs b/src/year2018/day18/day18.rs similarity index 99% rename from 2018/day18/day18.rs rename to src/year2018/day18/day18.rs index 53421762..b2f03cf7 100644 --- a/2018/day18/day18.rs +++ b/src/year2018/day18/day18.rs @@ -143,7 +143,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2018/day18/lumberarea.gif b/src/year2018/day18/lumberarea.gif similarity index 100% rename from 2018/day18/lumberarea.gif rename to src/year2018/day18/lumberarea.gif diff --git a/2018/day18/test.txt b/src/year2018/day18/test.txt similarity index 100% rename from 2018/day18/test.txt rename to src/year2018/day18/test.txt diff --git a/2018/day19/day19.rs b/src/year2018/day19/day19.rs similarity index 99% rename from 2018/day19/day19.rs rename to src/year2018/day19/day19.rs index e58812f2..01c1bdab 100644 --- a/2018/day19/day19.rs +++ b/src/year2018/day19/day19.rs @@ -134,7 +134,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2018/day19/sample_1.txt b/src/year2018/day19/sample_1.txt similarity index 100% rename from 2018/day19/sample_1.txt rename to src/year2018/day19/sample_1.txt diff --git a/2018/day2/day2.rs b/src/year2018/day2/day2.rs similarity index 98% rename from 2018/day2/day2.rs rename to src/year2018/day2/day2.rs index e052a206..574f43f1 100644 --- a/2018/day2/day2.rs +++ b/src/year2018/day2/day2.rs @@ -51,7 +51,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, String) { let puzzle = Puzzle::new(data); diff --git a/2018/day2/test1.txt b/src/year2018/day2/test1.txt similarity index 100% rename from 2018/day2/test1.txt rename to src/year2018/day2/test1.txt diff --git a/2018/day2/test2.txt b/src/year2018/day2/test2.txt similarity index 100% rename from 2018/day2/test2.txt rename to src/year2018/day2/test2.txt diff --git a/2018/day20/day20.rs b/src/year2018/day20/day20.rs similarity index 99% rename from 2018/day20/day20.rs rename to src/year2018/day20/day20.rs index 557434f8..5bf0d886 100644 --- a/2018/day20/day20.rs +++ b/src/year2018/day20/day20.rs @@ -4,7 +4,6 @@ use rustc_hash::{FxHashMap, FxHashSet}; use std::collections::VecDeque; /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let mut edges: FxHashMap<(i32, i32), FxHashSet<(i32, i32)>> = FxHashMap::default(); diff --git a/2018/day21/day21.rs b/src/year2018/day21/day21.rs similarity index 99% rename from 2018/day21/day21.rs rename to src/year2018/day21/day21.rs index e169f51c..1a6a67b3 100644 --- a/2018/day21/day21.rs +++ b/src/year2018/day21/day21.rs @@ -235,7 +235,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle: Puzzle = Puzzle::new(data); diff --git a/2018/day22/day22.rs b/src/year2018/day22/day22.rs similarity index 99% rename from 2018/day22/day22.rs rename to src/year2018/day22/day22.rs index f701ef73..eb9240e4 100644 --- a/2018/day22/day22.rs +++ b/src/year2018/day22/day22.rs @@ -243,7 +243,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let mut puzzle = Puzzle::new(data); diff --git a/2018/day22/test.txt b/src/year2018/day22/test.txt similarity index 100% rename from 2018/day22/test.txt rename to src/year2018/day22/test.txt diff --git a/2018/day23/day23.rs b/src/year2018/day23/day23.rs similarity index 99% rename from 2018/day23/day23.rs rename to src/year2018/day23/day23.rs index 5b40e01f..7bd913cd 100644 --- a/2018/day23/day23.rs +++ b/src/year2018/day23/day23.rs @@ -212,7 +212,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, i32) { let puzzle = Puzzle::new(data); diff --git a/2018/day23/sample_1.txt b/src/year2018/day23/sample_1.txt similarity index 100% rename from 2018/day23/sample_1.txt rename to src/year2018/day23/sample_1.txt diff --git a/2018/day23/sample_2.txt b/src/year2018/day23/sample_2.txt similarity index 100% rename from 2018/day23/sample_2.txt rename to src/year2018/day23/sample_2.txt diff --git a/2018/day23_z3/build.rs b/src/year2018/day23_z3/build.rs similarity index 100% rename from 2018/day23_z3/build.rs rename to src/year2018/day23_z3/build.rs diff --git a/2018/day23_z3/day23.rs b/src/year2018/day23_z3/day23_z3.rs similarity index 99% rename from 2018/day23_z3/day23.rs rename to src/year2018/day23_z3/day23_z3.rs index bc4918e2..4446db22 100644 --- a/2018/day23_z3/day23.rs +++ b/src/year2018/day23_z3/day23_z3.rs @@ -118,7 +118,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, i64) { let puzzle = Puzzle::new(data); diff --git a/2018/day23_z3/sample_1.txt b/src/year2018/day23_z3/sample_1.txt similarity index 100% rename from 2018/day23_z3/sample_1.txt rename to src/year2018/day23_z3/sample_1.txt diff --git a/2018/day23_z3/sample_2.txt b/src/year2018/day23_z3/sample_2.txt similarity index 100% rename from 2018/day23_z3/sample_2.txt rename to src/year2018/day23_z3/sample_2.txt diff --git a/2018/day24/day24.rs b/src/year2018/day24/day24.rs similarity index 98% rename from 2018/day24/day24.rs rename to src/year2018/day24/day24.rs index 5bcae613..29f87c50 100644 --- a/2018/day24/day24.rs +++ b/src/year2018/day24/day24.rs @@ -54,7 +54,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2018/day24/army.rs b/src/year2018/day24/day24/army.rs similarity index 100% rename from 2018/day24/army.rs rename to src/year2018/day24/day24/army.rs diff --git a/2018/day24/attacktype.rs b/src/year2018/day24/day24/attacktype.rs similarity index 100% rename from 2018/day24/attacktype.rs rename to src/year2018/day24/day24/attacktype.rs diff --git a/2018/day24/combat.rs b/src/year2018/day24/day24/combat.rs similarity index 100% rename from 2018/day24/combat.rs rename to src/year2018/day24/day24/combat.rs diff --git a/2018/day24/group.rs b/src/year2018/day24/day24/group.rs similarity index 100% rename from 2018/day24/group.rs rename to src/year2018/day24/day24/group.rs diff --git a/2018/day24/test.txt b/src/year2018/day24/test.txt similarity index 100% rename from 2018/day24/test.txt rename to src/year2018/day24/test.txt diff --git a/2018/day25/day25.rs b/src/year2018/day25/day25.rs similarity index 98% rename from 2018/day25/day25.rs rename to src/year2018/day25/day25.rs index 7259e350..0caed51e 100644 --- a/2018/day25/day25.rs +++ b/src/year2018/day25/day25.rs @@ -55,7 +55,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, aoc::Christmas) { let puzzle = Puzzle::new(data); diff --git a/2018/day25/sample_1.txt b/src/year2018/day25/sample_1.txt similarity index 100% rename from 2018/day25/sample_1.txt rename to src/year2018/day25/sample_1.txt diff --git a/2018/day25/sample_2.txt b/src/year2018/day25/sample_2.txt similarity index 100% rename from 2018/day25/sample_2.txt rename to src/year2018/day25/sample_2.txt diff --git a/2018/day25/sample_3.txt b/src/year2018/day25/sample_3.txt similarity index 100% rename from 2018/day25/sample_3.txt rename to src/year2018/day25/sample_3.txt diff --git a/2018/day25/sample_4.txt b/src/year2018/day25/sample_4.txt similarity index 100% rename from 2018/day25/sample_4.txt rename to src/year2018/day25/sample_4.txt diff --git a/2018/day3/day3.rs b/src/year2018/day3/day3.rs similarity index 99% rename from 2018/day3/day3.rs rename to src/year2018/day3/day3.rs index cd8e192b..5747e368 100644 --- a/2018/day3/day3.rs +++ b/src/year2018/day3/day3.rs @@ -91,7 +91,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, u32) { let puzzle = Puzzle::new(data); diff --git a/2018/day3/test.txt b/src/year2018/day3/test.txt similarity index 100% rename from 2018/day3/test.txt rename to src/year2018/day3/test.txt diff --git a/2018/day4/day4.py b/src/year2018/day4/day4.py similarity index 100% rename from 2018/day4/day4.py rename to src/year2018/day4/day4.py diff --git a/2018/day4/day4.rs b/src/year2018/day4/day4.rs similarity index 99% rename from 2018/day4/day4.rs rename to src/year2018/day4/day4.rs index 35192aa9..81faeff1 100644 --- a/2018/day4/day4.rs +++ b/src/year2018/day4/day4.rs @@ -83,7 +83,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2018/day4/test.txt b/src/year2018/day4/test.txt similarity index 100% rename from 2018/day4/test.txt rename to src/year2018/day4/test.txt diff --git a/2018/day5/day5.rs b/src/year2018/day5/day5.rs similarity index 98% rename from 2018/day5/day5.rs rename to src/year2018/day5/day5.rs index 45b447cc..49ba2141 100644 --- a/2018/day5/day5.rs +++ b/src/year2018/day5/day5.rs @@ -59,7 +59,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2018/day5/test.txt b/src/year2018/day5/test.txt similarity index 100% rename from 2018/day5/test.txt rename to src/year2018/day5/test.txt diff --git a/2018/day6/day6.rs b/src/year2018/day6/day6.rs similarity index 99% rename from 2018/day6/day6.rs rename to src/year2018/day6/day6.rs index dd5cfc35..db93102b 100644 --- a/2018/day6/day6.rs +++ b/src/year2018/day6/day6.rs @@ -123,7 +123,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2018/day6/test.txt b/src/year2018/day6/test.txt similarity index 100% rename from 2018/day6/test.txt rename to src/year2018/day6/test.txt diff --git a/2018/day7/day7.rs b/src/year2018/day7/day7.rs similarity index 99% rename from 2018/day7/day7.rs rename to src/year2018/day7/day7.rs index a93ba1e4..c3c0e623 100644 --- a/2018/day7/day7.rs +++ b/src/year2018/day7/day7.rs @@ -126,7 +126,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, u32) { let puzzle = Puzzle::new(data); diff --git a/2018/day7/test.txt b/src/year2018/day7/test.txt similarity index 100% rename from 2018/day7/test.txt rename to src/year2018/day7/test.txt diff --git a/2018/day8/.vscode/launch.json b/src/year2018/day8/.vscode/launch.json similarity index 100% rename from 2018/day8/.vscode/launch.json rename to src/year2018/day8/.vscode/launch.json diff --git a/2018/day8/day8.py b/src/year2018/day8/day8.py similarity index 100% rename from 2018/day8/day8.py rename to src/year2018/day8/day8.py diff --git a/2018/day8/day8.rs b/src/year2018/day8/day8.rs similarity index 98% rename from 2018/day8/day8.rs rename to src/year2018/day8/day8.rs index 67f0f029..7278a4e8 100644 --- a/2018/day8/day8.rs +++ b/src/year2018/day8/day8.rs @@ -68,7 +68,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2018/day8/test.txt b/src/year2018/day8/test.txt similarity index 100% rename from 2018/day8/test.txt rename to src/year2018/day8/test.txt diff --git a/2018/day9/day9.rs b/src/year2018/day9/day9.rs similarity index 99% rename from 2018/day9/day9.rs rename to src/year2018/day9/day9.rs index 46d09333..c9a04ea1 100644 --- a/2018/day9/day9.rs +++ b/src/year2018/day9/day9.rs @@ -68,7 +68,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2018/day9_c/day9.c b/src/year2018/day9_c/day9.c similarity index 100% rename from 2018/day9_c/day9.c rename to src/year2018/day9_c/day9.c diff --git a/2018/day9_c/day9.rs b/src/year2018/day9_c/day9_c.rs similarity index 98% rename from 2018/day9_c/day9.rs rename to src/year2018/day9_c/day9_c.rs index 590239cc..182f628e 100644 --- a/2018/day9_c/day9.rs +++ b/src/year2018/day9_c/day9_c.rs @@ -57,7 +57,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/src/year2019/README.md b/src/year2019/README.md new file mode 100644 index 00000000..3e408baa --- /dev/null +++ b/src/year2019/README.md @@ -0,0 +1,36 @@ +# Advent of Code in Rust 🦀 + +![AoC2019](https://img.shields.io/badge/Advent_of_Code-2019-8A2BE2) +![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) +![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) +![Python: 23](https://img.shields.io/badge/Python-23-cyan?logo=Python) + +## 2019 ([Calendar](https://adventofcode.com/2019)) ([Solutions](./)) : 50⭐ + +Puzzle | Stars | Languages +-------------------------------------------------------------------------------- | ----- | ----------- +[Day 1: The Tyranny of the Rocket Equation](https://adventofcode.com/2019/day/1) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day1/day1.rs) [![Python](../../scripts/assets/python.png)](day1/day1.py) +[Day 2: 1202 Program Alarm](https://adventofcode.com/2019/day/2) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day2/day2.rs) [![Python](../../scripts/assets/python.png)](day2/day2.py) +[Day 3: Crossed Wires](https://adventofcode.com/2019/day/3) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day3/day3.rs) [![Python](../../scripts/assets/python.png)](day3/day3.py) +[Day 4: Secure Container](https://adventofcode.com/2019/day/4) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day4/day4.rs) [![Python](../../scripts/assets/python.png)](day4/day4.py) +[Day 5: Sunny with a Chance of Asteroids](https://adventofcode.com/2019/day/5) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day5/day5.rs) [![Python](../../scripts/assets/python.png)](day5/day5.py) +[Day 6: Universal Orbit Map](https://adventofcode.com/2019/day/6) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day6/day6.rs) [![Python](../../scripts/assets/python.png)](day6/day6.py) +[Day 7: Amplification Circuit](https://adventofcode.com/2019/day/7) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day7/day7.rs) [![Python](../../scripts/assets/python.png)](day7/day7.py) +[Day 8: Space Image Format](https://adventofcode.com/2019/day/8) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day8/day8.rs) [![Python](../../scripts/assets/python.png)](day8/day8.py) +[Day 9: Sensor Boost](https://adventofcode.com/2019/day/9) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day9/day9.rs) [![Python](../../scripts/assets/python.png)](day9/day9.py) +[Day 10: Monitoring Station](https://adventofcode.com/2019/day/10) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day10/day10.rs) [![Python](../../scripts/assets/python.png)](day10/day10.py) +[Day 11: Space Police](https://adventofcode.com/2019/day/11) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day11/day11.rs) [![Python](../../scripts/assets/python.png)](day11/day11.py) +[Day 12: The N-Body Problem](https://adventofcode.com/2019/day/12) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day12/day12.rs) [![Python](../../scripts/assets/python.png)](day12/day12.py) +[Day 13: Care Package](https://adventofcode.com/2019/day/13) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day13/day13.rs) [![Python](../../scripts/assets/python.png)](day13/day13.py) [🎁](day13/README.md) +[Day 14: Space Stoichiometry](https://adventofcode.com/2019/day/14) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day14/day14.rs) [![Python](../../scripts/assets/python.png)](day14/day14.py) +[Day 15: Oxygen System](https://adventofcode.com/2019/day/15) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day15/day15.rs) [![Python](../../scripts/assets/python.png)](day15/day15.py) [🎁](day15/README.md) +[Day 16: Flawed Frequency Transmission](https://adventofcode.com/2019/day/16) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day16/day16.rs) [![Python](../../scripts/assets/python.png)](day16/day16.py) [![C](../../scripts/assets/c.png)](day16/day16.c) +[Day 17: Set and Forget](https://adventofcode.com/2019/day/17) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day17/day17.rs) [![Python](../../scripts/assets/python.png)](day17/day17.py) +[Day 18: Many-Worlds Interpretation](https://adventofcode.com/2019/day/18) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day18/day18.rs) +[Day 19: Tractor Beam](https://adventofcode.com/2019/day/19) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day19/day19.rs) [![Python](../../scripts/assets/python.png)](day19/day19.py) +[Day 20: Donut Maze](https://adventofcode.com/2019/day/20) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day20/day20.rs) [![Python](../../scripts/assets/python.png)](day20/day20.py) +[Day 21: Springdroid Adventure](https://adventofcode.com/2019/day/21) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day21/day21.rs) [![Python](../../scripts/assets/python.png)](day21/day21.py) +[Day 22: Slam Shuffle](https://adventofcode.com/2019/day/22) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day22/day22.rs) +[Day 23: Category Six](https://adventofcode.com/2019/day/23) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day23/day23.rs) [![Python](../../scripts/assets/python.png)](day23/day23.py) +[Day 24: Planet of Discord](https://adventofcode.com/2019/day/24) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day24/day24.rs) [![Python](../../scripts/assets/python.png)](day24/day24.py) +[Day 25: Cryostasis](https://adventofcode.com/2019/day/25) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day25/day25.rs) [![Python](../../scripts/assets/python.png)](day25/day25.py) diff --git a/2019/day1/day1.py b/src/year2019/day1/day1.py similarity index 100% rename from 2019/day1/day1.py rename to src/year2019/day1/day1.py diff --git a/2019/day1/day1.rs b/src/year2019/day1/day1.rs similarity index 98% rename from 2019/day1/day1.rs rename to src/year2019/day1/day1.rs index 2d690641..8440c35d 100644 --- a/2019/day1/day1.rs +++ b/src/year2019/day1/day1.rs @@ -34,7 +34,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let puzzle = Puzzle::new(data); diff --git a/2019/day10/day10.py b/src/year2019/day10/day10.py similarity index 100% rename from 2019/day10/day10.py rename to src/year2019/day10/day10.py diff --git a/2019/day10/day10.rs b/src/year2019/day10/day10.rs similarity index 99% rename from 2019/day10/day10.rs rename to src/year2019/day10/day10.rs index bc54e387..7f0d977f 100644 --- a/2019/day10/day10.rs +++ b/src/year2019/day10/day10.rs @@ -120,7 +120,6 @@ fn find_nth_vaporized(asteroids: &[Coord], station: Coord, mut vaporized: u32) - } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, i32) { let asteroids = load_asteroids(data); diff --git a/2019/day10/sample_1.txt b/src/year2019/day10/sample_1.txt similarity index 100% rename from 2019/day10/sample_1.txt rename to src/year2019/day10/sample_1.txt diff --git a/2019/day10/sample_4.txt b/src/year2019/day10/sample_4.txt similarity index 100% rename from 2019/day10/sample_4.txt rename to src/year2019/day10/sample_4.txt diff --git a/2019/day10/sample_5.txt b/src/year2019/day10/sample_5.txt similarity index 100% rename from 2019/day10/sample_5.txt rename to src/year2019/day10/sample_5.txt diff --git a/2019/day10/sample_6.txt b/src/year2019/day10/sample_6.txt similarity index 100% rename from 2019/day10/sample_6.txt rename to src/year2019/day10/sample_6.txt diff --git a/2019/day10/sample_7.txt b/src/year2019/day10/sample_7.txt similarity index 100% rename from 2019/day10/sample_7.txt rename to src/year2019/day10/sample_7.txt diff --git a/2019/day11/day11.py b/src/year2019/day11/day11.py similarity index 100% rename from 2019/day11/day11.py rename to src/year2019/day11/day11.py diff --git a/2019/day11/day11.rs b/src/year2019/day11/day11.rs similarity index 99% rename from 2019/day11/day11.rs rename to src/year2019/day11/day11.rs index 2048ea8b..0aa76d25 100644 --- a/2019/day11/day11.rs +++ b/src/year2019/day11/day11.rs @@ -138,7 +138,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, String) { let puzzle = Puzzle::new(data); diff --git a/2019/day12/day12.py b/src/year2019/day12/day12.py similarity index 100% rename from 2019/day12/day12.py rename to src/year2019/day12/day12.py diff --git a/2019/day12/day12.rs b/src/year2019/day12/day12.rs similarity index 99% rename from 2019/day12/day12.rs rename to src/year2019/day12/day12.rs index 84435f00..0dd41245 100644 --- a/2019/day12/day12.rs +++ b/src/year2019/day12/day12.rs @@ -121,7 +121,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, u64) { let puzzle = Puzzle::new(data); diff --git a/2019/day12/sample_1.txt b/src/year2019/day12/sample_1.txt similarity index 100% rename from 2019/day12/sample_1.txt rename to src/year2019/day12/sample_1.txt diff --git a/2019/day12/sample_4.txt b/src/year2019/day12/sample_4.txt similarity index 100% rename from 2019/day12/sample_4.txt rename to src/year2019/day12/sample_4.txt diff --git a/2019/day13/README.md b/src/year2019/day13/README.md similarity index 100% rename from 2019/day13/README.md rename to src/year2019/day13/README.md diff --git a/2019/day13/day13.py b/src/year2019/day13/day13.py similarity index 100% rename from 2019/day13/day13.py rename to src/year2019/day13/day13.py diff --git a/2019/day13/day13.rs b/src/year2019/day13/day13.rs similarity index 98% rename from 2019/day13/day13.rs rename to src/year2019/day13/day13.rs index 847a9a4f..f116af36 100644 --- a/2019/day13/day13.rs +++ b/src/year2019/day13/day13.rs @@ -96,7 +96,6 @@ impl ArcadeCabinet { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, i64) { let mut cab = ArcadeCabinet::new(data); diff --git a/2019/day13/demo.cast b/src/year2019/day13/demo.cast similarity index 100% rename from 2019/day13/demo.cast rename to src/year2019/day13/demo.cast diff --git a/2019/day14/day14.py b/src/year2019/day14/day14.py similarity index 100% rename from 2019/day14/day14.py rename to src/year2019/day14/day14.py diff --git a/2019/day14/day14.rs b/src/year2019/day14/day14.rs similarity index 99% rename from 2019/day14/day14.rs rename to src/year2019/day14/day14.rs index da5ffcb7..a26fe071 100644 --- a/2019/day14/day14.rs +++ b/src/year2019/day14/day14.rs @@ -108,7 +108,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let puzzle = Puzzle::new(data); diff --git a/2019/day14/sample_1.txt b/src/year2019/day14/sample_1.txt similarity index 100% rename from 2019/day14/sample_1.txt rename to src/year2019/day14/sample_1.txt diff --git a/2019/day14/sample_2.txt b/src/year2019/day14/sample_2.txt similarity index 100% rename from 2019/day14/sample_2.txt rename to src/year2019/day14/sample_2.txt diff --git a/2019/day14/sample_3.txt b/src/year2019/day14/sample_3.txt similarity index 100% rename from 2019/day14/sample_3.txt rename to src/year2019/day14/sample_3.txt diff --git a/2019/day14/sample_4.txt b/src/year2019/day14/sample_4.txt similarity index 100% rename from 2019/day14/sample_4.txt rename to src/year2019/day14/sample_4.txt diff --git a/2019/day14/sample_5.txt b/src/year2019/day14/sample_5.txt similarity index 100% rename from 2019/day14/sample_5.txt rename to src/year2019/day14/sample_5.txt diff --git a/2019/day15/README.md b/src/year2019/day15/README.md similarity index 100% rename from 2019/day15/README.md rename to src/year2019/day15/README.md diff --git a/2019/day15/anim.gif b/src/year2019/day15/anim.gif similarity index 100% rename from 2019/day15/anim.gif rename to src/year2019/day15/anim.gif diff --git a/2019/day15/day15.py b/src/year2019/day15/day15.py similarity index 100% rename from 2019/day15/day15.py rename to src/year2019/day15/day15.py diff --git a/2019/day15/day15.rs b/src/year2019/day15/day15.rs similarity index 98% rename from 2019/day15/day15.rs rename to src/year2019/day15/day15.rs index 5d44480f..aff8af48 100644 --- a/2019/day15/day15.rs +++ b/src/year2019/day15/day15.rs @@ -66,7 +66,6 @@ fn bfs(droid: &Computer) -> (Computer, i64, i64) { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let droid = Computer::load(data); diff --git a/2019/day15/maze.py b/src/year2019/day15/maze.py similarity index 100% rename from 2019/day15/maze.py rename to src/year2019/day15/maze.py diff --git a/2019/day16/day16.c b/src/year2019/day16/day16.c similarity index 100% rename from 2019/day16/day16.c rename to src/year2019/day16/day16.c diff --git a/2019/day16/day16.py b/src/year2019/day16/day16.py similarity index 100% rename from 2019/day16/day16.py rename to src/year2019/day16/day16.py diff --git a/2019/day16/day16.rs b/src/year2019/day16/day16.rs similarity index 99% rename from 2019/day16/day16.rs rename to src/year2019/day16/day16.rs index 98ab08dc..a564bb00 100644 --- a/2019/day16/day16.rs +++ b/src/year2019/day16/day16.rs @@ -67,7 +67,6 @@ fn part2(data: &[u8]) -> u32 { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let data = parse_data(data); diff --git a/2019/day17/day17.py b/src/year2019/day17/day17.py similarity index 100% rename from 2019/day17/day17.py rename to src/year2019/day17/day17.py diff --git a/2019/day17/day17.rs b/src/year2019/day17/day17.rs similarity index 99% rename from 2019/day17/day17.rs rename to src/year2019/day17/day17.rs index 30369736..6706d148 100644 --- a/2019/day17/day17.rs +++ b/src/year2019/day17/day17.rs @@ -210,7 +210,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i64) { let puzzle = Puzzle::new(data); diff --git a/2019/day18/day18.rs b/src/year2019/day18/day18.rs similarity index 99% rename from 2019/day18/day18.rs rename to src/year2019/day18/day18.rs index 7f505bae..bb1fda72 100644 --- a/2019/day18/day18.rs +++ b/src/year2019/day18/day18.rs @@ -95,7 +95,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, usize) { let mut puzzle = Puzzle::new(data); diff --git a/2019/day18/mazecell.rs b/src/year2019/day18/day18/mazecell.rs similarity index 100% rename from 2019/day18/mazecell.rs rename to src/year2019/day18/day18/mazecell.rs diff --git a/2019/day18/mazette.rs b/src/year2019/day18/day18/mazette.rs similarity index 100% rename from 2019/day18/mazette.rs rename to src/year2019/day18/day18/mazette.rs diff --git a/2019/day18/multirobot.rs b/src/year2019/day18/day18/multirobot.rs similarity index 100% rename from 2019/day18/multirobot.rs rename to src/year2019/day18/day18/multirobot.rs diff --git a/2019/day18/path.rs b/src/year2019/day18/day18/path.rs similarity index 100% rename from 2019/day18/path.rs rename to src/year2019/day18/day18/path.rs diff --git a/2019/day18/state.rs b/src/year2019/day18/day18/state.rs similarity index 100% rename from 2019/day18/state.rs rename to src/year2019/day18/day18/state.rs diff --git a/2019/day18/sample_1.txt b/src/year2019/day18/sample_1.txt similarity index 100% rename from 2019/day18/sample_1.txt rename to src/year2019/day18/sample_1.txt diff --git a/2019/day18/sample_10.txt b/src/year2019/day18/sample_10.txt similarity index 100% rename from 2019/day18/sample_10.txt rename to src/year2019/day18/sample_10.txt diff --git a/2019/day18/sample_11.txt b/src/year2019/day18/sample_11.txt similarity index 100% rename from 2019/day18/sample_11.txt rename to src/year2019/day18/sample_11.txt diff --git a/2019/day18/sample_4.txt b/src/year2019/day18/sample_4.txt similarity index 100% rename from 2019/day18/sample_4.txt rename to src/year2019/day18/sample_4.txt diff --git a/2019/day18/sample_9.txt b/src/year2019/day18/sample_9.txt similarity index 100% rename from 2019/day18/sample_9.txt rename to src/year2019/day18/sample_9.txt diff --git a/2019/day19/day19.py b/src/year2019/day19/day19.py similarity index 100% rename from 2019/day19/day19.py rename to src/year2019/day19/day19.py diff --git a/2019/day19/day19.rs b/src/year2019/day19/day19.rs similarity index 99% rename from 2019/day19/day19.rs rename to src/year2019/day19/day19.rs index 9c6cb970..a4d37b40 100644 --- a/2019/day19/day19.rs +++ b/src/year2019/day19/day19.rs @@ -144,7 +144,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let puzzle = Puzzle::new(data); diff --git a/2019/day2/day2.py b/src/year2019/day2/day2.py similarity index 100% rename from 2019/day2/day2.py rename to src/year2019/day2/day2.py diff --git a/2019/day2/day2.rs b/src/year2019/day2/day2.rs similarity index 99% rename from 2019/day2/day2.rs rename to src/year2019/day2/day2.rs index 7e138f7d..15f3b53e 100644 --- a/2019/day2/day2.rs +++ b/src/year2019/day2/day2.rs @@ -78,7 +78,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2019/day20/day20.py b/src/year2019/day20/day20.py similarity index 100% rename from 2019/day20/day20.py rename to src/year2019/day20/day20.py diff --git a/2019/day20/day20.rs b/src/year2019/day20/day20.rs similarity index 99% rename from 2019/day20/day20.rs rename to src/year2019/day20/day20.rs index 9fa721b8..2a87dbcf 100644 --- a/2019/day20/day20.rs +++ b/src/year2019/day20/day20.rs @@ -205,7 +205,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2019/day20/sample_1.txt b/src/year2019/day20/sample_1.txt similarity index 100% rename from 2019/day20/sample_1.txt rename to src/year2019/day20/sample_1.txt diff --git a/2019/day20/sample_2.txt b/src/year2019/day20/sample_2.txt similarity index 100% rename from 2019/day20/sample_2.txt rename to src/year2019/day20/sample_2.txt diff --git a/2019/day20/sample_3.txt b/src/year2019/day20/sample_3.txt similarity index 100% rename from 2019/day20/sample_3.txt rename to src/year2019/day20/sample_3.txt diff --git a/2019/day21/day21.py b/src/year2019/day21/day21.py similarity index 100% rename from 2019/day21/day21.py rename to src/year2019/day21/day21.py diff --git a/2019/day21/day21.rs b/src/year2019/day21/day21.rs similarity index 98% rename from 2019/day21/day21.rs rename to src/year2019/day21/day21.rs index 58158302..05b18e9b 100644 --- a/2019/day21/day21.rs +++ b/src/year2019/day21/day21.rs @@ -59,7 +59,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let puzzle = Puzzle::new(data); diff --git a/2019/day22/day22.rs b/src/year2019/day22/day22.rs similarity index 99% rename from 2019/day22/day22.rs rename to src/year2019/day22/day22.rs index e304daad..c00b64f3 100644 --- a/2019/day22/day22.rs +++ b/src/year2019/day22/day22.rs @@ -168,7 +168,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i128, i128) { let puzzle = Puzzle::new(data); diff --git a/2019/day23/day23.py b/src/year2019/day23/day23.py similarity index 100% rename from 2019/day23/day23.py rename to src/year2019/day23/day23.py diff --git a/2019/day23/day23.rs b/src/year2019/day23/day23.rs similarity index 99% rename from 2019/day23/day23.rs rename to src/year2019/day23/day23.rs index 1f27c10e..507cd52d 100644 --- a/2019/day23/day23.rs +++ b/src/year2019/day23/day23.rs @@ -213,7 +213,6 @@ impl Task for Node { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { Network::new(data).run() diff --git a/2019/day24/day24.py b/src/year2019/day24/day24.py similarity index 100% rename from 2019/day24/day24.py rename to src/year2019/day24/day24.py diff --git a/2019/day24/day24.rs b/src/year2019/day24/day24.rs similarity index 99% rename from 2019/day24/day24.rs rename to src/year2019/day24/day24.rs index 0ff1b279..8f63b1e5 100644 --- a/2019/day24/day24.rs +++ b/src/year2019/day24/day24.rs @@ -168,7 +168,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, usize) { let puzzle = Puzzle::new(data); diff --git a/2019/day24/test.txt b/src/year2019/day24/test.txt similarity index 100% rename from 2019/day24/test.txt rename to src/year2019/day24/test.txt diff --git a/2019/day25/day25.py b/src/year2019/day25/day25.py similarity index 100% rename from 2019/day25/day25.py rename to src/year2019/day25/day25.py diff --git a/2019/day25/day25.rs b/src/year2019/day25/day25.rs similarity index 99% rename from 2019/day25/day25.rs rename to src/year2019/day25/day25.rs index 6bf11607..d3397a8d 100644 --- a/2019/day25/day25.rs +++ b/src/year2019/day25/day25.rs @@ -179,7 +179,6 @@ fn find_weight(computer: &mut Computer, inventory: &[&str], checkpoint_dir: &str } /// # Panics -/// over malformed input #[must_use] pub fn solve(program: &str) -> (u64, aoc::Christmas) { let mut computer = Computer::load(program); diff --git a/2019/day25/play.py b/src/year2019/day25/play.py similarity index 100% rename from 2019/day25/play.py rename to src/year2019/day25/play.py diff --git a/2019/day3/day3.py b/src/year2019/day3/day3.py similarity index 100% rename from 2019/day3/day3.py rename to src/year2019/day3/day3.py diff --git a/2019/day3/day3.rs b/src/year2019/day3/day3.rs similarity index 99% rename from 2019/day3/day3.rs rename to src/year2019/day3/day3.rs index 62d8f1fa..080c6a7a 100644 --- a/2019/day3/day3.rs +++ b/src/year2019/day3/day3.rs @@ -101,7 +101,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, u32) { let puzzle = Puzzle::new(data); diff --git a/2019/day3/test1.txt b/src/year2019/day3/test1.txt similarity index 100% rename from 2019/day3/test1.txt rename to src/year2019/day3/test1.txt diff --git a/2019/day3/test2.txt b/src/year2019/day3/test2.txt similarity index 100% rename from 2019/day3/test2.txt rename to src/year2019/day3/test2.txt diff --git a/2019/day4/day4.py b/src/year2019/day4/day4.py similarity index 100% rename from 2019/day4/day4.py rename to src/year2019/day4/day4.py diff --git a/2019/day4/day4.rs b/src/year2019/day4/day4.rs similarity index 98% rename from 2019/day4/day4.rs rename to src/year2019/day4/day4.rs index f560e717..83a1f921 100644 --- a/2019/day4/day4.rs +++ b/src/year2019/day4/day4.rs @@ -67,7 +67,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2019/day5/day5.py b/src/year2019/day5/day5.py similarity index 100% rename from 2019/day5/day5.py rename to src/year2019/day5/day5.py diff --git a/2019/day5/day5.rs b/src/year2019/day5/day5.rs similarity index 95% rename from 2019/day5/day5.rs rename to src/year2019/day5/day5.rs index c25d1853..667f9e57 100644 --- a/2019/day5/day5.rs +++ b/src/year2019/day5/day5.rs @@ -3,7 +3,6 @@ use intcode::{Computer, State}; /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let mut program = Computer::load(data); diff --git a/2019/day6/day6.py b/src/year2019/day6/day6.py similarity index 100% rename from 2019/day6/day6.py rename to src/year2019/day6/day6.py diff --git a/2019/day6/day6.rs b/src/year2019/day6/day6.rs similarity index 98% rename from 2019/day6/day6.rs rename to src/year2019/day6/day6.rs index b41517db..8298766b 100644 --- a/2019/day6/day6.rs +++ b/src/year2019/day6/day6.rs @@ -63,7 +63,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, usize) { let puzzle = Puzzle::new(data); diff --git a/2019/day6/sample_2.txt b/src/year2019/day6/sample_2.txt similarity index 100% rename from 2019/day6/sample_2.txt rename to src/year2019/day6/sample_2.txt diff --git a/2019/day6/sample_4.txt b/src/year2019/day6/sample_4.txt similarity index 100% rename from 2019/day6/sample_4.txt rename to src/year2019/day6/sample_4.txt diff --git a/2019/day7/day7.py b/src/year2019/day7/day7.py similarity index 100% rename from 2019/day7/day7.py rename to src/year2019/day7/day7.py diff --git a/2019/day7/day7.rs b/src/year2019/day7/day7.rs similarity index 99% rename from 2019/day7/day7.rs rename to src/year2019/day7/day7.rs index 2ffd8931..668247a2 100644 --- a/2019/day7/day7.rs +++ b/src/year2019/day7/day7.rs @@ -82,7 +82,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let puzzle = Puzzle::new(data); diff --git a/2019/day8/day8.py b/src/year2019/day8/day8.py similarity index 100% rename from 2019/day8/day8.py rename to src/year2019/day8/day8.py diff --git a/2019/day8/day8.rs b/src/year2019/day8/day8.rs similarity index 98% rename from 2019/day8/day8.rs rename to src/year2019/day8/day8.rs index 84b0f1b8..292efcb0 100644 --- a/2019/day8/day8.rs +++ b/src/year2019/day8/day8.rs @@ -68,7 +68,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, String) { let puzzle = Puzzle::new(data); diff --git a/2019/day9/day9.py b/src/year2019/day9/day9.py similarity index 100% rename from 2019/day9/day9.py rename to src/year2019/day9/day9.py diff --git a/2019/day9/day9.rs b/src/year2019/day9/day9.rs similarity index 95% rename from 2019/day9/day9.rs rename to src/year2019/day9/day9.rs index 6b30a402..02a2ddbc 100644 --- a/2019/day9/day9.rs +++ b/src/year2019/day9/day9.rs @@ -3,7 +3,6 @@ use intcode::{Computer, State}; /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let mut program = Computer::load(data); diff --git a/2019/intcode/Intcode.py b/src/year2019/intcode/Intcode.py similarity index 100% rename from 2019/intcode/Intcode.py rename to src/year2019/intcode/Intcode.py diff --git a/2019/intcode/amp1.intcode b/src/year2019/intcode/amp1.intcode similarity index 100% rename from 2019/intcode/amp1.intcode rename to src/year2019/intcode/amp1.intcode diff --git a/2019/intcode/amp2.intcode b/src/year2019/intcode/amp2.intcode similarity index 100% rename from 2019/intcode/amp2.intcode rename to src/year2019/intcode/amp2.intcode diff --git a/2019/intcode/amp3.intcode b/src/year2019/intcode/amp3.intcode similarity index 100% rename from 2019/intcode/amp3.intcode rename to src/year2019/intcode/amp3.intcode diff --git a/2019/intcode/bignum1.intcode b/src/year2019/intcode/bignum1.intcode similarity index 100% rename from 2019/intcode/bignum1.intcode rename to src/year2019/intcode/bignum1.intcode diff --git a/2019/intcode/bignum2.intcode b/src/year2019/intcode/bignum2.intcode similarity index 100% rename from 2019/intcode/bignum2.intcode rename to src/year2019/intcode/bignum2.intcode diff --git a/2019/intcode/compare8.intcode b/src/year2019/intcode/compare8.intcode similarity index 100% rename from 2019/intcode/compare8.intcode rename to src/year2019/intcode/compare8.intcode diff --git a/2019/intcode/copyitself.intcode b/src/year2019/intcode/copyitself.intcode similarity index 100% rename from 2019/intcode/copyitself.intcode rename to src/year2019/intcode/copyitself.intcode diff --git a/2019/intcode/count10.intcode b/src/year2019/intcode/count10.intcode similarity index 100% rename from 2019/intcode/count10.intcode rename to src/year2019/intcode/count10.intcode diff --git a/2019/intcode/day2p1.intcode b/src/year2019/intcode/day2p1.intcode similarity index 100% rename from 2019/intcode/day2p1.intcode rename to src/year2019/intcode/day2p1.intcode diff --git a/2019/intcode/day2p2.intcode b/src/year2019/intcode/day2p2.intcode similarity index 100% rename from 2019/intcode/day2p2.intcode rename to src/year2019/intcode/day2p2.intcode diff --git a/2019/intcode/exampleday2.intcode b/src/year2019/intcode/exampleday2.intcode similarity index 100% rename from 2019/intcode/exampleday2.intcode rename to src/year2019/intcode/exampleday2.intcode diff --git a/2019/intcode/helloworld.intcode b/src/year2019/intcode/helloworld.intcode similarity index 100% rename from 2019/intcode/helloworld.intcode rename to src/year2019/intcode/helloworld.intcode diff --git a/2019/intcode/langtonsant.intcode b/src/year2019/intcode/langtonsant.intcode similarity index 100% rename from 2019/intcode/langtonsant.intcode rename to src/year2019/intcode/langtonsant.intcode diff --git a/2019/intcode/nonzero1.intcode b/src/year2019/intcode/nonzero1.intcode similarity index 100% rename from 2019/intcode/nonzero1.intcode rename to src/year2019/intcode/nonzero1.intcode diff --git a/2019/intcode/nonzero2.intcode b/src/year2019/intcode/nonzero2.intcode similarity index 100% rename from 2019/intcode/nonzero2.intcode rename to src/year2019/intcode/nonzero2.intcode diff --git a/src/year2019/ocr/ocr.py b/src/year2019/ocr/ocr.py new file mode 120000 index 00000000..244b4f93 --- /dev/null +++ b/src/year2019/ocr/ocr.py @@ -0,0 +1 @@ +../../year2022/ocr/ocr.py \ No newline at end of file diff --git a/src/year2020/README.md b/src/year2020/README.md new file mode 100644 index 00000000..b06e1ac5 --- /dev/null +++ b/src/year2020/README.md @@ -0,0 +1,36 @@ +# Advent of Code in Rust 🦀 + +![AoC2020](https://img.shields.io/badge/Advent_of_Code-2020-8A2BE2) +![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) +![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) +![Python: 23](https://img.shields.io/badge/Python-23-cyan?logo=Python) + +## 2020 ([Calendar](https://adventofcode.com/2020)) ([Solutions](./)) : 50⭐ + +Puzzle | Stars | Languages +----------------------------------------------------------------------- | ----- | ----------- +[Day 1: Report Repair](https://adventofcode.com/2020/day/1) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day1/day1.rs) [![Python](../../scripts/assets/python.png)](day1/day1.py) +[Day 2: Password Philosophy](https://adventofcode.com/2020/day/2) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day2/day2.rs) [![Python](../../scripts/assets/python.png)](day2/day2.py) +[Day 3: Toboggan Trajectory](https://adventofcode.com/2020/day/3) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day3/day3.rs) [![Python](../../scripts/assets/python.png)](day3/day3.py) +[Day 4: Passport Processing](https://adventofcode.com/2020/day/4) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day4/day4.rs) [![Python](../../scripts/assets/python.png)](day4/day4.py) +[Day 5: Binary Boarding](https://adventofcode.com/2020/day/5) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day5/day5.rs) [![Python](../../scripts/assets/python.png)](day5/day5.py) +[Day 6: Custom Customs](https://adventofcode.com/2020/day/6) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day6/day6.rs) [![Python](../../scripts/assets/python.png)](day6/day6.py) +[Day 7: Handy Haversacks](https://adventofcode.com/2020/day/7) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day7/day7.rs) [![Python](../../scripts/assets/python.png)](day7/day7.py) +[Day 8: Handheld Halting](https://adventofcode.com/2020/day/8) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day8/day8.rs) [![Python](../../scripts/assets/python.png)](day8/day8.py) +[Day 9: Encoding Error](https://adventofcode.com/2020/day/9) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day9/day9.rs) [![Python](../../scripts/assets/python.png)](day9/day9.py) +[Day 10: Adapter Array](https://adventofcode.com/2020/day/10) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day10/day10.rs) [![Python](../../scripts/assets/python.png)](day10/day10.py) +[Day 11: Seating System](https://adventofcode.com/2020/day/11) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day11/day11.rs) [![Python](../../scripts/assets/python.png)](day11/day11.py) +[Day 12: Rain Risk](https://adventofcode.com/2020/day/12) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day12/day12.rs) [![Python](../../scripts/assets/python.png)](day12/day12.py) +[Day 13: Shuttle Search](https://adventofcode.com/2020/day/13) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day13/day13.rs) [![Python](../../scripts/assets/python.png)](day13/day13.py) +[Day 14: Docking Data](https://adventofcode.com/2020/day/14) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day14/day14.rs) [![Python](../../scripts/assets/python.png)](day14/day14.py) +[Day 15: Rambunctious Recitation](https://adventofcode.com/2020/day/15) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day15/day15.rs) [![Python](../../scripts/assets/python.png)](day15/day15.py) +[Day 16: Ticket Translation](https://adventofcode.com/2020/day/16) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day16/day16.rs) [![Python](../../scripts/assets/python.png)](day16/day16.py) +[Day 17: Conway Cubes](https://adventofcode.com/2020/day/17) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day17/day17.rs) [![Python](../../scripts/assets/python.png)](day17/day17.py) +[Day 18: Operation Order](https://adventofcode.com/2020/day/18) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day18/day18.rs) [![Python](../../scripts/assets/python.png)](day18/day18.py) +[Day 19: Monster Messages](https://adventofcode.com/2020/day/19) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day19/day19.rs) +[Day 20: Jurassic Jigsaw](https://adventofcode.com/2020/day/20) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day20/day20.rs) [![Python](../../scripts/assets/python.png)](day20/day20.py) +[Day 21: Allergen Assessment](https://adventofcode.com/2020/day/21) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day21/day21.rs) [![Python](../../scripts/assets/python.png)](day21/day21.py) +[Day 22: Crab Combat](https://adventofcode.com/2020/day/22) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day22/day22.rs) [![Python](../../scripts/assets/python.png)](day22/day22.py) +[Day 23: Crab Cups](https://adventofcode.com/2020/day/23) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day23/day23.rs) +[Day 24: Lobby Layout](https://adventofcode.com/2020/day/24) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day24/day24.rs) [![Python](../../scripts/assets/python.png)](day24/day24.py) +[Day 25: Combo Breaker](https://adventofcode.com/2020/day/25) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day25/day25.rs) [![Python](../../scripts/assets/python.png)](day25/day25.py) diff --git a/2020/day1/day1.py b/src/year2020/day1/day1.py similarity index 100% rename from 2020/day1/day1.py rename to src/year2020/day1/day1.py diff --git a/2020/day1/day1.rs b/src/year2020/day1/day1.rs similarity index 98% rename from 2020/day1/day1.rs rename to src/year2020/day1/day1.rs index 616a5211..7f92b01b 100644 --- a/2020/day1/day1.rs +++ b/src/year2020/day1/day1.rs @@ -39,7 +39,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2020/day1/test.txt b/src/year2020/day1/test.txt similarity index 100% rename from 2020/day1/test.txt rename to src/year2020/day1/test.txt diff --git a/2020/day10/day10.py b/src/year2020/day10/day10.py similarity index 100% rename from 2020/day10/day10.py rename to src/year2020/day10/day10.py diff --git a/2020/day10/day10.rs b/src/year2020/day10/day10.rs similarity index 98% rename from 2020/day10/day10.rs rename to src/year2020/day10/day10.rs index 708ffb3b..58a79838 100644 --- a/2020/day10/day10.rs +++ b/src/year2020/day10/day10.rs @@ -52,7 +52,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, i64) { let puzzle = Puzzle::new(data); diff --git a/2020/day10/sample_1.txt b/src/year2020/day10/sample_1.txt similarity index 100% rename from 2020/day10/sample_1.txt rename to src/year2020/day10/sample_1.txt diff --git a/2020/day10/sample_2.txt b/src/year2020/day10/sample_2.txt similarity index 100% rename from 2020/day10/sample_2.txt rename to src/year2020/day10/sample_2.txt diff --git a/2020/day11/day11.py b/src/year2020/day11/day11.py similarity index 100% rename from 2020/day11/day11.py rename to src/year2020/day11/day11.py diff --git a/2020/day11/day11.rs b/src/year2020/day11/day11.rs similarity index 99% rename from 2020/day11/day11.rs rename to src/year2020/day11/day11.rs index e48c3c4f..7fa0b0f3 100644 --- a/2020/day11/day11.rs +++ b/src/year2020/day11/day11.rs @@ -96,7 +96,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2020/day11/test.txt b/src/year2020/day11/test.txt similarity index 100% rename from 2020/day11/test.txt rename to src/year2020/day11/test.txt diff --git a/2020/day12/day12.py b/src/year2020/day12/day12.py similarity index 100% rename from 2020/day12/day12.py rename to src/year2020/day12/day12.py diff --git a/2020/day12/day12.rs b/src/year2020/day12/day12.rs similarity index 99% rename from 2020/day12/day12.rs rename to src/year2020/day12/day12.rs index ee02aae5..a6f90846 100644 --- a/2020/day12/day12.rs +++ b/src/year2020/day12/day12.rs @@ -83,7 +83,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let puzzle = Puzzle::new(data); diff --git a/2020/day12/test.txt b/src/year2020/day12/test.txt similarity index 100% rename from 2020/day12/test.txt rename to src/year2020/day12/test.txt diff --git a/2020/day13/day13.py b/src/year2020/day13/day13.py similarity index 100% rename from 2020/day13/day13.py rename to src/year2020/day13/day13.py diff --git a/2020/day13/day13.rs b/src/year2020/day13/day13.rs similarity index 99% rename from 2020/day13/day13.rs rename to src/year2020/day13/day13.rs index 94ef3603..f56667d1 100644 --- a/2020/day13/day13.rs +++ b/src/year2020/day13/day13.rs @@ -63,7 +63,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, i64) { let puzzle = Puzzle::new(data); diff --git a/2020/day13/test.txt b/src/year2020/day13/test.txt similarity index 100% rename from 2020/day13/test.txt rename to src/year2020/day13/test.txt diff --git a/2020/day14/day14.py b/src/year2020/day14/day14.py similarity index 100% rename from 2020/day14/day14.py rename to src/year2020/day14/day14.py diff --git a/2020/day14/day14.rs b/src/year2020/day14/day14.rs similarity index 99% rename from 2020/day14/day14.rs rename to src/year2020/day14/day14.rs index b1ebc46a..331b6746 100644 --- a/2020/day14/day14.rs +++ b/src/year2020/day14/day14.rs @@ -80,7 +80,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2020/day14/sample_1.txt b/src/year2020/day14/sample_1.txt similarity index 100% rename from 2020/day14/sample_1.txt rename to src/year2020/day14/sample_1.txt diff --git a/2020/day14/sample_5.txt b/src/year2020/day14/sample_5.txt similarity index 100% rename from 2020/day14/sample_5.txt rename to src/year2020/day14/sample_5.txt diff --git a/2020/day15/day15.py b/src/year2020/day15/day15.py similarity index 100% rename from 2020/day15/day15.py rename to src/year2020/day15/day15.py diff --git a/2020/day15/day15.rs b/src/year2020/day15/day15.rs similarity index 98% rename from 2020/day15/day15.rs rename to src/year2020/day15/day15.rs index 937eb53c..4b922aef 100644 --- a/2020/day15/day15.rs +++ b/src/year2020/day15/day15.rs @@ -62,7 +62,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2020/day15/test.txt b/src/year2020/day15/test.txt similarity index 100% rename from 2020/day15/test.txt rename to src/year2020/day15/test.txt diff --git a/2020/day16/day16.py b/src/year2020/day16/day16.py similarity index 100% rename from 2020/day16/day16.py rename to src/year2020/day16/day16.py diff --git a/2020/day16/day16.rs b/src/year2020/day16/day16.rs similarity index 99% rename from 2020/day16/day16.rs rename to src/year2020/day16/day16.rs index 46b73ba9..7a6ddfd0 100644 --- a/2020/day16/day16.rs +++ b/src/year2020/day16/day16.rs @@ -173,7 +173,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u64) { let puzzle = Puzzle::new(data); diff --git a/2020/day16/sample_2.txt b/src/year2020/day16/sample_2.txt similarity index 100% rename from 2020/day16/sample_2.txt rename to src/year2020/day16/sample_2.txt diff --git a/2020/day16/sample_3.txt b/src/year2020/day16/sample_3.txt similarity index 100% rename from 2020/day16/sample_3.txt rename to src/year2020/day16/sample_3.txt diff --git a/2020/day17/day17.py b/src/year2020/day17/day17.py similarity index 100% rename from 2020/day17/day17.py rename to src/year2020/day17/day17.py diff --git a/2020/day17/day17.rs b/src/year2020/day17/day17.rs similarity index 99% rename from 2020/day17/day17.rs rename to src/year2020/day17/day17.rs index bda758e6..aa89a19d 100644 --- a/2020/day17/day17.rs +++ b/src/year2020/day17/day17.rs @@ -125,7 +125,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2020/day17/test.txt b/src/year2020/day17/test.txt similarity index 100% rename from 2020/day17/test.txt rename to src/year2020/day17/test.txt diff --git a/2020/day18/day18.py b/src/year2020/day18/day18.py similarity index 100% rename from 2020/day18/day18.py rename to src/year2020/day18/day18.py diff --git a/2020/day18/day18.rs b/src/year2020/day18/day18.rs similarity index 99% rename from 2020/day18/day18.rs rename to src/year2020/day18/day18.rs index 1949972f..70c84c5e 100644 --- a/2020/day18/day18.rs +++ b/src/year2020/day18/day18.rs @@ -116,7 +116,6 @@ impl Expr { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let mut part1 = 0; diff --git a/2020/day19/day19.rs b/src/year2020/day19/day19.rs similarity index 99% rename from 2020/day19/day19.rs rename to src/year2020/day19/day19.rs index 6f0248ed..5c1048a5 100644 --- a/2020/day19/day19.rs +++ b/src/year2020/day19/day19.rs @@ -153,7 +153,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let mut puzzle = Puzzle::new(data); diff --git a/2020/day19/test.txt b/src/year2020/day19/test.txt similarity index 100% rename from 2020/day19/test.txt rename to src/year2020/day19/test.txt diff --git a/2020/day19/test2.txt b/src/year2020/day19/test2.txt similarity index 100% rename from 2020/day19/test2.txt rename to src/year2020/day19/test2.txt diff --git a/2020/day2/day2.py b/src/year2020/day2/day2.py similarity index 100% rename from 2020/day2/day2.py rename to src/year2020/day2/day2.py diff --git a/2020/day2/day2.rs b/src/year2020/day2/day2.rs similarity index 98% rename from 2020/day2/day2.rs rename to src/year2020/day2/day2.rs index 532bc403..78d776b4 100644 --- a/2020/day2/day2.rs +++ b/src/year2020/day2/day2.rs @@ -60,7 +60,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2020/day2/test.txt b/src/year2020/day2/test.txt similarity index 100% rename from 2020/day2/test.txt rename to src/year2020/day2/test.txt diff --git a/2020/day20/day20.py b/src/year2020/day20/day20.py similarity index 100% rename from 2020/day20/day20.py rename to src/year2020/day20/day20.py diff --git a/2020/day20/day20.rs b/src/year2020/day20/day20.rs similarity index 99% rename from 2020/day20/day20.rs rename to src/year2020/day20/day20.rs index d0a93482..9e4dd995 100644 --- a/2020/day20/day20.rs +++ b/src/year2020/day20/day20.rs @@ -273,7 +273,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, usize) { let puzzle = Puzzle::new(data); diff --git a/2020/day20/test.txt b/src/year2020/day20/test.txt similarity index 100% rename from 2020/day20/test.txt rename to src/year2020/day20/test.txt diff --git a/2020/day21/day21.py b/src/year2020/day21/day21.py similarity index 100% rename from 2020/day21/day21.py rename to src/year2020/day21/day21.py diff --git a/2020/day21/day21.rs b/src/year2020/day21/day21.rs similarity index 99% rename from 2020/day21/day21.rs rename to src/year2020/day21/day21.rs index 4e4acc3b..e702172f 100644 --- a/2020/day21/day21.rs +++ b/src/year2020/day21/day21.rs @@ -103,7 +103,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, String) { let puzzle = Puzzle::new(data); diff --git a/2020/day21/test.txt b/src/year2020/day21/test.txt similarity index 100% rename from 2020/day21/test.txt rename to src/year2020/day21/test.txt diff --git a/2020/day22/day22.py b/src/year2020/day22/day22.py similarity index 100% rename from 2020/day22/day22.py rename to src/year2020/day22/day22.py diff --git a/2020/day22/day22.rs b/src/year2020/day22/day22.rs similarity index 99% rename from 2020/day22/day22.rs rename to src/year2020/day22/day22.rs index 32eb04c6..d2fcc40c 100644 --- a/2020/day22/day22.rs +++ b/src/year2020/day22/day22.rs @@ -167,7 +167,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2020/day22/test.txt b/src/year2020/day22/test.txt similarity index 100% rename from 2020/day22/test.txt rename to src/year2020/day22/test.txt diff --git a/2020/day23/day23.rs b/src/year2020/day23/day23.rs similarity index 99% rename from 2020/day23/day23.rs rename to src/year2020/day23/day23.rs index 2a7b2e82..8c696606 100644 --- a/2020/day23/day23.rs +++ b/src/year2020/day23/day23.rs @@ -88,7 +88,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2020/day23/test.txt b/src/year2020/day23/test.txt similarity index 100% rename from 2020/day23/test.txt rename to src/year2020/day23/test.txt diff --git a/2020/day24/day24.py b/src/year2020/day24/day24.py similarity index 100% rename from 2020/day24/day24.py rename to src/year2020/day24/day24.py diff --git a/2020/day24/day24.rs b/src/year2020/day24/day24.rs similarity index 99% rename from 2020/day24/day24.rs rename to src/year2020/day24/day24.rs index 6d14f3fc..c58256c6 100644 --- a/2020/day24/day24.rs +++ b/src/year2020/day24/day24.rs @@ -130,7 +130,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2020/day24/test.txt b/src/year2020/day24/test.txt similarity index 100% rename from 2020/day24/test.txt rename to src/year2020/day24/test.txt diff --git a/2020/day25/day25.py b/src/year2020/day25/day25.py similarity index 100% rename from 2020/day25/day25.py rename to src/year2020/day25/day25.py diff --git a/2020/day25/day25.rs b/src/year2020/day25/day25.rs similarity index 98% rename from 2020/day25/day25.rs rename to src/year2020/day25/day25.rs index 965c2b8e..dca28499 100644 --- a/2020/day25/day25.rs +++ b/src/year2020/day25/day25.rs @@ -41,7 +41,6 @@ fn discrete_log(a: u64, mut b: u64, order_n: u64) -> Option { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, aoc::Christmas) { let (a, b) = data.split_once('\n').unwrap(); diff --git a/2020/day25/test.txt b/src/year2020/day25/test.txt similarity index 100% rename from 2020/day25/test.txt rename to src/year2020/day25/test.txt diff --git a/2020/day3/day3.py b/src/year2020/day3/day3.py similarity index 100% rename from 2020/day3/day3.py rename to src/year2020/day3/day3.py diff --git a/2020/day3/day3.rs b/src/year2020/day3/day3.rs similarity index 98% rename from 2020/day3/day3.rs rename to src/year2020/day3/day3.rs index ac987f6a..a7ac257a 100644 --- a/2020/day3/day3.rs +++ b/src/year2020/day3/day3.rs @@ -42,7 +42,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2020/day3/test.txt b/src/year2020/day3/test.txt similarity index 100% rename from 2020/day3/test.txt rename to src/year2020/day3/test.txt diff --git a/2020/day4/day4.py b/src/year2020/day4/day4.py similarity index 100% rename from 2020/day4/day4.py rename to src/year2020/day4/day4.py diff --git a/2020/day4/day4.rs b/src/year2020/day4/day4.rs similarity index 99% rename from 2020/day4/day4.rs rename to src/year2020/day4/day4.rs index 3dfb4dfd..d750e561 100644 --- a/2020/day4/day4.rs +++ b/src/year2020/day4/day4.rs @@ -95,7 +95,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2020/day4/sample_1.txt b/src/year2020/day4/sample_1.txt similarity index 100% rename from 2020/day4/sample_1.txt rename to src/year2020/day4/sample_1.txt diff --git a/2020/day4/sample_3.txt b/src/year2020/day4/sample_3.txt similarity index 100% rename from 2020/day4/sample_3.txt rename to src/year2020/day4/sample_3.txt diff --git a/2020/day4/sample_4.txt b/src/year2020/day4/sample_4.txt similarity index 100% rename from 2020/day4/sample_4.txt rename to src/year2020/day4/sample_4.txt diff --git a/2020/day5/day5.py b/src/year2020/day5/day5.py similarity index 100% rename from 2020/day5/day5.py rename to src/year2020/day5/day5.py diff --git a/2020/day5/day5.rs b/src/year2020/day5/day5.rs similarity index 98% rename from 2020/day5/day5.rs rename to src/year2020/day5/day5.rs index ce0a12d1..2201ca67 100644 --- a/2020/day5/day5.rs +++ b/src/year2020/day5/day5.rs @@ -56,7 +56,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2020/day6/day6.py b/src/year2020/day6/day6.py similarity index 100% rename from 2020/day6/day6.py rename to src/year2020/day6/day6.py diff --git a/2020/day6/day6.rs b/src/year2020/day6/day6.rs similarity index 98% rename from 2020/day6/day6.rs rename to src/year2020/day6/day6.rs index 136dfab1..afab42cf 100644 --- a/2020/day6/day6.rs +++ b/src/year2020/day6/day6.rs @@ -46,7 +46,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2020/day6/test.txt b/src/year2020/day6/test.txt similarity index 100% rename from 2020/day6/test.txt rename to src/year2020/day6/test.txt diff --git a/2020/day7/day7.py b/src/year2020/day7/day7.py similarity index 100% rename from 2020/day7/day7.py rename to src/year2020/day7/day7.py diff --git a/2020/day7/day7.rs b/src/year2020/day7/day7.rs similarity index 98% rename from 2020/day7/day7.rs rename to src/year2020/day7/day7.rs index 285f24a2..acefd0a9 100644 --- a/2020/day7/day7.rs +++ b/src/year2020/day7/day7.rs @@ -71,7 +71,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2020/day7/sample_1.txt b/src/year2020/day7/sample_1.txt similarity index 100% rename from 2020/day7/sample_1.txt rename to src/year2020/day7/sample_1.txt diff --git a/2020/day7/sample_2.txt b/src/year2020/day7/sample_2.txt similarity index 100% rename from 2020/day7/sample_2.txt rename to src/year2020/day7/sample_2.txt diff --git a/2020/day8/day8.py b/src/year2020/day8/day8.py similarity index 100% rename from 2020/day8/day8.py rename to src/year2020/day8/day8.py diff --git a/2020/day8/day8.rs b/src/year2020/day8/day8.rs similarity index 98% rename from 2020/day8/day8.rs rename to src/year2020/day8/day8.rs index f6331a07..5c172cb3 100644 --- a/2020/day8/day8.rs +++ b/src/year2020/day8/day8.rs @@ -74,7 +74,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let puzzle = Puzzle::new(data); diff --git a/2020/day8/test.txt b/src/year2020/day8/test.txt similarity index 100% rename from 2020/day8/test.txt rename to src/year2020/day8/test.txt diff --git a/2020/day9/day9.py b/src/year2020/day9/day9.py similarity index 100% rename from 2020/day9/day9.py rename to src/year2020/day9/day9.py diff --git a/2020/day9/day9.rs b/src/year2020/day9/day9.rs similarity index 98% rename from 2020/day9/day9.rs rename to src/year2020/day9/day9.rs index cb20965a..73773f89 100644 --- a/2020/day9/day9.rs +++ b/src/year2020/day9/day9.rs @@ -58,7 +58,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2020/day9/test.txt b/src/year2020/day9/test.txt similarity index 100% rename from 2020/day9/test.txt rename to src/year2020/day9/test.txt diff --git a/src/year2021/README.md b/src/year2021/README.md new file mode 100644 index 00000000..c1af513a --- /dev/null +++ b/src/year2021/README.md @@ -0,0 +1,36 @@ +# Advent of Code in Rust 🦀 + +![AoC2021](https://img.shields.io/badge/Advent_of_Code-2021-8A2BE2) +![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) +![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) +![Python: 13](https://img.shields.io/badge/Python-13-cyan?logo=Python) + +## 2021 ([Calendar](https://adventofcode.com/2021)) ([Solutions](./)) : 50⭐ + +Puzzle | Stars | Languages +----------------------------------------------------------------------- | ----- | ----------- +[Day 1: Sonar Sweep](https://adventofcode.com/2021/day/1) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day1/day1.rs) [![Python](../../scripts/assets/python.png)](day1/day1.py) +[Day 2: Dive!](https://adventofcode.com/2021/day/2) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day2/day2.rs) +[Day 3: Binary Diagnostic](https://adventofcode.com/2021/day/3) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day3/day3.rs) +[Day 4: Giant Squid](https://adventofcode.com/2021/day/4) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day4/day4.rs) [![Python](../../scripts/assets/python.png)](day4/day4_bug.py) +[Day 5: Hydrothermal Venture](https://adventofcode.com/2021/day/5) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day5/day5.rs) [![Python](../../scripts/assets/python.png)](day5/day5.py) +[Day 6: Lanternfish](https://adventofcode.com/2021/day/6) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day6/day6.rs) [![Python](../../scripts/assets/python.png)](day6/day6.py) +[Day 7: The Treachery of Whales](https://adventofcode.com/2021/day/7) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day7/day7.rs) +[Day 8: Seven Segment Search](https://adventofcode.com/2021/day/8) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day8/day8.rs) [![Python](../../scripts/assets/python.png)](day8/day8.py) +[Day 9: Smoke Basin](https://adventofcode.com/2021/day/9) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day9/day9.rs) [![Python](../../scripts/assets/python.png)](day9/day9.py) +[Day 10: Syntax Scoring](https://adventofcode.com/2021/day/10) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day10/day10.rs) [![Python](../../scripts/assets/python.png)](day10/day10.py) +[Day 11: Dumbo Octopus](https://adventofcode.com/2021/day/11) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day11/day11.rs) +[Day 12: Passage Pathing](https://adventofcode.com/2021/day/12) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day12/day12.rs) [![Python](../../scripts/assets/python.png)](day12/day12.py) +[Day 13: Transparent Origami](https://adventofcode.com/2021/day/13) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day13/day13.rs) [![Python](../../scripts/assets/python.png)](day13/day13.py) +[Day 14: Extended Polymerization](https://adventofcode.com/2021/day/14) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day14/day14.rs) +[Day 15: Chiton](https://adventofcode.com/2021/day/15) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day15/day15.rs) +[Day 16: Packet Decoder](https://adventofcode.com/2021/day/16) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day16/day16.rs) [![Python](../../scripts/assets/python.png)](day16/day16.py) +[Day 17: Trick Shot](https://adventofcode.com/2021/day/17) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day17/day17.rs) +[Day 18: Snailfish](https://adventofcode.com/2021/day/18) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day18/day18.rs) [![Python](../../scripts/assets/python.png)](day18/day18_eval.py) [![Python](../../scripts/assets/python.png)](day18/day18.py) +[Day 19: Beacon Scanner](https://adventofcode.com/2021/day/19) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day19/day19.rs) +[Day 20: Trench Map](https://adventofcode.com/2021/day/20) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day20/day20.rs) +[Day 21: Dirac Dice](https://adventofcode.com/2021/day/21) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day21/day21.rs) +[Day 22: Reactor Reboot](https://adventofcode.com/2021/day/22) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day22/day22.rs) +[Day 23: Amphipod](https://adventofcode.com/2021/day/23) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day23/day23.rs) +[Day 24: Arithmetic Logic Unit](https://adventofcode.com/2021/day/24) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day24/day24.rs) +[Day 25: Sea Cucumber](https://adventofcode.com/2021/day/25) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day25/day25.rs) [![Python](../../scripts/assets/python.png)](day25/day25.py) diff --git a/2021/day1/day1.py b/src/year2021/day1/day1.py similarity index 100% rename from 2021/day1/day1.py rename to src/year2021/day1/day1.py diff --git a/2021/day1/day1.rs b/src/year2021/day1/day1.rs similarity index 97% rename from 2021/day1/day1.rs rename to src/year2021/day1/day1.rs index 9e65def9..07fa7b62 100644 --- a/2021/day1/day1.rs +++ b/src/year2021/day1/day1.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let mut prev_num = 999_999_999_u32; diff --git a/2021/day1/test.txt b/src/year2021/day1/test.txt similarity index 100% rename from 2021/day1/test.txt rename to src/year2021/day1/test.txt diff --git a/2021/day10/day10.py b/src/year2021/day10/day10.py similarity index 100% rename from 2021/day10/day10.py rename to src/year2021/day10/day10.py diff --git a/2021/day10/day10.rs b/src/year2021/day10/day10.rs similarity index 98% rename from 2021/day10/day10.rs rename to src/year2021/day10/day10.rs index b9d16568..87f30a29 100644 --- a/2021/day10/day10.rs +++ b/src/year2021/day10/day10.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let mut part1 = 0; diff --git a/2021/day10/test.txt b/src/year2021/day10/test.txt similarity index 100% rename from 2021/day10/test.txt rename to src/year2021/day10/test.txt diff --git a/2021/day11/day11.rs b/src/year2021/day11/day11.rs similarity index 99% rename from 2021/day11/day11.rs rename to src/year2021/day11/day11.rs index de4f958b..b4b4af9a 100644 --- a/2021/day11/day11.rs +++ b/src/year2021/day11/day11.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let data = data diff --git a/2021/day11/demo.txt b/src/year2021/day11/demo.txt similarity index 100% rename from 2021/day11/demo.txt rename to src/year2021/day11/demo.txt diff --git a/2021/day12/day12.py b/src/year2021/day12/day12.py similarity index 100% rename from 2021/day12/day12.py rename to src/year2021/day12/day12.py diff --git a/2021/day12/day12.rs b/src/year2021/day12/day12.rs similarity index 99% rename from 2021/day12/day12.rs rename to src/year2021/day12/day12.rs index aaa92914..a3886b7e 100644 --- a/2021/day12/day12.rs +++ b/src/year2021/day12/day12.rs @@ -71,7 +71,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let small_once = compute_paths(data, false); diff --git a/2021/day13/day13.py b/src/year2021/day13/day13.py similarity index 100% rename from 2021/day13/day13.py rename to src/year2021/day13/day13.py diff --git a/2021/day13/day13.rs b/src/year2021/day13/day13.rs similarity index 98% rename from 2021/day13/day13.rs rename to src/year2021/day13/day13.rs index bb97f679..4665d334 100644 --- a/2021/day13/day13.rs +++ b/src/year2021/day13/day13.rs @@ -8,7 +8,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, String) { let n = 2000; diff --git a/2021/day13/test.txt b/src/year2021/day13/test.txt similarity index 100% rename from 2021/day13/test.txt rename to src/year2021/day13/test.txt diff --git a/2021/day14/day14.rs b/src/year2021/day14/day14.rs similarity index 99% rename from 2021/day14/day14.rs rename to src/year2021/day14/day14.rs index eb236d0b..e0bba4cb 100644 --- a/2021/day14/day14.rs +++ b/src/year2021/day14/day14.rs @@ -154,7 +154,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2021/day14/step1.py b/src/year2021/day14/step1.py similarity index 100% rename from 2021/day14/step1.py rename to src/year2021/day14/step1.py diff --git a/2021/day14/step2.py b/src/year2021/day14/step2.py similarity index 100% rename from 2021/day14/step2.py rename to src/year2021/day14/step2.py diff --git a/2021/day14/test01.txt b/src/year2021/day14/test01.txt similarity index 100% rename from 2021/day14/test01.txt rename to src/year2021/day14/test01.txt diff --git a/2021/day14/test02.txt b/src/year2021/day14/test02.txt similarity index 100% rename from 2021/day14/test02.txt rename to src/year2021/day14/test02.txt diff --git a/2021/day15/day15.rs b/src/year2021/day15/day15.rs similarity index 99% rename from 2021/day15/day15.rs rename to src/year2021/day15/day15.rs index ec2c9161..0e5faf63 100644 --- a/2021/day15/day15.rs +++ b/src/year2021/day15/day15.rs @@ -135,7 +135,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2021/day15/sample_1.txt b/src/year2021/day15/sample_1.txt similarity index 100% rename from 2021/day15/sample_1.txt rename to src/year2021/day15/sample_1.txt diff --git a/2021/day16/day16.py b/src/year2021/day16/day16.py similarity index 100% rename from 2021/day16/day16.py rename to src/year2021/day16/day16.py diff --git a/2021/day16/day16.rs b/src/year2021/day16/day16.rs similarity index 99% rename from 2021/day16/day16.rs rename to src/year2021/day16/day16.rs index 3ce68afa..d57a85f4 100644 --- a/2021/day16/day16.rs +++ b/src/year2021/day16/day16.rs @@ -76,7 +76,6 @@ fn read_packet(packet: &str, mut offset: usize, sum_of_versions: &mut u32) -> (u } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u64) { let bin_data: String = data diff --git a/2021/day17/day17.rs b/src/year2021/day17/day17.rs similarity index 98% rename from 2021/day17/day17.rs rename to src/year2021/day17/day17.rs index e4c6face..1b09c763 100644 --- a/2021/day17/day17.rs +++ b/src/year2021/day17/day17.rs @@ -9,7 +9,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let abs_min: i32; diff --git a/2021/day17/test.txt b/src/year2021/day17/test.txt similarity index 100% rename from 2021/day17/test.txt rename to src/year2021/day17/test.txt diff --git a/2021/day18/day18.py b/src/year2021/day18/day18.py similarity index 100% rename from 2021/day18/day18.py rename to src/year2021/day18/day18.py diff --git a/2021/day18/day18.rs b/src/year2021/day18/day18.rs similarity index 99% rename from 2021/day18/day18.rs rename to src/year2021/day18/day18.rs index 539efd70..46fbd22a 100644 --- a/2021/day18/day18.rs +++ b/src/year2021/day18/day18.rs @@ -162,7 +162,6 @@ impl fmt::Display for Snailfish { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let numbers: Vec = data.lines().map(Snailfish::from_str).collect(); diff --git a/2021/day18/day18_eval.py b/src/year2021/day18/day18_eval.py similarity index 100% rename from 2021/day18/day18_eval.py rename to src/year2021/day18/day18_eval.py diff --git a/2021/day18/sample_1.txt b/src/year2021/day18/sample_1.txt similarity index 100% rename from 2021/day18/sample_1.txt rename to src/year2021/day18/sample_1.txt diff --git a/2021/day18/sample_7.txt b/src/year2021/day18/sample_7.txt similarity index 100% rename from 2021/day18/sample_7.txt rename to src/year2021/day18/sample_7.txt diff --git a/2021/day18/sample_8.txt b/src/year2021/day18/sample_8.txt similarity index 100% rename from 2021/day18/sample_8.txt rename to src/year2021/day18/sample_8.txt diff --git a/2021/day19/day19.rs b/src/year2021/day19/day19.rs similarity index 99% rename from 2021/day19/day19.rs rename to src/year2021/day19/day19.rs index 6eb66173..18a0c76b 100644 --- a/2021/day19/day19.rs +++ b/src/year2021/day19/day19.rs @@ -29,7 +29,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, i32) { // load puzzle data diff --git a/2021/day19/test.txt b/src/year2021/day19/test.txt similarity index 100% rename from 2021/day19/test.txt rename to src/year2021/day19/test.txt diff --git a/2021/day2/day2.rs b/src/year2021/day2/day2.rs similarity index 98% rename from 2021/day2/day2.rs rename to src/year2021/day2/day2.rs index ff66dc50..eccc3c77 100644 --- a/2021/day2/day2.rs +++ b/src/year2021/day2/day2.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { (part1(data), part2(data)) diff --git a/2021/day2/test.txt b/src/year2021/day2/test.txt similarity index 100% rename from 2021/day2/test.txt rename to src/year2021/day2/test.txt diff --git a/2021/day20/day20.rs b/src/year2021/day20/day20.rs similarity index 99% rename from 2021/day20/day20.rs rename to src/year2021/day20/day20.rs index 3911c8da..9819e99d 100644 --- a/2021/day20/day20.rs +++ b/src/year2021/day20/day20.rs @@ -12,7 +12,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let data = data diff --git a/2021/day20/test.txt b/src/year2021/day20/test.txt similarity index 100% rename from 2021/day20/test.txt rename to src/year2021/day20/test.txt diff --git a/2021/day21/day21.rs b/src/year2021/day21/day21.rs similarity index 99% rename from 2021/day21/day21.rs rename to src/year2021/day21/day21.rs index 9a110e4f..6ac5a4bf 100644 --- a/2021/day21/day21.rs +++ b/src/year2021/day21/day21.rs @@ -8,7 +8,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u64) { let players = data.trim_ascii().split_once('\n').unwrap(); diff --git a/2021/day22/day22.rs b/src/year2021/day22/day22.rs similarity index 99% rename from 2021/day22/day22.rs rename to src/year2021/day22/day22.rs index 988ce3ce..50f832ce 100644 --- a/2021/day22/day22.rs +++ b/src/year2021/day22/day22.rs @@ -129,7 +129,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, i64) { (part1(data), part2(data)) diff --git a/2021/day22/sample_1.txt b/src/year2021/day22/sample_1.txt similarity index 100% rename from 2021/day22/sample_1.txt rename to src/year2021/day22/sample_1.txt diff --git a/2021/day22/sample_2.txt b/src/year2021/day22/sample_2.txt similarity index 100% rename from 2021/day22/sample_2.txt rename to src/year2021/day22/sample_2.txt diff --git a/2021/day22/sample_3.txt b/src/year2021/day22/sample_3.txt similarity index 100% rename from 2021/day22/sample_3.txt rename to src/year2021/day22/sample_3.txt diff --git a/2021/day23/day23.rs b/src/year2021/day23/day23.rs similarity index 99% rename from 2021/day23/day23.rs rename to src/year2021/day23/day23.rs index 9046504e..3c2e90a1 100644 --- a/2021/day23/day23.rs +++ b/src/year2021/day23/day23.rs @@ -264,7 +264,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let mut puzzle = Puzzle::new(data); diff --git a/2021/day23/test.txt b/src/year2021/day23/test.txt similarity index 100% rename from 2021/day23/test.txt rename to src/year2021/day23/test.txt diff --git a/2021/day24/boxes.py b/src/year2021/day24/boxes.py similarity index 100% rename from 2021/day24/boxes.py rename to src/year2021/day24/boxes.py diff --git a/2021/day24/day24.rs b/src/year2021/day24/day24.rs similarity index 99% rename from 2021/day24/day24.rs rename to src/year2021/day24/day24.rs index feb955c9..ca371739 100644 --- a/2021/day24/day24.rs +++ b/src/year2021/day24/day24.rs @@ -178,7 +178,6 @@ const fn run_box(w: i64, z: i64, div: i64, n1: i64, n2: i64) -> i64 { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let data = data diff --git a/2021/day24/demo.txt b/src/year2021/day24/demo.txt similarity index 100% rename from 2021/day24/demo.txt rename to src/year2021/day24/demo.txt diff --git a/2021/day25/day25.py b/src/year2021/day25/day25.py similarity index 100% rename from 2021/day25/day25.py rename to src/year2021/day25/day25.py diff --git a/2021/day25/day25.rs b/src/year2021/day25/day25.rs similarity index 98% rename from 2021/day25/day25.rs rename to src/year2021/day25/day25.rs index 57c1591d..ce6a5d36 100644 --- a/2021/day25/day25.rs +++ b/src/year2021/day25/day25.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, aoc::Christmas) { let data = data.lines().collect::>(); diff --git a/2021/day25/test.txt b/src/year2021/day25/test.txt similarity index 100% rename from 2021/day25/test.txt rename to src/year2021/day25/test.txt diff --git a/2021/day3/day3.rs b/src/year2021/day3/day3.rs similarity index 99% rename from 2021/day3/day3.rs rename to src/year2021/day3/day3.rs index 98c40631..e65b0bcf 100644 --- a/2021/day3/day3.rs +++ b/src/year2021/day3/day3.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, isize) { let data: Vec<_> = data.lines().collect(); diff --git a/2021/day3/step2.py b/src/year2021/day3/step2.py similarity index 100% rename from 2021/day3/step2.py rename to src/year2021/day3/step2.py diff --git a/2021/day3/test.txt b/src/year2021/day3/test.txt similarity index 100% rename from 2021/day3/test.txt rename to src/year2021/day3/test.txt diff --git a/2021/day4/day4.rs b/src/year2021/day4/day4.rs similarity index 99% rename from 2021/day4/day4.rs rename to src/year2021/day4/day4.rs index 2f308afc..2fe4d364 100644 --- a/2021/day4/day4.rs +++ b/src/year2021/day4/day4.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let data = data diff --git a/2021/day4/day4_bug.py b/src/year2021/day4/day4_bug.py similarity index 100% rename from 2021/day4/day4_bug.py rename to src/year2021/day4/day4_bug.py diff --git a/2021/day4/test.txt b/src/year2021/day4/test.txt similarity index 100% rename from 2021/day4/test.txt rename to src/year2021/day4/test.txt diff --git a/2021/day5/day5.py b/src/year2021/day5/day5.py similarity index 100% rename from 2021/day5/day5.py rename to src/year2021/day5/day5.py diff --git a/2021/day5/day5.rs b/src/year2021/day5/day5.rs similarity index 99% rename from 2021/day5/day5.rs rename to src/year2021/day5/day5.rs index 633fcd74..3b70680b 100644 --- a/2021/day5/day5.rs +++ b/src/year2021/day5/day5.rs @@ -8,7 +8,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let re = Regex::new(r"^(\d+),(\d+) -> (\d+),(\d+)$").unwrap(); diff --git a/2021/day5/test.txt b/src/year2021/day5/test.txt similarity index 100% rename from 2021/day5/test.txt rename to src/year2021/day5/test.txt diff --git a/2021/day6/day6.py b/src/year2021/day6/day6.py similarity index 100% rename from 2021/day6/day6.py rename to src/year2021/day6/day6.py diff --git a/2021/day6/day6.rs b/src/year2021/day6/day6.rs similarity index 97% rename from 2021/day6/day6.rs rename to src/year2021/day6/day6.rs index 7ad890a1..4cb6f8ac 100644 --- a/2021/day6/day6.rs +++ b/src/year2021/day6/day6.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let mut timers = [0u64; 9]; diff --git a/2021/day6/test.txt b/src/year2021/day6/test.txt similarity index 100% rename from 2021/day6/test.txt rename to src/year2021/day6/test.txt diff --git a/2021/day7/day7.rs b/src/year2021/day7/day7.rs similarity index 97% rename from 2021/day7/day7.rs rename to src/year2021/day7/day7.rs index b701e239..fe5f44b3 100644 --- a/2021/day7/day7.rs +++ b/src/year2021/day7/day7.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let positions = data diff --git a/2021/day7/test.txt b/src/year2021/day7/test.txt similarity index 100% rename from 2021/day7/test.txt rename to src/year2021/day7/test.txt diff --git a/2021/day8/day8.py b/src/year2021/day8/day8.py similarity index 100% rename from 2021/day8/day8.py rename to src/year2021/day8/day8.py diff --git a/2021/day8/day8.rs b/src/year2021/day8/day8.rs similarity index 99% rename from 2021/day8/day8.rs rename to src/year2021/day8/day8.rs index c01644cd..b77a68f9 100644 --- a/2021/day8/day8.rs +++ b/src/year2021/day8/day8.rs @@ -9,7 +9,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, u32) { (part1(data), part2(data)) diff --git a/2021/day8/test.txt b/src/year2021/day8/test.txt similarity index 100% rename from 2021/day8/test.txt rename to src/year2021/day8/test.txt diff --git a/2021/day9/day9.py b/src/year2021/day9/day9.py similarity index 100% rename from 2021/day9/day9.py rename to src/year2021/day9/day9.py diff --git a/2021/day9/day9.rs b/src/year2021/day9/day9.rs similarity index 98% rename from 2021/day9/day9.rs rename to src/year2021/day9/day9.rs index f413ace5..ad1f83a7 100644 --- a/2021/day9/day9.rs +++ b/src/year2021/day9/day9.rs @@ -6,7 +6,6 @@ pub fn main() { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let data = data diff --git a/2021/day9/test.txt b/src/year2021/day9/test.txt similarity index 100% rename from 2021/day9/test.txt rename to src/year2021/day9/test.txt diff --git a/src/year2021/ocr/ocr.py b/src/year2021/ocr/ocr.py new file mode 120000 index 00000000..244b4f93 --- /dev/null +++ b/src/year2021/ocr/ocr.py @@ -0,0 +1 @@ +../../year2022/ocr/ocr.py \ No newline at end of file diff --git a/src/year2022/README.md b/src/year2022/README.md new file mode 100644 index 00000000..ca8d27d3 --- /dev/null +++ b/src/year2022/README.md @@ -0,0 +1,36 @@ +# Advent of Code in Rust 🦀 + +![AoC2022](https://img.shields.io/badge/Advent_of_Code-2022-8A2BE2) +![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) +![Rust: 26](https://img.shields.io/badge/Rust-26-cyan?logo=Rust) +![Python: 19](https://img.shields.io/badge/Python-19-cyan?logo=Python) + +## 2022 ([Calendar](https://adventofcode.com/2022)) ([Solutions](./)) : 50⭐ + +Puzzle | Stars | Languages +------------------------------------------------------------------------ | ----- | ----------- +[Day 1: Calorie Counting](https://adventofcode.com/2022/day/1) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day1/day1.rs) [![Python](../../scripts/assets/python.png)](day1/day1_oneliner.py) [![Python](../../scripts/assets/python.png)](day1/day1.py) +[Day 2: Rock Paper Scissors](https://adventofcode.com/2022/day/2) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day2/day2.rs) [![Python](../../scripts/assets/python.png)](day2/day2.py) +[Day 3: Rucksack Reorganization](https://adventofcode.com/2022/day/3) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day3/day3.rs) [![Python](../../scripts/assets/python.png)](day3/day3.py) [![C](../../scripts/assets/c.png)](day3/day3.c) +[Day 4: Camp Cleanup](https://adventofcode.com/2022/day/4) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day4/day4.rs) [![Python](../../scripts/assets/python.png)](day4/day4.py) +[Day 5: Supply Stacks](https://adventofcode.com/2022/day/5) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day5/day5.rs) [![Python](../../scripts/assets/python.png)](day5/day5.py) +[Day 6: Tuning Trouble](https://adventofcode.com/2022/day/6) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day6/day6.rs) [![Python](../../scripts/assets/python.png)](day6/day6.py) +[Day 7: No Space Left On Device](https://adventofcode.com/2022/day/7) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day7/day7.rs) [![Python](../../scripts/assets/python.png)](day7/day7.py) +[Day 8: Treetop Tree House](https://adventofcode.com/2022/day/8) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day8/day8.rs) [![Python](../../scripts/assets/python.png)](day8/day8.py) +[Day 9: Rope Bridge](https://adventofcode.com/2022/day/9) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day9/day9.rs) [![Python](../../scripts/assets/python.png)](day9/day9.py) +[Day 10: Cathode-Ray Tube](https://adventofcode.com/2022/day/10) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day10/day10.rs) [![Python](../../scripts/assets/python.png)](day10/day10.py) +[Day 11: Monkey in the Middle](https://adventofcode.com/2022/day/11) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day11/day11.rs) [![Python](../../scripts/assets/python.png)](day11/day11.py) [![C++](../../scripts/assets/cpp.png)](day11/day11.cpp) +[Day 12: Hill Climbing Algorithm](https://adventofcode.com/2022/day/12) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day12/day12.rs) [![Python](../../scripts/assets/python.png)](day12/day12.py) +[Day 13: Distress Signal](https://adventofcode.com/2022/day/13) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day13/day13.rs) [![Rust](../../scripts/assets/rust.png)](day13_pest/day13_pest.rs) [![Python](../../scripts/assets/python.png)](day13/day13.py) +[Day 14: Regolith Reservoir](https://adventofcode.com/2022/day/14) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day14/day14.rs) [![Python](../../scripts/assets/python.png)](day14/day14.py) +[Day 15: Beacon Exclusion Zone](https://adventofcode.com/2022/day/15) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day15/day15.rs) [![Python](../../scripts/assets/python.png)](day15/day15.py) +[Day 16: Proboscidea Volcanium](https://adventofcode.com/2022/day/16) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day16/day16.rs) +[Day 17: Pyroclastic Flow](https://adventofcode.com/2022/day/17) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day17/day17.rs) [![Python](../../scripts/assets/python.png)](day17/day17.py) [🎁](day17/README.md) +[Day 18: Boiling Boulders](https://adventofcode.com/2022/day/18) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day18/day18.rs) +[Day 19: Not Enough Minerals](https://adventofcode.com/2022/day/19) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day19/day19.rs) +[Day 20: Grove Positioning System](https://adventofcode.com/2022/day/20) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day20/day20.rs) +[Day 21: Monkey Math](https://adventofcode.com/2022/day/21) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day21/day21.rs) [![Python](../../scripts/assets/python.png)](day21/day21.py) +[Day 22: Monkey Map](https://adventofcode.com/2022/day/22) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day22/day22.rs) +[Day 23: Unstable Diffusion](https://adventofcode.com/2022/day/23) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day23/day23.rs) +[Day 24: Blizzard Basin](https://adventofcode.com/2022/day/24) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day24/day24.rs) +[Day 25: Full of Hot Air](https://adventofcode.com/2022/day/25) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day25/day25.rs) [![Python](../../scripts/assets/python.png)](day25/day25.py) diff --git a/2022/day1/day1.py b/src/year2022/day1/day1.py similarity index 100% rename from 2022/day1/day1.py rename to src/year2022/day1/day1.py diff --git a/2022/day1/day1.rs b/src/year2022/day1/day1.rs similarity index 98% rename from 2022/day1/day1.rs rename to src/year2022/day1/day1.rs index 8cc2a11c..959cc4b8 100644 --- a/2022/day1/day1.rs +++ b/src/year2022/day1/day1.rs @@ -32,7 +32,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2022/day1/day1_oneliner.py b/src/year2022/day1/day1_oneliner.py similarity index 100% rename from 2022/day1/day1_oneliner.py rename to src/year2022/day1/day1_oneliner.py diff --git a/2022/day1/test.txt b/src/year2022/day1/test.txt similarity index 100% rename from 2022/day1/test.txt rename to src/year2022/day1/test.txt diff --git a/2022/day10/day10.py b/src/year2022/day10/day10.py similarity index 100% rename from 2022/day10/day10.py rename to src/year2022/day10/day10.py diff --git a/2022/day10/day10.rs b/src/year2022/day10/day10.rs similarity index 100% rename from 2022/day10/day10.rs rename to src/year2022/day10/day10.rs diff --git a/2022/day10/test.txt b/src/year2022/day10/test.txt similarity index 100% rename from 2022/day10/test.txt rename to src/year2022/day10/test.txt diff --git a/2022/day11/day11.cpp b/src/year2022/day11/day11.cpp similarity index 100% rename from 2022/day11/day11.cpp rename to src/year2022/day11/day11.cpp diff --git a/2022/day11/day11.py b/src/year2022/day11/day11.py similarity index 100% rename from 2022/day11/day11.py rename to src/year2022/day11/day11.py diff --git a/2022/day11/day11.rs b/src/year2022/day11/day11.rs similarity index 100% rename from 2022/day11/day11.rs rename to src/year2022/day11/day11.rs diff --git a/2022/day11/test.txt b/src/year2022/day11/test.txt similarity index 100% rename from 2022/day11/test.txt rename to src/year2022/day11/test.txt diff --git a/2022/day12/day12.py b/src/year2022/day12/day12.py similarity index 100% rename from 2022/day12/day12.py rename to src/year2022/day12/day12.py diff --git a/2022/day12/day12.rs b/src/year2022/day12/day12.rs similarity index 100% rename from 2022/day12/day12.rs rename to src/year2022/day12/day12.rs diff --git a/2022/day12/test.txt b/src/year2022/day12/test.txt similarity index 100% rename from 2022/day12/test.txt rename to src/year2022/day12/test.txt diff --git a/2022/day13_pest/day13.py b/src/year2022/day13/day13.py similarity index 100% rename from 2022/day13_pest/day13.py rename to src/year2022/day13/day13.py diff --git a/2022/day13/day13.rs b/src/year2022/day13/day13.rs similarity index 100% rename from 2022/day13/day13.rs rename to src/year2022/day13/day13.rs diff --git a/2022/day13/test.txt b/src/year2022/day13/test.txt similarity index 100% rename from 2022/day13/test.txt rename to src/year2022/day13/test.txt diff --git a/2022/day13_pest/day13.pest b/src/year2022/day13_pest/day13.pest similarity index 100% rename from 2022/day13_pest/day13.pest rename to src/year2022/day13_pest/day13.pest diff --git a/2022/day13_pest/day13.rs b/src/year2022/day13_pest/day13_pest.rs similarity index 98% rename from 2022/day13_pest/day13.rs rename to src/year2022/day13_pest/day13_pest.rs index 24226e75..f61d6e0a 100644 --- a/2022/day13_pest/day13.rs +++ b/src/year2022/day13_pest/day13_pest.rs @@ -6,7 +6,7 @@ use pest_derive::Parser; use std::cmp::Ordering; #[derive(Parser)] -#[grammar = "day13.pest"] +#[grammar = "./src/year2022/day13_pest/day13.pest"] struct PacketParser; fn cmp(a: &str, b: &str) -> Ordering { diff --git a/2022/day13_pest/test.txt b/src/year2022/day13_pest/test.txt similarity index 100% rename from 2022/day13_pest/test.txt rename to src/year2022/day13_pest/test.txt diff --git a/2022/day14/day14.py b/src/year2022/day14/day14.py similarity index 100% rename from 2022/day14/day14.py rename to src/year2022/day14/day14.py diff --git a/2022/day14/day14.rs b/src/year2022/day14/day14.rs similarity index 100% rename from 2022/day14/day14.rs rename to src/year2022/day14/day14.rs diff --git a/2022/day14/test.txt b/src/year2022/day14/test.txt similarity index 100% rename from 2022/day14/test.txt rename to src/year2022/day14/test.txt diff --git a/2022/day15/day15.py b/src/year2022/day15/day15.py similarity index 95% rename from 2022/day15/day15.py rename to src/year2022/day15/day15.py index ff3d8303..dfa169bb 100755 --- a/2022/day15/day15.py +++ b/src/year2022/day15/day15.py @@ -96,12 +96,12 @@ def __init__(self, start, end): else: pass - assert union[0].start <= 0 - assert union[-1].end >= max_y + # assert union[0].start <= 0 + # assert union[-1].end >= max_y if len(union) > 1: - assert len(union) == 2 - assert union[0].end + 1 == union[1].start + # assert len(union) == 2 + # assert union[0].end + 1 == union[1].start x = union[0].end part2 = x * 4_000_000 + y break diff --git a/2022/day15/day15.rs b/src/year2022/day15/day15.rs similarity index 100% rename from 2022/day15/day15.rs rename to src/year2022/day15/day15.rs diff --git a/2022/day15/test.txt b/src/year2022/day15/test.txt similarity index 100% rename from 2022/day15/test.txt rename to src/year2022/day15/test.txt diff --git a/2022/day16/day16.rs b/src/year2022/day16/day16.rs similarity index 100% rename from 2022/day16/day16.rs rename to src/year2022/day16/day16.rs diff --git a/2022/day16/test.txt b/src/year2022/day16/test.txt similarity index 100% rename from 2022/day16/test.txt rename to src/year2022/day16/test.txt diff --git a/2022/day17/README.md b/src/year2022/day17/README.md similarity index 100% rename from 2022/day17/README.md rename to src/year2022/day17/README.md diff --git a/2022/day17/day17.py b/src/year2022/day17/day17.py similarity index 100% rename from 2022/day17/day17.py rename to src/year2022/day17/day17.py diff --git a/2022/day17/day17.rs b/src/year2022/day17/day17.rs similarity index 99% rename from 2022/day17/day17.rs rename to src/year2022/day17/day17.rs index b7281177..bfd098c8 100644 --- a/2022/day17/day17.rs +++ b/src/year2022/day17/day17.rs @@ -122,7 +122,6 @@ impl Cave { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let jets: Vec = data.trim().bytes().collect(); diff --git a/2022/day17/test.txt b/src/year2022/day17/test.txt similarity index 100% rename from 2022/day17/test.txt rename to src/year2022/day17/test.txt diff --git a/2022/day17/tetris.gif b/src/year2022/day17/tetris.gif similarity index 100% rename from 2022/day17/tetris.gif rename to src/year2022/day17/tetris.gif diff --git a/2022/day17/tetris.py b/src/year2022/day17/tetris.py similarity index 100% rename from 2022/day17/tetris.py rename to src/year2022/day17/tetris.py diff --git a/2022/day18/day18.rs b/src/year2022/day18/day18.rs similarity index 100% rename from 2022/day18/day18.rs rename to src/year2022/day18/day18.rs diff --git a/2022/day18/test.txt b/src/year2022/day18/test.txt similarity index 100% rename from 2022/day18/test.txt rename to src/year2022/day18/test.txt diff --git a/2022/day19/day19.rs b/src/year2022/day19/day19.rs similarity index 100% rename from 2022/day19/day19.rs rename to src/year2022/day19/day19.rs diff --git a/2022/day19/test.txt b/src/year2022/day19/test.txt similarity index 100% rename from 2022/day19/test.txt rename to src/year2022/day19/test.txt diff --git a/2022/day2/day2.py b/src/year2022/day2/day2.py similarity index 100% rename from 2022/day2/day2.py rename to src/year2022/day2/day2.py diff --git a/2022/day2/day2.rs b/src/year2022/day2/day2.rs similarity index 99% rename from 2022/day2/day2.rs rename to src/year2022/day2/day2.rs index c1feaa40..46cab94a 100644 --- a/2022/day2/day2.rs +++ b/src/year2022/day2/day2.rs @@ -85,7 +85,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2022/day2/test.txt b/src/year2022/day2/test.txt similarity index 100% rename from 2022/day2/test.txt rename to src/year2022/day2/test.txt diff --git a/2022/day20/day20.rs b/src/year2022/day20/day20.rs similarity index 100% rename from 2022/day20/day20.rs rename to src/year2022/day20/day20.rs diff --git a/2022/day20/test.txt b/src/year2022/day20/test.txt similarity index 100% rename from 2022/day20/test.txt rename to src/year2022/day20/test.txt diff --git a/2022/day21/day21.py b/src/year2022/day21/day21.py similarity index 100% rename from 2022/day21/day21.py rename to src/year2022/day21/day21.py diff --git a/2022/day21/day21.rs b/src/year2022/day21/day21.rs similarity index 96% rename from 2022/day21/day21.rs rename to src/year2022/day21/day21.rs index 2f5f905d..34b92b10 100644 --- a/2022/day21/day21.rs +++ b/src/year2022/day21/day21.rs @@ -1,6 +1,5 @@ //! [Day 21: Monkey Math](https://adventofcode.com/2022/day/21) -#![allow(clippy::option_if_let_else)] use num::Rational64; use rustc_hash::FxHashMap; @@ -51,8 +50,11 @@ impl Puzzle { } fn eval(&self, var: &str) -> i64 { - if let Some(m) = self.monkeys.get(var) { - match m { + self.monkeys.get(var).map_or_else( + || { + panic!("???"); + }, + |m| match m { Job::Number(n) => *n, Job::Operation((l, o, r)) => { let l = self.eval(l); @@ -66,10 +68,8 @@ impl Puzzle { _ => panic!("unknown operation"), } } - } - } else { - panic!("???"); - } + }, + ) } fn eval_sym(&self, var: &str) -> Affine { diff --git a/2022/day21/test.txt b/src/year2022/day21/test.txt similarity index 100% rename from 2022/day21/test.txt rename to src/year2022/day21/test.txt diff --git a/2022/day22/day22.rs b/src/year2022/day22/day22.rs similarity index 100% rename from 2022/day22/day22.rs rename to src/year2022/day22/day22.rs diff --git a/2022/day22/test.txt b/src/year2022/day22/test.txt similarity index 100% rename from 2022/day22/test.txt rename to src/year2022/day22/test.txt diff --git a/2022/day23/day23.rs b/src/year2022/day23/day23.rs similarity index 100% rename from 2022/day23/day23.rs rename to src/year2022/day23/day23.rs diff --git a/2022/day23/test.txt b/src/year2022/day23/test.txt similarity index 100% rename from 2022/day23/test.txt rename to src/year2022/day23/test.txt diff --git a/2022/day24/day24.rs b/src/year2022/day24/day24.rs similarity index 100% rename from 2022/day24/day24.rs rename to src/year2022/day24/day24.rs diff --git a/2022/day24/demo.txt b/src/year2022/day24/demo.txt similarity index 100% rename from 2022/day24/demo.txt rename to src/year2022/day24/demo.txt diff --git a/2022/day24/test.txt b/src/year2022/day24/test.txt similarity index 100% rename from 2022/day24/test.txt rename to src/year2022/day24/test.txt diff --git a/2022/day25/day25.py b/src/year2022/day25/day25.py similarity index 100% rename from 2022/day25/day25.py rename to src/year2022/day25/day25.py diff --git a/2022/day25/day25.rs b/src/year2022/day25/day25.rs similarity index 100% rename from 2022/day25/day25.rs rename to src/year2022/day25/day25.rs diff --git a/2022/day25/test.txt b/src/year2022/day25/test.txt similarity index 100% rename from 2022/day25/test.txt rename to src/year2022/day25/test.txt diff --git a/2022/day3/day3.c b/src/year2022/day3/day3.c similarity index 100% rename from 2022/day3/day3.c rename to src/year2022/day3/day3.c diff --git a/2022/day3/day3.py b/src/year2022/day3/day3.py similarity index 100% rename from 2022/day3/day3.py rename to src/year2022/day3/day3.py diff --git a/2022/day3/day3.rs b/src/year2022/day3/day3.rs similarity index 98% rename from 2022/day3/day3.rs rename to src/year2022/day3/day3.rs index fe9a20b8..c6615789 100644 --- a/2022/day3/day3.rs +++ b/src/year2022/day3/day3.rs @@ -56,7 +56,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2022/day3/test.txt b/src/year2022/day3/test.txt similarity index 100% rename from 2022/day3/test.txt rename to src/year2022/day3/test.txt diff --git a/2022/day4/day4.py b/src/year2022/day4/day4.py similarity index 100% rename from 2022/day4/day4.py rename to src/year2022/day4/day4.py diff --git a/2022/day4/day4.rs b/src/year2022/day4/day4.rs similarity index 97% rename from 2022/day4/day4.rs rename to src/year2022/day4/day4.rs index af22caa0..3a1c5373 100644 --- a/2022/day4/day4.rs +++ b/src/year2022/day4/day4.rs @@ -4,7 +4,6 @@ use regex::Regex; use std::cmp::{max, min}; /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let re = Regex::new(r"^(\d+)-(\d+),(\d+)-(\d+)").unwrap(); diff --git a/2022/day4/test.txt b/src/year2022/day4/test.txt similarity index 100% rename from 2022/day4/test.txt rename to src/year2022/day4/test.txt diff --git a/2022/day5/day5.py b/src/year2022/day5/day5.py similarity index 100% rename from 2022/day5/day5.py rename to src/year2022/day5/day5.py diff --git a/2022/day5/day5.rs b/src/year2022/day5/day5.rs similarity index 99% rename from 2022/day5/day5.rs rename to src/year2022/day5/day5.rs index cbccacd7..d73d01ec 100644 --- a/2022/day5/day5.rs +++ b/src/year2022/day5/day5.rs @@ -97,7 +97,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, String) { let puzzle = Puzzle::new(data); diff --git a/2022/day5/test.txt b/src/year2022/day5/test.txt similarity index 100% rename from 2022/day5/test.txt rename to src/year2022/day5/test.txt diff --git a/2022/day6/day6.py b/src/year2022/day6/day6.py similarity index 100% rename from 2022/day6/day6.py rename to src/year2022/day6/day6.py diff --git a/2022/day6/day6.rs b/src/year2022/day6/day6.rs similarity index 100% rename from 2022/day6/day6.rs rename to src/year2022/day6/day6.rs diff --git a/2022/day6/test.txt b/src/year2022/day6/test.txt similarity index 100% rename from 2022/day6/test.txt rename to src/year2022/day6/test.txt diff --git a/2022/day7/day7.py b/src/year2022/day7/day7.py similarity index 100% rename from 2022/day7/day7.py rename to src/year2022/day7/day7.py diff --git a/2022/day7/day7.rs b/src/year2022/day7/day7.rs similarity index 94% rename from 2022/day7/day7.rs rename to src/year2022/day7/day7.rs index d3cee31b..ff83991e 100644 --- a/2022/day7/day7.rs +++ b/src/year2022/day7/day7.rs @@ -1,12 +1,9 @@ //! [Day 7: No Space Left On Device](https://adventofcode.com/2022/day/7) -#![allow(clippy::if_same_then_else)] - use rustc_hash::FxHashMap; use std::path::PathBuf; struct Puzzle { - // Puzzle input total_dir_size: FxHashMap, } @@ -32,9 +29,7 @@ impl Puzzle { let key = current_path.as_path().to_str().unwrap().to_string(); dir_size.entry(key).or_insert(0); - } else if line == "$ ls" { - // nothing to do - } else if line.starts_with("dir ") { + } else if line == "$ ls" || line.starts_with("dir ") { // nothing to do } else if !line.is_empty() { // diff --git a/2022/day7/test.txt b/src/year2022/day7/test.txt similarity index 100% rename from 2022/day7/test.txt rename to src/year2022/day7/test.txt diff --git a/2022/day8/day8.py b/src/year2022/day8/day8.py similarity index 100% rename from 2022/day8/day8.py rename to src/year2022/day8/day8.py diff --git a/2022/day8/day8.rs b/src/year2022/day8/day8.rs similarity index 100% rename from 2022/day8/day8.rs rename to src/year2022/day8/day8.rs diff --git a/2022/day8/test.txt b/src/year2022/day8/test.txt similarity index 100% rename from 2022/day8/test.txt rename to src/year2022/day8/test.txt diff --git a/2022/day9/day9.py b/src/year2022/day9/day9.py similarity index 100% rename from 2022/day9/day9.py rename to src/year2022/day9/day9.py diff --git a/2022/day9/day9.rs b/src/year2022/day9/day9.rs similarity index 100% rename from 2022/day9/day9.rs rename to src/year2022/day9/day9.rs diff --git a/2022/day9/test.txt b/src/year2022/day9/test.txt similarity index 100% rename from 2022/day9/test.txt rename to src/year2022/day9/test.txt diff --git a/2022/day9/test02.txt b/src/year2022/day9/test02.txt similarity index 100% rename from 2022/day9/test02.txt rename to src/year2022/day9/test02.txt diff --git a/2022/ocr/ocr.py b/src/year2022/ocr/ocr.py similarity index 100% rename from 2022/ocr/ocr.py rename to src/year2022/ocr/ocr.py diff --git a/src/year2023/README.md b/src/year2023/README.md new file mode 100644 index 00000000..9592796b --- /dev/null +++ b/src/year2023/README.md @@ -0,0 +1,36 @@ +# Advent of Code in Rust 🦀 + +![AoC2023](https://img.shields.io/badge/Advent_of_Code-2023-8A2BE2) +![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) +![Rust: 25](https://img.shields.io/badge/Rust-25-cyan?logo=Rust) +![Python: 11](https://img.shields.io/badge/Python-11-cyan?logo=Python) + +## 2023 ([Calendar](https://adventofcode.com/2023)) ([Solutions](./)) : 50⭐ + +Puzzle | Stars | Languages +----------------------------------------------------------------------------- | ----- | ----------- +[Day 1: Trebuchet?!](https://adventofcode.com/2023/day/1) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day1/day1.rs) [![Python](../../scripts/assets/python.png)](day1/day1.py) +[Day 2: Cube Conundrum](https://adventofcode.com/2023/day/2) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day2/day2.rs) [![Python](../../scripts/assets/python.png)](day2/day2.py) +[Day 3: Gear Ratios](https://adventofcode.com/2023/day/3) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day3/day3.rs) [![Python](../../scripts/assets/python.png)](day3/day3.py) +[Day 4: Scratchcards](https://adventofcode.com/2023/day/4) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day4/day4.rs) [![Python](../../scripts/assets/python.png)](day4/day4.py) +[Day 5: If You Give A Seed A Fertilizer](https://adventofcode.com/2023/day/5) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day5/day5.rs) [![Python](../../scripts/assets/python.png)](day5/day5_bruteforce.py) +[Day 6: Wait For It](https://adventofcode.com/2023/day/6) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day6/day6.rs) [![Python](../../scripts/assets/python.png)](day6/day6.py) +[Day 7: Camel Cards](https://adventofcode.com/2023/day/7) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day7/day7.rs) +[Day 8: Haunted Wasteland](https://adventofcode.com/2023/day/8) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day8/day8.rs) +[Day 9: Mirage Maintenance](https://adventofcode.com/2023/day/9) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day9/day9.rs) [![Python](../../scripts/assets/python.png)](day9/day9.py) +[Day 10: Pipe Maze](https://adventofcode.com/2023/day/10) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day10/day10.rs) [![Python](../../scripts/assets/python.png)](day10/day10.py) [🎁](day10/README.md) +[Day 11: Cosmic Expansion](https://adventofcode.com/2023/day/11) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day11/day11.rs) +[Day 12: Hot Springs](https://adventofcode.com/2023/day/12) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day12/day12.rs) +[Day 13: Point of Incidence](https://adventofcode.com/2023/day/13) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day13/day13.rs) +[Day 14: Parabolic Reflector Dish](https://adventofcode.com/2023/day/14) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day14/day14.rs) +[Day 15: Lens Library](https://adventofcode.com/2023/day/15) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day15/day15.rs) +[Day 16: The Floor Will Be Lava](https://adventofcode.com/2023/day/16) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day16/day16.rs) [![Python](../../scripts/assets/python.png)](day16/day16.py) +[Day 17: Clumsy Crucible](https://adventofcode.com/2023/day/17) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day17/day17.rs) +[Day 18: Lavaduct Lagoon](https://adventofcode.com/2023/day/18) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day18/day18.rs) +[Day 19: Aplenty](https://adventofcode.com/2023/day/19) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day19/day19.rs) +[Day 20: Pulse Propagation](https://adventofcode.com/2023/day/20) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day20/day20.rs) +[Day 21: Step Counter](https://adventofcode.com/2023/day/21) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day21/day21.rs) +[Day 22: Sand Slabs](https://adventofcode.com/2023/day/22) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day22/day22.rs) +[Day 23: A Long Walk](https://adventofcode.com/2023/day/23) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day23/day23.rs) +[Day 24: Never Tell Me The Odds](https://adventofcode.com/2023/day/24) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day24/day24.rs) [![Python](../../scripts/assets/python.png)](day24/day24.py) +[Day 25: Snowverload](https://adventofcode.com/2023/day/25) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day25/day25.rs) [![Python](../../scripts/assets/python.png)](day25/day25.py) diff --git a/2023/day1/day1.py b/src/year2023/day1/day1.py similarity index 100% rename from 2023/day1/day1.py rename to src/year2023/day1/day1.py diff --git a/2023/day1/day1.rs b/src/year2023/day1/day1.rs similarity index 99% rename from 2023/day1/day1.rs rename to src/year2023/day1/day1.rs index b8c66a7b..75b86dfb 100644 --- a/2023/day1/day1.rs +++ b/src/year2023/day1/day1.rs @@ -75,7 +75,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2023/day1/sample_1.txt b/src/year2023/day1/sample_1.txt similarity index 100% rename from 2023/day1/sample_1.txt rename to src/year2023/day1/sample_1.txt diff --git a/2023/day1/sample_2.txt b/src/year2023/day1/sample_2.txt similarity index 100% rename from 2023/day1/sample_2.txt rename to src/year2023/day1/sample_2.txt diff --git a/2023/day10/README.md b/src/year2023/day10/README.md similarity index 100% rename from 2023/day10/README.md rename to src/year2023/day10/README.md diff --git a/2023/day10/day10.py b/src/year2023/day10/day10.py similarity index 100% rename from 2023/day10/day10.py rename to src/year2023/day10/day10.py diff --git a/2023/day10/day10.rs b/src/year2023/day10/day10.rs similarity index 99% rename from 2023/day10/day10.rs rename to src/year2023/day10/day10.rs index 4a23d91e..cc1c8c17 100644 --- a/2023/day10/day10.rs +++ b/src/year2023/day10/day10.rs @@ -128,7 +128,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, u32) { let puzzle = Puzzle::new(data); diff --git a/2023/day10/pipemaze.sh b/src/year2023/day10/pipemaze.sh similarity index 100% rename from 2023/day10/pipemaze.sh rename to src/year2023/day10/pipemaze.sh diff --git a/2023/day10/test1.png b/src/year2023/day10/test1.png similarity index 100% rename from 2023/day10/test1.png rename to src/year2023/day10/test1.png diff --git a/2023/day10/test1.txt b/src/year2023/day10/test1.txt similarity index 100% rename from 2023/day10/test1.txt rename to src/year2023/day10/test1.txt diff --git a/2023/day10/test2.png b/src/year2023/day10/test2.png similarity index 100% rename from 2023/day10/test2.png rename to src/year2023/day10/test2.png diff --git a/2023/day10/test2.txt b/src/year2023/day10/test2.txt similarity index 100% rename from 2023/day10/test2.txt rename to src/year2023/day10/test2.txt diff --git a/2023/day10/test3.png b/src/year2023/day10/test3.png similarity index 100% rename from 2023/day10/test3.png rename to src/year2023/day10/test3.png diff --git a/2023/day10/test3.txt b/src/year2023/day10/test3.txt similarity index 100% rename from 2023/day10/test3.txt rename to src/year2023/day10/test3.txt diff --git a/2023/day10/test4.png b/src/year2023/day10/test4.png similarity index 100% rename from 2023/day10/test4.png rename to src/year2023/day10/test4.png diff --git a/2023/day10/test4.txt b/src/year2023/day10/test4.txt similarity index 100% rename from 2023/day10/test4.txt rename to src/year2023/day10/test4.txt diff --git a/2023/day10/test5.png b/src/year2023/day10/test5.png similarity index 100% rename from 2023/day10/test5.png rename to src/year2023/day10/test5.png diff --git a/2023/day10/test5.txt b/src/year2023/day10/test5.txt similarity index 100% rename from 2023/day10/test5.txt rename to src/year2023/day10/test5.txt diff --git a/2023/day10/test6.png b/src/year2023/day10/test6.png similarity index 100% rename from 2023/day10/test6.png rename to src/year2023/day10/test6.png diff --git a/2023/day10/test6.txt b/src/year2023/day10/test6.txt similarity index 100% rename from 2023/day10/test6.txt rename to src/year2023/day10/test6.txt diff --git a/2023/day11/day11.rs b/src/year2023/day11/day11.rs similarity index 99% rename from 2023/day11/day11.rs rename to src/year2023/day11/day11.rs index b60c7465..d92a6af2 100644 --- a/2023/day11/day11.rs +++ b/src/year2023/day11/day11.rs @@ -82,7 +82,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2023/day11/test.txt b/src/year2023/day11/test.txt similarity index 100% rename from 2023/day11/test.txt rename to src/year2023/day11/test.txt diff --git a/2023/day12/day12.rs b/src/year2023/day12/day12.rs similarity index 99% rename from 2023/day12/day12.rs rename to src/year2023/day12/day12.rs index 3ea00b40..19f2d771 100644 --- a/2023/day12/day12.rs +++ b/src/year2023/day12/day12.rs @@ -111,7 +111,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2023/day12/test.txt b/src/year2023/day12/test.txt similarity index 100% rename from 2023/day12/test.txt rename to src/year2023/day12/test.txt diff --git a/2023/day13/day13.rs b/src/year2023/day13/day13.rs similarity index 99% rename from 2023/day13/day13.rs rename to src/year2023/day13/day13.rs index b2c10bc1..fc7dd69c 100644 --- a/2023/day13/day13.rs +++ b/src/year2023/day13/day13.rs @@ -107,7 +107,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2023/day13/test.txt b/src/year2023/day13/test.txt similarity index 100% rename from 2023/day13/test.txt rename to src/year2023/day13/test.txt diff --git a/2023/day14/day14.rs b/src/year2023/day14/day14.rs similarity index 99% rename from 2023/day14/day14.rs rename to src/year2023/day14/day14.rs index b37da8d2..36cd09f7 100644 --- a/2023/day14/day14.rs +++ b/src/year2023/day14/day14.rs @@ -257,7 +257,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2023/day14/test.txt b/src/year2023/day14/test.txt similarity index 100% rename from 2023/day14/test.txt rename to src/year2023/day14/test.txt diff --git a/2023/day15/day15.rs b/src/year2023/day15/day15.rs similarity index 98% rename from 2023/day15/day15.rs rename to src/year2023/day15/day15.rs index 643964f6..be2f560c 100644 --- a/2023/day15/day15.rs +++ b/src/year2023/day15/day15.rs @@ -65,7 +65,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2023/day15/test.txt b/src/year2023/day15/test.txt similarity index 100% rename from 2023/day15/test.txt rename to src/year2023/day15/test.txt diff --git a/2023/day16/day16.py b/src/year2023/day16/day16.py similarity index 100% rename from 2023/day16/day16.py rename to src/year2023/day16/day16.py diff --git a/2023/day16/day16.rs b/src/year2023/day16/day16.rs similarity index 99% rename from 2023/day16/day16.rs rename to src/year2023/day16/day16.rs index 93baefec..fdd52b60 100644 --- a/2023/day16/day16.rs +++ b/src/year2023/day16/day16.rs @@ -146,7 +146,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let mut puzzle = Puzzle::new(data); diff --git a/2023/day16/test.txt b/src/year2023/day16/test.txt similarity index 100% rename from 2023/day16/test.txt rename to src/year2023/day16/test.txt diff --git a/2023/day17/day17.rs b/src/year2023/day17/day17.rs similarity index 99% rename from 2023/day17/day17.rs rename to src/year2023/day17/day17.rs index 72bcd568..297f6133 100644 --- a/2023/day17/day17.rs +++ b/src/year2023/day17/day17.rs @@ -182,7 +182,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2023/day17/test.txt b/src/year2023/day17/test.txt similarity index 100% rename from 2023/day17/test.txt rename to src/year2023/day17/test.txt diff --git a/2023/day17/test2.txt b/src/year2023/day17/test2.txt similarity index 100% rename from 2023/day17/test2.txt rename to src/year2023/day17/test2.txt diff --git a/2023/day18/day18.rs b/src/year2023/day18/day18.rs similarity index 99% rename from 2023/day18/day18.rs rename to src/year2023/day18/day18.rs index 558a5965..ee4e8581 100644 --- a/2023/day18/day18.rs +++ b/src/year2023/day18/day18.rs @@ -86,7 +86,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let puzzle = Puzzle::new(data); diff --git a/2023/day18/test.txt b/src/year2023/day18/test.txt similarity index 100% rename from 2023/day18/test.txt rename to src/year2023/day18/test.txt diff --git a/2023/day19/day19.rs b/src/year2023/day19/day19.rs similarity index 99% rename from 2023/day19/day19.rs rename to src/year2023/day19/day19.rs index a288efd5..09ba5e47 100644 --- a/2023/day19/day19.rs +++ b/src/year2023/day19/day19.rs @@ -303,7 +303,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2023/day19/test.txt b/src/year2023/day19/test.txt similarity index 100% rename from 2023/day19/test.txt rename to src/year2023/day19/test.txt diff --git a/2023/day2/day2.py b/src/year2023/day2/day2.py similarity index 100% rename from 2023/day2/day2.py rename to src/year2023/day2/day2.py diff --git a/2023/day2/day2.rs b/src/year2023/day2/day2.rs similarity index 99% rename from 2023/day2/day2.rs rename to src/year2023/day2/day2.rs index e762edea..ca393759 100644 --- a/2023/day2/day2.rs +++ b/src/year2023/day2/day2.rs @@ -99,7 +99,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2023/day2/test.txt b/src/year2023/day2/test.txt similarity index 100% rename from 2023/day2/test.txt rename to src/year2023/day2/test.txt diff --git a/2023/day20/day20.rs b/src/year2023/day20/day20.rs similarity index 99% rename from 2023/day20/day20.rs rename to src/year2023/day20/day20.rs index 6aa56e6f..72fe1677 100644 --- a/2023/day20/day20.rs +++ b/src/year2023/day20/day20.rs @@ -253,7 +253,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u64) { let mut puzzle = Puzzle::new(data); diff --git a/2023/day20/test.txt b/src/year2023/day20/test.txt similarity index 100% rename from 2023/day20/test.txt rename to src/year2023/day20/test.txt diff --git a/2023/day20/test2.txt b/src/year2023/day20/test2.txt similarity index 100% rename from 2023/day20/test2.txt rename to src/year2023/day20/test2.txt diff --git a/2023/day21/day21.rs b/src/year2023/day21/day21.rs similarity index 99% rename from 2023/day21/day21.rs rename to src/year2023/day21/day21.rs index ca3f65ba..c7640618 100644 --- a/2023/day21/day21.rs +++ b/src/year2023/day21/day21.rs @@ -92,7 +92,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2023/day21/test.txt b/src/year2023/day21/test.txt similarity index 100% rename from 2023/day21/test.txt rename to src/year2023/day21/test.txt diff --git a/2023/day22/day22.rs b/src/year2023/day22/day22.rs similarity index 99% rename from 2023/day22/day22.rs rename to src/year2023/day22/day22.rs index edc6313b..c03a414e 100644 --- a/2023/day22/day22.rs +++ b/src/year2023/day22/day22.rs @@ -148,7 +148,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2023/day22/test.txt b/src/year2023/day22/test.txt similarity index 100% rename from 2023/day22/test.txt rename to src/year2023/day22/test.txt diff --git a/2023/day23/day23.rs b/src/year2023/day23/day23.rs similarity index 99% rename from 2023/day23/day23.rs rename to src/year2023/day23/day23.rs index 9d8746e3..4039df8f 100644 --- a/2023/day23/day23.rs +++ b/src/year2023/day23/day23.rs @@ -136,7 +136,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, i32) { let puzzle = Puzzle::new(data); diff --git a/2023/day23/naive_part2.c b/src/year2023/day23/naive_part2.c similarity index 100% rename from 2023/day23/naive_part2.c rename to src/year2023/day23/naive_part2.c diff --git a/2023/day23/test.txt b/src/year2023/day23/test.txt similarity index 100% rename from 2023/day23/test.txt rename to src/year2023/day23/test.txt diff --git a/2023/day24/build.rs b/src/year2023/day24/build.rs similarity index 100% rename from 2023/day24/build.rs rename to src/year2023/day24/build.rs diff --git a/2023/day24/day24.py b/src/year2023/day24/day24.py similarity index 100% rename from 2023/day24/day24.py rename to src/year2023/day24/day24.py diff --git a/2023/day24/day24.rs b/src/year2023/day24/day24.rs similarity index 99% rename from 2023/day24/day24.rs rename to src/year2023/day24/day24.rs index c531b0d4..58cb240e 100644 --- a/2023/day24/day24.rs +++ b/src/year2023/day24/day24.rs @@ -160,7 +160,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, i64) { let puzzle = Puzzle::new(data); diff --git a/2023/day24/test.txt b/src/year2023/day24/test.txt similarity index 100% rename from 2023/day24/test.txt rename to src/year2023/day24/test.txt diff --git a/2023/day25/day25.py b/src/year2023/day25/day25.py similarity index 100% rename from 2023/day25/day25.py rename to src/year2023/day25/day25.py diff --git a/2023/day25/day25.rs b/src/year2023/day25/day25.rs similarity index 98% rename from 2023/day25/day25.rs rename to src/year2023/day25/day25.rs index 04f3e256..54a126c7 100644 --- a/2023/day25/day25.rs +++ b/src/year2023/day25/day25.rs @@ -46,7 +46,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, aoc::Christmas) { let puzzle = Puzzle::new(data); diff --git a/2023/day25/test.txt b/src/year2023/day25/test.txt similarity index 100% rename from 2023/day25/test.txt rename to src/year2023/day25/test.txt diff --git a/2023/day3/day3.py b/src/year2023/day3/day3.py similarity index 100% rename from 2023/day3/day3.py rename to src/year2023/day3/day3.py diff --git a/2023/day3/day3.rs b/src/year2023/day3/day3.rs similarity index 99% rename from 2023/day3/day3.rs rename to src/year2023/day3/day3.rs index 24069359..7b39700a 100644 --- a/2023/day3/day3.rs +++ b/src/year2023/day3/day3.rs @@ -105,7 +105,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let mut puzzle = Puzzle::new(data); diff --git a/2023/day3/test.txt b/src/year2023/day3/test.txt similarity index 100% rename from 2023/day3/test.txt rename to src/year2023/day3/test.txt diff --git a/2023/day4/day4.py b/src/year2023/day4/day4.py similarity index 100% rename from 2023/day4/day4.py rename to src/year2023/day4/day4.py diff --git a/2023/day4/day4.rs b/src/year2023/day4/day4.rs similarity index 98% rename from 2023/day4/day4.rs rename to src/year2023/day4/day4.rs index b1949e2e..c42b4286 100644 --- a/2023/day4/day4.rs +++ b/src/year2023/day4/day4.rs @@ -61,7 +61,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2023/day4/test.txt b/src/year2023/day4/test.txt similarity index 100% rename from 2023/day4/test.txt rename to src/year2023/day4/test.txt diff --git a/2023/day5/day5.rs b/src/year2023/day5/day5.rs similarity index 99% rename from 2023/day5/day5.rs rename to src/year2023/day5/day5.rs index 63a3632f..98019e4a 100644 --- a/2023/day5/day5.rs +++ b/src/year2023/day5/day5.rs @@ -166,7 +166,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2023/day5/day5_bruteforce.py b/src/year2023/day5/day5_bruteforce.py similarity index 100% rename from 2023/day5/day5_bruteforce.py rename to src/year2023/day5/day5_bruteforce.py diff --git a/2023/day5/test.txt b/src/year2023/day5/test.txt similarity index 100% rename from 2023/day5/test.txt rename to src/year2023/day5/test.txt diff --git a/2023/day6/day6.py b/src/year2023/day6/day6.py similarity index 100% rename from 2023/day6/day6.py rename to src/year2023/day6/day6.py diff --git a/2023/day6/day6.rs b/src/year2023/day6/day6.rs similarity index 98% rename from 2023/day6/day6.rs rename to src/year2023/day6/day6.rs index 687866d8..ee6016d3 100644 --- a/2023/day6/day6.rs +++ b/src/year2023/day6/day6.rs @@ -67,7 +67,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2023/day6/test.txt b/src/year2023/day6/test.txt similarity index 100% rename from 2023/day6/test.txt rename to src/year2023/day6/test.txt diff --git a/2023/day7/day7.rs b/src/year2023/day7/day7.rs similarity index 99% rename from 2023/day7/day7.rs rename to src/year2023/day7/day7.rs index a8cb43f0..3f9e7ebb 100644 --- a/2023/day7/day7.rs +++ b/src/year2023/day7/day7.rs @@ -104,7 +104,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2023/day7/test.txt b/src/year2023/day7/test.txt similarity index 100% rename from 2023/day7/test.txt rename to src/year2023/day7/test.txt diff --git a/2023/day8/day8.rs b/src/year2023/day8/day8.rs similarity index 99% rename from 2023/day8/day8.rs rename to src/year2023/day8/day8.rs index 9cf3b506..40cda206 100644 --- a/2023/day8/day8.rs +++ b/src/year2023/day8/day8.rs @@ -101,7 +101,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2023/day8/test1.txt b/src/year2023/day8/test1.txt similarity index 100% rename from 2023/day8/test1.txt rename to src/year2023/day8/test1.txt diff --git a/2023/day8/test2.txt b/src/year2023/day8/test2.txt similarity index 100% rename from 2023/day8/test2.txt rename to src/year2023/day8/test2.txt diff --git a/2023/day9/day9.py b/src/year2023/day9/day9.py similarity index 100% rename from 2023/day9/day9.py rename to src/year2023/day9/day9.py diff --git a/2023/day9/day9.rs b/src/year2023/day9/day9.rs similarity index 98% rename from 2023/day9/day9.rs rename to src/year2023/day9/day9.rs index d5af9560..a44fc68f 100644 --- a/2023/day9/day9.rs +++ b/src/year2023/day9/day9.rs @@ -72,7 +72,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let puzzle = Puzzle::new(data); diff --git a/2023/day9/test.txt b/src/year2023/day9/test.txt similarity index 100% rename from 2023/day9/test.txt rename to src/year2023/day9/test.txt diff --git a/src/year2024/README.md b/src/year2024/README.md new file mode 100644 index 00000000..c71043fd --- /dev/null +++ b/src/year2024/README.md @@ -0,0 +1,36 @@ +# Advent of Code in Rust 🦀 + +![AoC2024](https://img.shields.io/badge/Advent_of_Code-2024-8A2BE2) +![Stars: 50](https://img.shields.io/badge/Stars-50⭐-blue) +![Rust: 26](https://img.shields.io/badge/Rust-26-cyan?logo=Rust) +![Python: 10](https://img.shields.io/badge/Python-10-cyan?logo=Python) + +## 2024 ([Calendar](https://adventofcode.com/2024)) ([Solutions](./)) : 50⭐ + +Puzzle | Stars | Languages +---------------------------------------------------------------------- | ----- | ----------- +[Day 1: Historian Hysteria](https://adventofcode.com/2024/day/1) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day1/day1.rs) [![Python](../../scripts/assets/python.png)](day1/day1.py) [![C](../../scripts/assets/c.png)](day1/day1.c) [![C++](../../scripts/assets/cpp.png)](day1/day1.cpp) [![Go](../../scripts/assets/go.png)](day1/day1.go) [![Ruby](../../scripts/assets/ruby.png)](day1/day1.rb) [![Perl](../../scripts/assets/perl.png)](day1/day1.pl) [![Lua](../../scripts/assets/lua.png)](day1/day1.lua) [![JS](../../scripts/assets/javascript.png)](day1/day1.js) [![Bash](../../scripts/assets/bash.png)](day1/day1.sh) [![Swift](../../scripts/assets/swift.png)](day1/day1.swift) [![Java](../../scripts/assets/java.png)](day1/day1.java) [![C#](../../scripts/assets/csharp.png)](day1/day1.cs) [![SQLite](../../scripts/assets/sqlite.png)](day1/day1.sql) +[Day 2: Red-Nosed Reports](https://adventofcode.com/2024/day/2) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day2/day2.rs) [![Python](../../scripts/assets/python.png)](day2/day2.py) [![Go](../../scripts/assets/go.png)](day2/day2.go) +[Day 3: Mull It Over](https://adventofcode.com/2024/day/3) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day3/day3.rs) [![Python](../../scripts/assets/python.png)](day3/day3.py) [![Go](../../scripts/assets/go.png)](day3/day3.go) [![Perl](../../scripts/assets/perl.png)](day3/day3.pl) +[Day 4: Ceres Search](https://adventofcode.com/2024/day/4) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day4/day4.rs) [![Python](../../scripts/assets/python.png)](day4/day4.py) +[Day 5: Print Queue](https://adventofcode.com/2024/day/5) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day5/day5.rs) +[Day 6: Guard Gallivant](https://adventofcode.com/2024/day/6) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day6/day6.rs) +[Day 7: Bridge Repair](https://adventofcode.com/2024/day/7) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day7/day7.rs) [![Python](../../scripts/assets/python.png)](day7/day7.py) [![Go](../../scripts/assets/go.png)](day7/day7.go) +[Day 8: Resonant Collinearity](https://adventofcode.com/2024/day/8) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day8/day8.rs) [![Python](../../scripts/assets/python.png)](day8/day8.py) +[Day 9: Disk Fragmenter](https://adventofcode.com/2024/day/9) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day9/day9.rs) +[Day 10: Hoof It](https://adventofcode.com/2024/day/10) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day10/day10.rs) +[Day 11: Plutonian Pebbles](https://adventofcode.com/2024/day/11) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day11/day11.rs) [![Go](../../scripts/assets/go.png)](day11/day11.go) +[Day 12: Garden Groups](https://adventofcode.com/2024/day/12) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day12/day12.rs) +[Day 13: Claw Contraption](https://adventofcode.com/2024/day/13) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day13/day13.rs) [![Rust](../../scripts/assets/rust.png)](day13_z3/day13_z3.rs) [![Python](../../scripts/assets/python.png)](day13_z3/day13.py) +[Day 14: Restroom Redoubt](https://adventofcode.com/2024/day/14) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day14/day14.rs) [![Python](../../scripts/assets/python.png)](day14/day14.py) [🎁](day14/README.md) +[Day 15: Warehouse Woes](https://adventofcode.com/2024/day/15) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day15/day15.rs) [🎁](day15/README.md) +[Day 16: Reindeer Maze](https://adventofcode.com/2024/day/16) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day16/day16.rs) [🎁](day16/README.md) +[Day 17: Chronospatial Computer](https://adventofcode.com/2024/day/17) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day17/day17.rs) +[Day 18: RAM Run](https://adventofcode.com/2024/day/18) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day18/day18.rs) [![C++](../../scripts/assets/cpp.png)](day18/day18.cpp) [![Go](../../scripts/assets/go.png)](day18/day18.go) +[Day 19: Linen Layout](https://adventofcode.com/2024/day/19) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day19/day19.rs) +[Day 20: Race Condition](https://adventofcode.com/2024/day/20) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day20/day20.rs) +[Day 21: Keypad Conundrum](https://adventofcode.com/2024/day/21) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day21/day21.rs) +[Day 22: Monkey Market](https://adventofcode.com/2024/day/22) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day22/day22.rs) +[Day 23: LAN Party](https://adventofcode.com/2024/day/23) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day23/day23.rs) [![Python](../../scripts/assets/python.png)](day23/day23.py) +[Day 24: Crossed Wires](https://adventofcode.com/2024/day/24) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day24/day24.rs) +[Day 25: Code Chronicle](https://adventofcode.com/2024/day/25) | ⭐⭐ | [![Rust](../../scripts/assets/rust.png)](day25/day25.rs) [![Python](../../scripts/assets/python.png)](day25/day25.py) [![Go](../../scripts/assets/go.png)](day25/day25.go) diff --git a/2024/day1/day1.c b/src/year2024/day1/day1.c similarity index 100% rename from 2024/day1/day1.c rename to src/year2024/day1/day1.c diff --git a/2024/day1/day1.cpp b/src/year2024/day1/day1.cpp similarity index 100% rename from 2024/day1/day1.cpp rename to src/year2024/day1/day1.cpp diff --git a/2024/day1/day1.cs b/src/year2024/day1/day1.cs similarity index 100% rename from 2024/day1/day1.cs rename to src/year2024/day1/day1.cs diff --git a/2024/day1/day1.go b/src/year2024/day1/day1.go similarity index 100% rename from 2024/day1/day1.go rename to src/year2024/day1/day1.go diff --git a/2024/day1/day1.java b/src/year2024/day1/day1.java similarity index 100% rename from 2024/day1/day1.java rename to src/year2024/day1/day1.java diff --git a/2024/day1/day1.js b/src/year2024/day1/day1.js similarity index 100% rename from 2024/day1/day1.js rename to src/year2024/day1/day1.js diff --git a/2024/day1/day1.kernel/Makefile b/src/year2024/day1/day1.kernel/Makefile similarity index 100% rename from 2024/day1/day1.kernel/Makefile rename to src/year2024/day1/day1.kernel/Makefile diff --git a/2024/day1/day1.kernel/README.md b/src/year2024/day1/day1.kernel/README.md similarity index 100% rename from 2024/day1/day1.kernel/README.md rename to src/year2024/day1/day1.kernel/README.md diff --git a/2024/day1/day1.kernel/aoc.c b/src/year2024/day1/day1.kernel/aoc.c similarity index 100% rename from 2024/day1/day1.kernel/aoc.c rename to src/year2024/day1/day1.kernel/aoc.c diff --git a/2024/day1/day1.kernel/aoc.sh b/src/year2024/day1/day1.kernel/aoc.sh similarity index 100% rename from 2024/day1/day1.kernel/aoc.sh rename to src/year2024/day1/day1.kernel/aoc.sh diff --git a/2024/day1/day1.kernel/kaoc.png b/src/year2024/day1/day1.kernel/kaoc.png similarity index 100% rename from 2024/day1/day1.kernel/kaoc.png rename to src/year2024/day1/day1.kernel/kaoc.png diff --git a/2024/day1/day1.lua b/src/year2024/day1/day1.lua similarity index 100% rename from 2024/day1/day1.lua rename to src/year2024/day1/day1.lua diff --git a/2024/day1/day1.pl b/src/year2024/day1/day1.pl similarity index 100% rename from 2024/day1/day1.pl rename to src/year2024/day1/day1.pl diff --git a/2024/day1/day1.py b/src/year2024/day1/day1.py similarity index 100% rename from 2024/day1/day1.py rename to src/year2024/day1/day1.py diff --git a/2024/day1/day1.rb b/src/year2024/day1/day1.rb similarity index 100% rename from 2024/day1/day1.rb rename to src/year2024/day1/day1.rb diff --git a/2024/day1/day1.rs b/src/year2024/day1/day1.rs similarity index 98% rename from 2024/day1/day1.rs rename to src/year2024/day1/day1.rs index 135dcb14..2fc68118 100644 --- a/2024/day1/day1.rs +++ b/src/year2024/day1/day1.rs @@ -55,7 +55,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let puzzle = Puzzle::new(data); diff --git a/2024/day1/day1.sh b/src/year2024/day1/day1.sh similarity index 100% rename from 2024/day1/day1.sh rename to src/year2024/day1/day1.sh diff --git a/2024/day1/day1.sql b/src/year2024/day1/day1.sql similarity index 100% rename from 2024/day1/day1.sql rename to src/year2024/day1/day1.sql diff --git a/2024/day1/day1.swift b/src/year2024/day1/day1.swift similarity index 100% rename from 2024/day1/day1.swift rename to src/year2024/day1/day1.swift diff --git a/2024/day1/test.txt b/src/year2024/day1/test.txt similarity index 100% rename from 2024/day1/test.txt rename to src/year2024/day1/test.txt diff --git a/2024/day10/day10.rs b/src/year2024/day10/day10.rs similarity index 99% rename from 2024/day10/day10.rs rename to src/year2024/day10/day10.rs index cb04bea6..90f06c66 100644 --- a/2024/day10/day10.rs +++ b/src/year2024/day10/day10.rs @@ -74,7 +74,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2024/day10/sample_1.txt b/src/year2024/day10/sample_1.txt similarity index 100% rename from 2024/day10/sample_1.txt rename to src/year2024/day10/sample_1.txt diff --git a/2024/day10/sample_10.txt b/src/year2024/day10/sample_10.txt similarity index 100% rename from 2024/day10/sample_10.txt rename to src/year2024/day10/sample_10.txt diff --git a/2024/day10/sample_2.txt b/src/year2024/day10/sample_2.txt similarity index 100% rename from 2024/day10/sample_2.txt rename to src/year2024/day10/sample_2.txt diff --git a/2024/day10/sample_3.txt b/src/year2024/day10/sample_3.txt similarity index 100% rename from 2024/day10/sample_3.txt rename to src/year2024/day10/sample_3.txt diff --git a/2024/day10/sample_4.txt b/src/year2024/day10/sample_4.txt similarity index 100% rename from 2024/day10/sample_4.txt rename to src/year2024/day10/sample_4.txt diff --git a/2024/day10/sample_5.txt b/src/year2024/day10/sample_5.txt similarity index 100% rename from 2024/day10/sample_5.txt rename to src/year2024/day10/sample_5.txt diff --git a/2024/day10/sample_6.txt b/src/year2024/day10/sample_6.txt similarity index 100% rename from 2024/day10/sample_6.txt rename to src/year2024/day10/sample_6.txt diff --git a/2024/day10/sample_8.txt b/src/year2024/day10/sample_8.txt similarity index 100% rename from 2024/day10/sample_8.txt rename to src/year2024/day10/sample_8.txt diff --git a/2024/day10/sample_9.txt b/src/year2024/day10/sample_9.txt similarity index 100% rename from 2024/day10/sample_9.txt rename to src/year2024/day10/sample_9.txt diff --git a/2024/day11/day11.go b/src/year2024/day11/day11.go similarity index 100% rename from 2024/day11/day11.go rename to src/year2024/day11/day11.go diff --git a/2024/day11/day11.rs b/src/year2024/day11/day11.rs similarity index 99% rename from 2024/day11/day11.rs rename to src/year2024/day11/day11.rs index f95ad3e6..32650d7e 100644 --- a/2024/day11/day11.rs +++ b/src/year2024/day11/day11.rs @@ -80,7 +80,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2024/day11/test.txt b/src/year2024/day11/test.txt similarity index 100% rename from 2024/day11/test.txt rename to src/year2024/day11/test.txt diff --git a/2024/day12/day12.rs b/src/year2024/day12/day12.rs similarity index 99% rename from 2024/day12/day12.rs rename to src/year2024/day12/day12.rs index 5ce36bb8..917387fc 100644 --- a/2024/day12/day12.rs +++ b/src/year2024/day12/day12.rs @@ -7,7 +7,6 @@ use std::collections::VecDeque; type Grid = aoc::Grid; /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let grid = Grid::parse(data); diff --git a/2024/day12/sample_1.txt b/src/year2024/day12/sample_1.txt similarity index 100% rename from 2024/day12/sample_1.txt rename to src/year2024/day12/sample_1.txt diff --git a/2024/day12/sample_3.txt b/src/year2024/day12/sample_3.txt similarity index 100% rename from 2024/day12/sample_3.txt rename to src/year2024/day12/sample_3.txt diff --git a/2024/day12/sample_4.txt b/src/year2024/day12/sample_4.txt similarity index 100% rename from 2024/day12/sample_4.txt rename to src/year2024/day12/sample_4.txt diff --git a/2024/day12/sample_6.txt b/src/year2024/day12/sample_6.txt similarity index 100% rename from 2024/day12/sample_6.txt rename to src/year2024/day12/sample_6.txt diff --git a/2024/day12/sample_7.txt b/src/year2024/day12/sample_7.txt similarity index 100% rename from 2024/day12/sample_7.txt rename to src/year2024/day12/sample_7.txt diff --git a/2024/day13/day13.rs b/src/year2024/day13/day13.rs similarity index 98% rename from 2024/day13/day13.rs rename to src/year2024/day13/day13.rs index 3ca9dc9e..fe435d1b 100644 --- a/2024/day13/day13.rs +++ b/src/year2024/day13/day13.rs @@ -75,7 +75,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let puzzle = Puzzle::new(data); diff --git a/2024/day13/test.txt b/src/year2024/day13/test.txt similarity index 100% rename from 2024/day13/test.txt rename to src/year2024/day13/test.txt diff --git a/2024/day13_z3/build.rs b/src/year2024/day13_z3/build.rs similarity index 100% rename from 2024/day13_z3/build.rs rename to src/year2024/day13_z3/build.rs diff --git a/2024/day13_z3/day13.py b/src/year2024/day13_z3/day13.py similarity index 100% rename from 2024/day13_z3/day13.py rename to src/year2024/day13_z3/day13.py diff --git a/2024/day13_z3/day13.rs b/src/year2024/day13_z3/day13_z3.rs similarity index 99% rename from 2024/day13_z3/day13.rs rename to src/year2024/day13_z3/day13_z3.rs index 692fcf5e..eb4e9096 100644 --- a/2024/day13_z3/day13.rs +++ b/src/year2024/day13_z3/day13_z3.rs @@ -88,7 +88,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2024/day13_z3/test.txt b/src/year2024/day13_z3/test.txt similarity index 100% rename from 2024/day13_z3/test.txt rename to src/year2024/day13_z3/test.txt diff --git a/2024/day14/README.md b/src/year2024/day14/README.md similarity index 100% rename from 2024/day14/README.md rename to src/year2024/day14/README.md diff --git a/2024/day14/christmastree.gif b/src/year2024/day14/christmastree.gif similarity index 100% rename from 2024/day14/christmastree.gif rename to src/year2024/day14/christmastree.gif diff --git a/2024/day14/day14.py b/src/year2024/day14/day14.py similarity index 100% rename from 2024/day14/day14.py rename to src/year2024/day14/day14.py diff --git a/2024/day14/day14.rs b/src/year2024/day14/day14.rs similarity index 99% rename from 2024/day14/day14.rs rename to src/year2024/day14/day14.rs index 8675d4ba..2ec3c01b 100644 --- a/2024/day14/day14.rs +++ b/src/year2024/day14/day14.rs @@ -99,7 +99,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, i32) { let puzzle = Puzzle::new(data); diff --git a/2024/day14/easteregg.py b/src/year2024/day14/easteregg.py similarity index 100% rename from 2024/day14/easteregg.py rename to src/year2024/day14/easteregg.py diff --git a/2024/day14/easteregg_anim.sh b/src/year2024/day14/easteregg_anim.sh similarity index 100% rename from 2024/day14/easteregg_anim.sh rename to src/year2024/day14/easteregg_anim.sh diff --git a/2024/day14/test.txt b/src/year2024/day14/test.txt similarity index 100% rename from 2024/day14/test.txt rename to src/year2024/day14/test.txt diff --git a/2024/day15/README.md b/src/year2024/day15/README.md similarity index 100% rename from 2024/day15/README.md rename to src/year2024/day15/README.md diff --git a/2024/day15/anim.sh b/src/year2024/day15/anim.sh similarity index 100% rename from 2024/day15/anim.sh rename to src/year2024/day15/anim.sh diff --git a/2024/day15/day15.rs b/src/year2024/day15/day15.rs similarity index 99% rename from 2024/day15/day15.rs rename to src/year2024/day15/day15.rs index 9942a138..7432d844 100644 --- a/2024/day15/day15.rs +++ b/src/year2024/day15/day15.rs @@ -289,7 +289,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let puzzle = Puzzle::new(data); diff --git a/2024/day15/large1.gif b/src/year2024/day15/large1.gif similarity index 100% rename from 2024/day15/large1.gif rename to src/year2024/day15/large1.gif diff --git a/2024/day15/large2.gif b/src/year2024/day15/large2.gif similarity index 100% rename from 2024/day15/large2.gif rename to src/year2024/day15/large2.gif diff --git a/2024/day15/sample_1.txt b/src/year2024/day15/sample_1.txt similarity index 100% rename from 2024/day15/sample_1.txt rename to src/year2024/day15/sample_1.txt diff --git a/2024/day15/sample_2.txt b/src/year2024/day15/sample_2.txt similarity index 100% rename from 2024/day15/sample_2.txt rename to src/year2024/day15/sample_2.txt diff --git a/2024/day15/small1.gif b/src/year2024/day15/small1.gif similarity index 100% rename from 2024/day15/small1.gif rename to src/year2024/day15/small1.gif diff --git a/2024/day15/small2.gif b/src/year2024/day15/small2.gif similarity index 100% rename from 2024/day15/small2.gif rename to src/year2024/day15/small2.gif diff --git a/2024/day16/README.md b/src/year2024/day16/README.md similarity index 100% rename from 2024/day16/README.md rename to src/year2024/day16/README.md diff --git a/2024/day16/anim.gif b/src/year2024/day16/anim.gif similarity index 100% rename from 2024/day16/anim.gif rename to src/year2024/day16/anim.gif diff --git a/2024/day16/anim.sh b/src/year2024/day16/anim.sh similarity index 100% rename from 2024/day16/anim.sh rename to src/year2024/day16/anim.sh diff --git a/2024/day16/day16.rs b/src/year2024/day16/day16.rs similarity index 99% rename from 2024/day16/day16.rs rename to src/year2024/day16/day16.rs index 36c9d6c8..f72f6af9 100644 --- a/2024/day16/day16.rs +++ b/src/year2024/day16/day16.rs @@ -276,7 +276,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, usize) { let puzzle = Puzzle::new(data); diff --git a/2024/day16/sample_1.txt b/src/year2024/day16/sample_1.txt similarity index 100% rename from 2024/day16/sample_1.txt rename to src/year2024/day16/sample_1.txt diff --git a/2024/day16/sample_3.txt b/src/year2024/day16/sample_3.txt similarity index 100% rename from 2024/day16/sample_3.txt rename to src/year2024/day16/sample_3.txt diff --git a/2024/day17/day17.rs b/src/year2024/day17/day17.rs similarity index 99% rename from 2024/day17/day17.rs rename to src/year2024/day17/day17.rs index cf4dceb5..4144405c 100644 --- a/2024/day17/day17.rs +++ b/src/year2024/day17/day17.rs @@ -195,7 +195,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (String, u64) { let puzzle = Puzzle::new(data); diff --git a/2024/day17/sample_1.txt b/src/year2024/day17/sample_1.txt similarity index 100% rename from 2024/day17/sample_1.txt rename to src/year2024/day17/sample_1.txt diff --git a/2024/day17/sample_2.txt b/src/year2024/day17/sample_2.txt similarity index 100% rename from 2024/day17/sample_2.txt rename to src/year2024/day17/sample_2.txt diff --git a/2024/day18/day18.cpp b/src/year2024/day18/day18.cpp similarity index 100% rename from 2024/day18/day18.cpp rename to src/year2024/day18/day18.cpp diff --git a/2024/day18/day18.go b/src/year2024/day18/day18.go similarity index 100% rename from 2024/day18/day18.go rename to src/year2024/day18/day18.go diff --git a/2024/day18/day18.rs b/src/year2024/day18/day18.rs similarity index 99% rename from 2024/day18/day18.rs rename to src/year2024/day18/day18.rs index 5e2db1cf..a83abb88 100644 --- a/2024/day18/day18.rs +++ b/src/year2024/day18/day18.rs @@ -98,7 +98,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, String) { let puzzle = Puzzle::new(data); diff --git a/2024/day18/sample_1.txt b/src/year2024/day18/sample_1.txt similarity index 100% rename from 2024/day18/sample_1.txt rename to src/year2024/day18/sample_1.txt diff --git a/2024/day19/day19.rs b/src/year2024/day19/day19.rs similarity index 98% rename from 2024/day19/day19.rs rename to src/year2024/day19/day19.rs index f500498f..d65b8007 100644 --- a/2024/day19/day19.rs +++ b/src/year2024/day19/day19.rs @@ -50,7 +50,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, u64) { let puzzle = Puzzle::new(data); diff --git a/2024/day19/test.txt b/src/year2024/day19/test.txt similarity index 100% rename from 2024/day19/test.txt rename to src/year2024/day19/test.txt diff --git a/2024/day2/day2.go b/src/year2024/day2/day2.go similarity index 100% rename from 2024/day2/day2.go rename to src/year2024/day2/day2.go diff --git a/2024/day2/day2.py b/src/year2024/day2/day2.py similarity index 100% rename from 2024/day2/day2.py rename to src/year2024/day2/day2.py diff --git a/2024/day2/day2.rs b/src/year2024/day2/day2.rs similarity index 98% rename from 2024/day2/day2.rs rename to src/year2024/day2/day2.rs index 5db7d423..b52ee1e8 100644 --- a/2024/day2/day2.rs +++ b/src/year2024/day2/day2.rs @@ -57,7 +57,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2024/day2/test.txt b/src/year2024/day2/test.txt similarity index 100% rename from 2024/day2/test.txt rename to src/year2024/day2/test.txt diff --git a/2024/day20/day20.rs b/src/year2024/day20/day20.rs similarity index 99% rename from 2024/day20/day20.rs rename to src/year2024/day20/day20.rs index 0cf283a1..c3737601 100644 --- a/2024/day20/day20.rs +++ b/src/year2024/day20/day20.rs @@ -118,7 +118,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2024/day20/test.txt b/src/year2024/day20/test.txt similarity index 100% rename from 2024/day20/test.txt rename to src/year2024/day20/test.txt diff --git a/2024/day21/day21.rs b/src/year2024/day21/day21.rs similarity index 99% rename from 2024/day21/day21.rs rename to src/year2024/day21/day21.rs index 1d5a2caf..b42e27c1 100644 --- a/2024/day21/day21.rs +++ b/src/year2024/day21/day21.rs @@ -251,7 +251,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2024/day21/test.txt b/src/year2024/day21/test.txt similarity index 100% rename from 2024/day21/test.txt rename to src/year2024/day21/test.txt diff --git a/2024/day22/day22.rs b/src/year2024/day22/day22.rs similarity index 98% rename from 2024/day22/day22.rs rename to src/year2024/day22/day22.rs index d28865fa..1507a80c 100644 --- a/2024/day22/day22.rs +++ b/src/year2024/day22/day22.rs @@ -56,7 +56,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i64, i64) { let puzzle = Puzzle::new(data); diff --git a/2024/day22/test.txt b/src/year2024/day22/test.txt similarity index 100% rename from 2024/day22/test.txt rename to src/year2024/day22/test.txt diff --git a/2024/day23/day23.py b/src/year2024/day23/day23.py similarity index 100% rename from 2024/day23/day23.py rename to src/year2024/day23/day23.py diff --git a/2024/day23/day23.rs b/src/year2024/day23/day23.rs similarity index 99% rename from 2024/day23/day23.rs rename to src/year2024/day23/day23.rs index 854695a0..fc010b5e 100644 --- a/2024/day23/day23.rs +++ b/src/year2024/day23/day23.rs @@ -129,7 +129,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, String) { let puzzle = Puzzle::new(data); diff --git a/2024/day23/test.txt b/src/year2024/day23/test.txt similarity index 100% rename from 2024/day23/test.txt rename to src/year2024/day23/test.txt diff --git a/2024/day24/day24.rs b/src/year2024/day24/day24.rs similarity index 99% rename from 2024/day24/day24.rs rename to src/year2024/day24/day24.rs index 60985c4c..193db799 100644 --- a/2024/day24/day24.rs +++ b/src/year2024/day24/day24.rs @@ -226,7 +226,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, String) { let puzzle = Puzzle::new(data); diff --git a/2024/day24/full_adder.png b/src/year2024/day24/full_adder.png similarity index 100% rename from 2024/day24/full_adder.png rename to src/year2024/day24/full_adder.png diff --git a/2024/day24/half_adder.png b/src/year2024/day24/half_adder.png similarity index 100% rename from 2024/day24/half_adder.png rename to src/year2024/day24/half_adder.png diff --git a/2024/day24/sample_1.txt b/src/year2024/day24/sample_1.txt similarity index 100% rename from 2024/day24/sample_1.txt rename to src/year2024/day24/sample_1.txt diff --git a/2024/day24/sample_2.txt b/src/year2024/day24/sample_2.txt similarity index 100% rename from 2024/day24/sample_2.txt rename to src/year2024/day24/sample_2.txt diff --git a/2024/day25/day25.go b/src/year2024/day25/day25.go similarity index 100% rename from 2024/day25/day25.go rename to src/year2024/day25/day25.go diff --git a/2024/day25/day25.py b/src/year2024/day25/day25.py similarity index 100% rename from 2024/day25/day25.py rename to src/year2024/day25/day25.py diff --git a/2024/day25/day25.rs b/src/year2024/day25/day25.rs similarity index 98% rename from 2024/day25/day25.rs rename to src/year2024/day25/day25.rs index c24b47da..01e565e2 100644 --- a/2024/day25/day25.rs +++ b/src/year2024/day25/day25.rs @@ -37,7 +37,6 @@ fn part1(data: &str) -> u64 { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, aoc::Christmas) { (part1(data), aoc::CHRISTMAS) diff --git a/2024/day25/test.txt b/src/year2024/day25/test.txt similarity index 100% rename from 2024/day25/test.txt rename to src/year2024/day25/test.txt diff --git a/2024/day3/day3.go b/src/year2024/day3/day3.go similarity index 100% rename from 2024/day3/day3.go rename to src/year2024/day3/day3.go diff --git a/2024/day3/day3.pl b/src/year2024/day3/day3.pl similarity index 100% rename from 2024/day3/day3.pl rename to src/year2024/day3/day3.pl diff --git a/2024/day3/day3.py b/src/year2024/day3/day3.py similarity index 100% rename from 2024/day3/day3.py rename to src/year2024/day3/day3.py diff --git a/2024/day3/day3.rs b/src/year2024/day3/day3.rs similarity index 98% rename from 2024/day3/day3.rs rename to src/year2024/day3/day3.rs index 0e92f6f1..b81891fe 100644 --- a/2024/day3/day3.rs +++ b/src/year2024/day3/day3.rs @@ -26,7 +26,6 @@ fn calc(data: &str, part: u8) -> i32 { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { (calc(data, 1), calc(data, 2)) diff --git a/2024/day3/sample_1.txt b/src/year2024/day3/sample_1.txt similarity index 100% rename from 2024/day3/sample_1.txt rename to src/year2024/day3/sample_1.txt diff --git a/2024/day3/sample_2.txt b/src/year2024/day3/sample_2.txt similarity index 100% rename from 2024/day3/sample_2.txt rename to src/year2024/day3/sample_2.txt diff --git a/2024/day4/day4.py b/src/year2024/day4/day4.py similarity index 100% rename from 2024/day4/day4.py rename to src/year2024/day4/day4.py diff --git a/2024/day4/day4.rs b/src/year2024/day4/day4.rs similarity index 99% rename from 2024/day4/day4.rs rename to src/year2024/day4/day4.rs index d2acebd0..cf00061c 100644 --- a/2024/day4/day4.rs +++ b/src/year2024/day4/day4.rs @@ -85,7 +85,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u32, u32) { let puzzle = Puzzle::new(data); diff --git a/2024/day4/sample_1.txt b/src/year2024/day4/sample_1.txt similarity index 100% rename from 2024/day4/sample_1.txt rename to src/year2024/day4/sample_1.txt diff --git a/2024/day4/sample_2.txt b/src/year2024/day4/sample_2.txt similarity index 100% rename from 2024/day4/sample_2.txt rename to src/year2024/day4/sample_2.txt diff --git a/2024/day4/sample_3.txt b/src/year2024/day4/sample_3.txt similarity index 100% rename from 2024/day4/sample_3.txt rename to src/year2024/day4/sample_3.txt diff --git a/2024/day4/sample_4.txt b/src/year2024/day4/sample_4.txt similarity index 100% rename from 2024/day4/sample_4.txt rename to src/year2024/day4/sample_4.txt diff --git a/2024/day4/sample_5.txt b/src/year2024/day4/sample_5.txt similarity index 100% rename from 2024/day4/sample_5.txt rename to src/year2024/day4/sample_5.txt diff --git a/2024/day5/day5.rs b/src/year2024/day5/day5.rs similarity index 99% rename from 2024/day5/day5.rs rename to src/year2024/day5/day5.rs index 3ce1feab..b4afd5d5 100644 --- a/2024/day5/day5.rs +++ b/src/year2024/day5/day5.rs @@ -105,7 +105,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (i32, i32) { let puzzle = Puzzle::new(data); diff --git a/2024/day5/test.txt b/src/year2024/day5/test.txt similarity index 100% rename from 2024/day5/test.txt rename to src/year2024/day5/test.txt diff --git a/2024/day6/day6.rs b/src/year2024/day6/day6.rs similarity index 99% rename from 2024/day6/day6.rs rename to src/year2024/day6/day6.rs index ba2f1f1c..46c0080c 100644 --- a/2024/day6/day6.rs +++ b/src/year2024/day6/day6.rs @@ -139,7 +139,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, u32) { let puzzle = Puzzle::new(data); diff --git a/2024/day6/test.txt b/src/year2024/day6/test.txt similarity index 100% rename from 2024/day6/test.txt rename to src/year2024/day6/test.txt diff --git a/2024/day7/day7.go b/src/year2024/day7/day7.go similarity index 100% rename from 2024/day7/day7.go rename to src/year2024/day7/day7.go diff --git a/2024/day7/day7.py b/src/year2024/day7/day7.py similarity index 99% rename from 2024/day7/day7.py rename to src/year2024/day7/day7.py index f78a5d3a..f9793986 100755 --- a/2024/day7/day7.py +++ b/src/year2024/day7/day7.py @@ -1,9 +1,8 @@ #!/usr/bin/env python3 # [Day 7: Bridge Repair](https://adventofcode.com/2024/day/7) -from pathlib import Path import sys - +from pathlib import Path verbose = "-v" in sys.argv if verbose: diff --git a/2024/day7/day7.rs b/src/year2024/day7/day7.rs similarity index 99% rename from 2024/day7/day7.rs rename to src/year2024/day7/day7.rs index cfadc2e5..50bc2db9 100644 --- a/2024/day7/day7.rs +++ b/src/year2024/day7/day7.rs @@ -124,7 +124,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2024/day7/test.txt b/src/year2024/day7/test.txt similarity index 100% rename from 2024/day7/test.txt rename to src/year2024/day7/test.txt diff --git a/2024/day8/day8.py b/src/year2024/day8/day8.py similarity index 100% rename from 2024/day8/day8.py rename to src/year2024/day8/day8.py diff --git a/2024/day8/day8.rs b/src/year2024/day8/day8.rs similarity index 99% rename from 2024/day8/day8.rs rename to src/year2024/day8/day8.rs index ec051982..b93689b7 100644 --- a/2024/day8/day8.rs +++ b/src/year2024/day8/day8.rs @@ -98,7 +98,6 @@ impl Puzzle { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (usize, usize) { let puzzle = Puzzle::new(data); diff --git a/2024/day8/test.txt b/src/year2024/day8/test.txt similarity index 100% rename from 2024/day8/test.txt rename to src/year2024/day8/test.txt diff --git a/2024/day9/day9.rs b/src/year2024/day9/day9.rs similarity index 99% rename from 2024/day9/day9.rs rename to src/year2024/day9/day9.rs index d9f1efa7..ebbeabcf 100644 --- a/2024/day9/day9.rs +++ b/src/year2024/day9/day9.rs @@ -129,7 +129,6 @@ impl<'a> Puzzle<'a> { } /// # Panics -/// over malformed input #[must_use] pub fn solve(data: &str) -> (u64, u64) { let puzzle = Puzzle::new(data); diff --git a/2024/day9/test.txt b/src/year2024/day9/test.txt similarity index 100% rename from 2024/day9/test.txt rename to src/year2024/day9/test.txt