From 5d60ed699b930b2cb22c665fd54d6a27763b07d9 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Fri, 23 Dec 2016 13:49:22 -0500 Subject: Day 23 part 2 --- src/bin/day23.rs | 7 ++++--- 1 file 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] -- cgit 1.4.1 upervisor
summary refs log tree commit diff
path: root/FreeBSD/catsitd.in (unfollow)
Commit message (Expand)Author
2020-08-15Add FreeBSD rc scriptJune McEnroe
2020-08-15Call setproctitle with number of servicesJune McEnroe
2020-08-15Rename project to catsitJune McEnroe
2020-08-15Use only LOG_NOTICE and LOG_WARNINGJune McEnroe
2020-08-15Make log messages consistentJune McEnroe
2020-08-15Remove closelog callJune McEnroe
2020-08-15Implement service statusJune McEnroe
2020-08-15Parse control commandsJune McEnroe
2020-08-15Read service pipesJune McEnroe
2020-08-15Implement non-blocking line-buffered readingJune McEnroe
2020-08-15Generate tags fileJune McEnroe
2020-08-15Just use CLOCK_MONOTONIC and clean up includesJune McEnroe
2020-08-15Reap childrenJune McEnroe
2020-08-14Implement serviceSignal, serviceStop, serviceRestartJune McEnroe
2020-08-14Reset restartInterval and restartDeadline on startJune McEnroe
2020-08-14Switch to timespec for timeoutsJune McEnroe
2020-08-14Implement serviceStartJune McEnroe
2020-08-14Flesh out Service structJune McEnroe
2020-08-14Build environment for servicesJune McEnroe
2020-08-14Implement spawntab parsingJune McEnroe
2020-08-14Open syslog, daemonize, write PIDJune McEnroe
2020-08-14Implement user and group lookupJune McEnroe
2020-08-14Add install targetJune McEnroe
2020-08-14Add spawnd skeletonJune McEnroe