2019: intcode: rename method to get last output
This commit is contained in:
parent
83fa28b21d
commit
d02364731d
4 changed files with 7 additions and 15 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue