You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
advent-of-code/2016/rust/src/day_23.rs

14 lines
403 B

use assembunny::*;
use errors::*;
pub fn solve(input: &str) -> Result<String> {
let instructions: Instructions = input.parse()?;
let mut registers = Registers::new();
registers[Register::A] = 12;
let assembunny = Assembunny{registers: registers, instructions: instructions};
let registers = assembunny.last().ok_or("")?;
let a = registers[Register::A];
Ok(a.to_string())
}