summary refs log tree commit diff homepage
path: root/src/bin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bin/day23.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/day23.rs b/src/bin/day23.rs
index 3546dd5..4a54983 100644
--- a/src/bin/day23.rs
+++ b/src/bin/day23.rs
@@ -125,9 +125,9 @@ impl Vm {
     }
 }
 
-fn solve(input: &str) -> i32 {
+fn solve(initial: i32, input: &str) -> i32 {
     let mut vm = Vm::from(input);
-    vm.registers[0] = 7;
+    vm.registers[0] = initial;
     while vm.step() { }
     vm.registers[0]
 }
@@ -136,7 +136,8 @@ fn main() {
     let mut input = String::new();
     io::stdin().read_to_string(&mut input).unwrap();
 
-    println!("Part 1: {}", solve(&input));
+    println!("Part 1: {}", solve(7, &input));
+    println!("Part 2: {}", solve(12, &input));
 }
 
 #[test]
colspan='3' class='logmsg'> 2020-02-10Duplicate effective URL before passing it back to curlJune McEnroe Apparently sometimes it didn't like receiving its own internal storage to parse again. Understandable. 2020-02-09Add To Be Taught, If FortunateJune McEnroe 2020-02-04Add The Future of Another TimelineJune McEnroe Wow. One of the best I've read. 2020-01-31Reorganize the Makefile for the umpteenth timeJune McEnroe Broke out LDLIBS for each bin, and made everything more uniform. 2020-01-28Change scout sensitivity to 1.4June McEnroe idk it seems to work. 2020-01-28Import shows.txtJune McEnroe