day 23 part 1
This commit is contained in:
@@ -282,10 +282,20 @@ impl IntCodeComputer {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn add_input(&mut self, input: &[i128]) {
|
||||
for x in input {
|
||||
self.input_storage.push(*x);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn clear_output(&mut self) {
|
||||
self.output_storage.clear();
|
||||
}
|
||||
|
||||
pub fn clear_n_output(&mut self, n: usize) {
|
||||
self.output_storage = Vec::from(self.output_storage.split_at(n).1);
|
||||
}
|
||||
|
||||
pub fn get_output(&self) -> &[i128] {
|
||||
self.output_storage.as_slice()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user