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.
14 lines
402 B
14 lines
402 B
use assembunny::*;
|
|
use errors::*;
|
|
|
|
pub fn solve(input: &str) -> Result<String> {
|
|
let instructions: Instructions = input.parse()?;
|
|
let mut registers = Registers::new();
|
|
registers[Register::C] = 1;
|
|
let assembunny = Assembunny{registers: registers, instructions: instructions};
|
|
|
|
let registers = assembunny.last().ok_or("")?;
|
|
let a = registers[Register::A];
|
|
Ok(a.to_string())
|
|
}
|