Skip to content

Commit

Permalink
WIP day12
Browse files Browse the repository at this point in the history
  • Loading branch information
qselle committed Dec 17, 2024
1 parent 32423f9 commit 796b8cb
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
46 changes: 39 additions & 7 deletions src/day12.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
// use aoc_runner_derive::{aoc, aoc_generator};
use aoc_runner_derive::{aoc, aoc_generator};

// #[aoc_generator(day8)]
// pub fn input_generator(input: &str) -> (Vec<usize>, Vec<usize>) {
#[aoc_generator(day12)]
pub fn input_generator(input: &str) -> Vec<Vec<char>> {
input.lines().map(|s: &str| s.chars().collect()).collect()
}

// #[aoc(day8, part1)]
// pub fn part1(input: &[Equation]) -> usize {
#[aoc(day12, part1)]
pub fn part1(_input: &[Vec<char>]) -> usize {
0
}

// #[aoc(day8, part2)]
// pub fn part2(input: &[Equation]) -> usize {
// #[aoc(day12, part2)]
// pub fn part2(_input: &[Vec<char>]) -> usize {
// 0
// }

#[cfg(test)]
mod tests {
use super::*;

const INPUT: &str = "RRRRIICCFF
RRRRIICCCF
VVRRRCCFFF
VVRCCCJFFF
VVVVCJJCFE
VVIVCCJJEE
VVIIICJJEE
MIIIIIJJEE
MIIISIJEEE
MMMISSJEEE";

#[test]
fn test_part1() {
assert_eq!(1930, part1(&input_generator(INPUT)))
}

// #[test]
// fn test_part2() {
// assert_eq!(65601038650482, part2(&input_generator(INPUT)))
// }
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use aoc_runner_derive::aoc_lib;
mod day1;
mod day10;
mod day11;
mod day12;
mod day2;
mod day3;
mod day4;
Expand Down

0 comments on commit 796b8cb

Please sign in to comment.