generated from bravit/advent-of-code-rust-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
110 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
..F..........L............5....................... | ||
............................L.U................... | ||
.................................................. | ||
.............z.L.........5.....4........8....1.P.. | ||
...F................D..4.8.............P......J... | ||
......f................8....z........U..J......... | ||
.......D..f........B..o.........m..........JX..... | ||
......o...5........F..........m.......6....X...... | ||
....s........f...n.....54.U....E................3. | ||
....F.......l.......k..............6.3n........... | ||
L..........z....7..U............E...k.P..3b....... | ||
..s.......D..........h...k.....G........y..m...... | ||
d..............o.........X............8...n....... | ||
...........o.......D.......J...................... | ||
....................z.....1.9....G6..Y.b....y..... | ||
.d................4.........EN..G.9.b............. | ||
.......................7.......................... | ||
..d................l.........pc..n................ | ||
..............l........1Nm..........G..9.......... | ||
.f.........s...7........1........E........X....y.. | ||
.............d...................6......v......... | ||
........................h.............B........... | ||
.......l.......................h........B.....p..y | ||
........w......A................................M. | ||
.....s.................O...........p.......2...... | ||
...............9.........................B.b...... | ||
......................w..0..............H......... | ||
.....................w7.j..O....................e. | ||
.A......Z...................K...h...M............. | ||
.................S....KZ.......................... | ||
.................V..............x................. | ||
......Z...............................N........... | ||
.......................a.......................... | ||
....A..........................K.................M | ||
.......Z..................ON.KT.........c......... | ||
...........................YO....t.......x........ | ||
..............g........w.T.............k...c...... | ||
..........................v....................... | ||
....S..................................u.......... | ||
..........0............v...............c...e..C.p. | ||
.......S............V.j........v.......x.......... | ||
......S..0W.......HT....a......................... | ||
A..............H...W..a......C.................... | ||
................T.2.....V......H..t...u........C.. | ||
.................g.j....2.........u..t...e......C. | ||
.........W...........g.......................u.... | ||
........W...0.................Y.........e.tM...... | ||
................g..a.j............................ | ||
.................................................. | ||
.................2........Y...........x........... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
use anyhow::*; | ||
use std::fs::File; | ||
use std::io::{BufRead, BufReader}; | ||
use code_timing_macros::time_snippet; | ||
use const_format::concatcp; | ||
use adv_code_2024::*; | ||
|
||
const DAY: &str = "08"; | ||
const INPUT_FILE: &str = concatcp!("input/", DAY, ".txt"); | ||
|
||
const TEST: &str = "\ | ||
............ | ||
........0... | ||
.....0...... | ||
.......0.... | ||
....0....... | ||
......A..... | ||
............ | ||
............ | ||
........A... | ||
.........A.. | ||
............ | ||
............ | ||
"; | ||
|
||
fn main() -> Result<()> { | ||
start_day(DAY); | ||
|
||
//region Part 1 | ||
println!("=== Part 1 ==="); | ||
|
||
fn part1<R: BufRead>(reader: R) -> Result<usize> { | ||
// TODO: Solve Part 1 of the puzzle | ||
Ok(0) | ||
} | ||
|
||
// TODO: Set the expected answer for the test input | ||
assert_eq!(14, part1(BufReader::new(TEST.as_bytes()))?); | ||
|
||
let input_file = BufReader::new(File::open(INPUT_FILE)?); | ||
let result = time_snippet!(part1(input_file)?); | ||
println!("Result = {}", result); | ||
//endregion | ||
|
||
//region Part 2 | ||
// println!("\n=== Part 2 ==="); | ||
// | ||
// fn part2<R: BufRead>(reader: R) -> Result<usize> { | ||
// Ok(0) | ||
// } | ||
// | ||
// assert_eq!(0, part2(BufReader::new(TEST.as_bytes()))?); | ||
// | ||
// let input_file = BufReader::new(File::open(INPUT_FILE)?); | ||
// let result = time_snippet!(part2(input_file)?); | ||
// println!("Result = {}", result); | ||
//endregion | ||
|
||
Ok(()) | ||
} |