2019: intcode: rename method to get last output

This commit is contained in:
Antoine Martin 2019-12-09 16:42:54 +01:00
parent 83fa28b21d
commit d02364731d
4 changed files with 7 additions and 15 deletions

View file

@ -263,15 +263,7 @@ impl Intcode {
self.memory.get(0).copied()
}
pub fn get_day05_output(&self) -> Option<i64> {
for (i, out) in self.output.iter().enumerate() {
if i < self.output.len() - 1 {
assert_eq!(*out, 0);
} else {
return Some(*out);
}
}
None
pub fn get_last_output(&self) -> Option<i64> {
self.output.last().copied()
}
}