From e6076d7853cdd6f2223a381822ecd899de9c8a7b Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 9 Dec 2022 11:42:37 -0600 Subject: [PATCH] Comments --- 2022/rust/src/day9.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/2022/rust/src/day9.rs b/2022/rust/src/day9.rs index 867d96e..9aee6e8 100644 --- a/2022/rust/src/day9.rs +++ b/2022/rust/src/day9.rs @@ -49,10 +49,12 @@ fn both_parts(input: &Input) -> (Answer, Answer) { _ => None, } { for _ in 0..i.1 { + // move part 1 head/tail h = (h.0 + x, h.1 + y); t = follow(h, t); p1.insert(t); + // move part 2 rope r[0] = (r[0].0 + x, r[0].1 + y); for s in 1..r.len() { r[s] = follow(r[s - 1], r[s]);