day 23 part 1

This commit is contained in:
2022-10-02 19:57:00 +02:00
parent 79ea3c29d0
commit 420b6152fb
6 changed files with 61 additions and 1 deletions

View File

@@ -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()
}