summary refs log tree commit diff homepage
path: root/src/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2016-12-23 13:49:22 -0500
committerJune McEnroe <june@causal.agency>2020-11-22 00:14:25 -0500
commitb2bad4db74f9ba8f496e10f02d86f6be9260c7ee (patch)
treeade1b3e1b26c6e8315773564878448f32bfc7eb9 /src/bin
parentDay 23 (diff)
downloadaoc-b2bad4db74f9ba8f496e10f02d86f6be9260c7ee.tar.gz
aoc-b2bad4db74f9ba8f496e10f02d86f6be9260c7ee.zip
Day 23 part 2
Diffstat (limited to 'src/bin')
-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]
rc/commit/bin/pngo.c?id=b42094cda0316137d61b94689a50667e5e32d6a3&follow=1'>Recalculate various lengths only as neededJune McEnroe 2021-09-21Rewrite pngo, add explicit optionsJune McEnroe 2021-09-16Fix /* **/ comment matchingJune McEnroe 2021-09-15Remove typer, add downgrade to READMEJune McEnroe 2021-09-15Set bot mode on downgradeJune McEnroe 2021-09-15Enter capsicum in downgradeJune McEnroe 2021-09-15Factor out common parts of downgrade messagesJune McEnroe 2021-09-14Add downgrade IRC botJune McEnroe 2021-09-14Sort by title if authors matchJune McEnroe 2021-09-13Swap-remove tags as they're foundJune McEnroe 2021-09-12Replace htagml regex with strncmpJune McEnroe 2021-09-11Also defer printing comment for lone close-parensJune McEnroe 2021-09-10Publish "git-comment"June McEnroe 2021-09-10Add git comment --pretty optionJune McEnroe 2021-09-08Defer printing comment if line is blank or closing braceJune McEnroe 2021-09-08Up default min-repeat to 30 linesJune McEnroe 2021-09-08Handle dirty lines in git-commentJune McEnroe 2021-09-08Document and install git-commentJune McEnroe 2021-09-08Add repeat and all options to git-commentJune McEnroe 2021-09-08Add group threshold to git-commentJune McEnroe