advent_of_code_2022/days/day09/src/part2.rs

27 lines
530 B
Rust
Raw Normal View History

use std::collections::HashSet;
2023-11-20 05:27:00 +01:00
use aoc_libs::points::Point;
use crate::{rope::Rope, parse::Direction};
pub fn part2(input: &Vec<Direction>) -> usize {
let mut visited: HashSet<Point> = HashSet::new();
let mut rope: Rope<10> = Rope::new();
for direction in input {
visited.insert(*rope.get_tail_pos());
rope.update_rope(direction);
println!("{}", rope)
}
visited.len()
2023-11-20 05:27:00 +01:00
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_part2() {
assert_eq!(0, 0);
}
}