diff options
author | Justin Wernick <justin@worthe-it.co.za> | 2020-01-13 23:08:19 +0200 |
---|---|---|
committer | Justin Wernick <justin@worthe-it.co.za> | 2020-01-13 23:08:19 +0200 |
commit | fa3b0d8cb573a2a0700fa565d6cf12abf66dc70f (patch) | |
tree | 773f4f85edd2eba1dd3729d0f55e0f00b42f04eb /src/lib.rs | |
parent | 87572a858c724f1c7414743ad397e79101c46727 (diff) |
Day 25: Text adventure game!
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -125,6 +125,13 @@ impl IntcodeProgram { .unwrap() } + pub fn output_into_result(&self) -> Result<Vector<Intcode>, IntcodeProgramError> { + match self.error { + Some(ref error) => Err(error.clone()), + None => Ok(self.output.clone()), + } + } + fn with_instruction_pointer(&self, instruction_pointer: Intcode) -> IntcodeProgram { IntcodeProgram { instruction_pointer, @@ -170,13 +177,6 @@ impl IntcodeProgram { } } - fn output_into_result(&self) -> Result<Vector<Intcode>, IntcodeProgramError> { - match self.error { - Some(ref error) => Err(error.clone()), - None => Ok(self.output.clone()), - } - } - fn memory_0_into_result(&self) -> Result<Intcode, IntcodeProgramError> { match self.error { Some(ref error) => Err(error.clone()), |