Skip to content

Commit

Permalink
docs(2023): add documentation and performance for day 16
Browse files Browse the repository at this point in the history
  • Loading branch information
believer committed Dec 16, 2023
1 parent 3bb7f95 commit d47ff73
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions rust/2023/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ You try to ask why they can't just use a weather machine ("not powerful enough")
| [Day 13: Point of Incidence](https://github.com/believer/advent-of-code/blob/master/rust/2023/src/day_13.rs) | 🌟 | 27300 | 🌟 | 29276 |
| [Day 14: Parabolic Reflector Dish](https://github.com/believer/advent-of-code/blob/master/rust/2023/src/day_14.rs) | 🌟 | 108614 | 🌟 | 96447 |
| [Day 15: Lens Library](https://github.com/believer/advent-of-code/blob/master/rust/2023/src/day_15.rs) | 🌟 | 516070 | 🌟 | 244981 |
| [Day 16: The Floor Will Be Lava](https://github.com/believer/advent-of-code/blob/master/rust/2023/src/day_16.rs) | 🌟 | 7562 | 🌟 | 7793 |

## Performance

Expand All @@ -53,6 +54,7 @@ With the help of [cargo-aoc](https://github.com/gobanos/cargo-aoc) I get automat
| 13 | 24.87 µs | 17.61 µs | | 169.28 µs |
| 14 | 19.30 µs | 20.22 µs | | 23.69 µs |
| 15 | 19.99 µs | 210.88 µs | - / `-28.20%` | 241.12 µs |
| 16 | 1.41 ms | 49.39 ms | | 30.33 µs |

\* compared to first solution<br/>
\*\* slow, didn't benchmark. Value comes from running the solver.
Expand Down
13 changes: 10 additions & 3 deletions rust/2023/src/day_16.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//! Day 16

//! Day 16: The Floor Will Be Lava
//!
//! Another day, another grid. This time, we'll direct a beam of light
//! through a grid of mirrors and splitters. The goal is to find the number of
//! energized tiles, tiles where the beam has been. I enjoyed this one.
//! Just the right amount of challenge. Not too easy, not too hard.

use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
use std::collections::{HashSet, VecDeque};
Expand Down Expand Up @@ -92,7 +96,8 @@ pub fn input_generator(input: &str) -> Input {

/* Part One
*
*
* Find the number of energized tiles after firing the beam from the top left
* of the grid.
*/
// Your puzzle answer was
#[doc = r#"```
Expand All @@ -107,6 +112,8 @@ pub fn solve_part_01(input: &Input) -> usize {

/* Part Two
*
* Find the maximum number of energized tiles after firing the beam
* inwards from all edges of the grid.
*
*/
#[doc = r#"```
Expand Down

0 comments on commit d47ff73

Please sign in to comment.