diff --git a/.aocf/cache/aoc2023_23.json b/.aocf/cache/aoc2023_23.json new file mode 100644 index 0000000..c42403d --- /dev/null +++ b/.aocf/cache/aoc2023_23.json @@ -0,0 +1,12 @@ +{ + "year": 2023, + "day": 23, + "level": "first", + "title": "A Long Walk", + "stars": null, + "solution": {}, + "input": null, + "brief": { + "first": "The Elves resume water filtering operations! Clean water starts flowing over the edge of Island Island.\n\nThey offer to help *you* go over the edge of Island Island, too! Just hold on tight to one end of this impossibly long rope and they'll lower you down a safe distance from the massive waterfall you just created.\n\nAs you finally reach Snow Island, you see that the water isn't really reaching the ground: it's being *absorbed by the air* itself. It looks like you'll finally have a little downtime while the moisture builds up to snow-producing levels. Snow Island is pretty scenic, even without any snow; why not take a walk?\n\nThere's a map of nearby hiking trails (your puzzle input) that indicates *paths* (`.`), *forest* (`#`), and steep *slopes* (`^`, `>`, `v`, and `<`).\n\nFor example:\n\n```\n#.#####################\n#.......#########...###\n#######.#########.#.###\n###.....#.>.>.###.#.###\n###v#####.#v#.###.#.###\n###.>...#.#.#.....#...#\n###v###.#.#.#########.#\n###...#.#.#.......#...#\n#####.#.#.#######.#.###\n#.....#.#.#.......#...#\n#.#####.#.#.#########v#\n#.#...#...#...###...>.#\n#.#.#v#######v###.###v#\n#...#.>.#...>.>.#.###.#\n#####v#.#.###v#.#.###.#\n#.....#...#...#.#.#...#\n#.#########.###.#.#.###\n#...###...#...#...#.###\n###.###.#.###v#####v###\n#...#...#.#.>.>.#.>.###\n#.###.###.#.###.#.#v###\n#.....###...###...#...#\n#####################.#\n\n```\n\nYou're currently on the single path tile in the top row; your goal is to reach the single path tile in the bottom row. Because of all the mist from the waterfall, the slopes are probably quite *icy*; if you step onto a slope tile, your next step must be *downhill* (in the direction the arrow is pointing). To make sure you have the most scenic hike possible, *never step onto the same tile twice*. What is the longest hike you can take?\n\nIn the example above, the longest hike you can take is marked with `O`, and your starting position is marked `S`:\n\n```\n#S#####################\n#OOOOOOO#########...###\n#######O#########.#.###\n###OOOOO#OOO>.###.#.###\n###O#####O#O#.###.#.###\n###OOOOO#O#O#.....#...#\n###v###O#O#O#########.#\n###...#O#O#OOOOOOO#...#\n#####.#O#O#######O#.###\n#.....#O#O#OOOOOOO#...#\n#.#####O#O#O#########v#\n#.#...#OOO#OOO###OOOOO#\n#.#.#v#######O###O###O#\n#...#.>.#...>OOO#O###O#\n#####v#.#.###v#O#O###O#\n#.....#...#...#O#O#OOO#\n#.#########.###O#O#O###\n#...###...#...#OOO#O###\n###.###.#.###v#####O###\n#...#...#.#.>.>.#.>O###\n#.###.###.#.###.#.#O###\n#.....###...###...#OOO#\n#####################O#\n\n```\n\nThis hike contains `*94*` steps. (The other possible hikes you could have taken were `90`, `86`, `82`, `82`, and `74` steps long.)\n\nFind the longest hike you can take through the hiking trails listed on your map. *How many steps long is the longest hike?*\n\nTo begin, [get your puzzle input](23/input).\n\nAnswer:" + } +} \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7ee063f..059bbf6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,138 +20,10 @@ jobs: - name: Run tests run: cargo test --verbose -- --nocapture - RunDay01: + RunAll: runs-on: ubuntu-latest needs: BuildAndTest steps: - uses: actions/checkout@v4 - - name: Run AOC day 01 - run: cargo run --bin day01 - - RunDay02: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 02 - run: cargo run --bin day02 - - RunDay03: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 03 - run: cargo run --bin day03 - - RunDay04: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 04 - run: cargo run --bin day04 - - RunDay05: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 05 - run: cargo run --bin day05 - - RunDay06: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 06 - run: cargo run --bin day06 - - RunDay07: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 07 - run: cargo run --bin day07 - - RunDay08: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 08 - run: cargo run --bin day08 - - RunDay09: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 09 - run: cargo run --bin day09 - - RunDay10: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 10 - run: cargo run --bin day10 - - RunDay11: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 11 - run: cargo run --bin day11 - - RunDay12: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 12 - run: cargo run --bin day12 - - RunDay13: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 13 - run: cargo run --bin day13 - - RunDay14: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 14 - run: cargo run --bin day14 - - RunDay15: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 15 - run: cargo run --bin day15 - - RunDay16: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 16 - run: cargo run --bin day16 - - RunDay18: - runs-on: ubuntu-latest - needs: BuildAndTest - steps: - - uses: actions/checkout@v4 - - name: Run AOC day 18 - run: cargo run --bin day18 + - name: Run all AOC solutions in Release mode + run: cargo build --release && time ci/runall.sh diff --git a/src/day08.rs b/src/day08.rs index 19f91e8..5897ad2 100644 --- a/src/day08.rs +++ b/src/day08.rs @@ -32,6 +32,7 @@ impl Parse for Instructions { #[derive(Debug)] struct Node { + #[allow(dead_code)] from_string: String, label: String, left: String, diff --git a/src/day16.rs b/src/day16.rs index b038f3d..f61493d 100644 --- a/src/day16.rs +++ b/src/day16.rs @@ -87,11 +87,6 @@ impl ContraptionMap { } } - fn from_string_slices(input: &Vec<&str>) -> ContraptionMap { - let input: Vec = input.iter().map(|s| s.to_string()).collect(); - ContraptionMap::from_strings(&input) - } - fn get_terrain(&self, point: &Point) -> &Terrain { &self.grid[point.y as usize][point.x as usize] } diff --git a/src/day20.rs b/src/day20.rs index 5f6de42..cda099f 100644 --- a/src/day20.rs +++ b/src/day20.rs @@ -1,8 +1,5 @@ mod problem; -use std::{fmt::LowerExp, num, ptr::slice_from_raw_parts}; - -use mut_binary_heap::RefMut; use nom::character::complete::space1; use problem::*; diff --git a/src/grid.rs b/src/grid.rs index 95952e7..30ee3be 100644 --- a/src/grid.rs +++ b/src/grid.rs @@ -1,3 +1,5 @@ +#![allow(unused)] + use aoc::Grid; use aoc::Int; use std::fmt::Debug;