Skip to content

Commit

Permalink
add input for day 08
Browse files Browse the repository at this point in the history
  • Loading branch information
gaito-20 committed Dec 8, 2024
1 parent da4c0fc commit 470b41b
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
50 changes: 50 additions & 0 deletions input/08.txt
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...........
60 changes: 60 additions & 0 deletions src/bin/08.rs
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(())
}

0 comments on commit 470b41b

Please sign in to comment.