Extended IntCodeComputer.

This commit is contained in:
2022-10-03 09:03:31 +02:00
parent 420b6152fb
commit c8cef9c0ce

View File

@@ -217,6 +217,7 @@ impl IntCodeComputer {
op.params[0].store(&mut self.ram, *v, self.relative_base_offset);
self.pc += 2;
} else {
self.input_storage.clear();
return false;
}
}
@@ -288,6 +289,10 @@ impl IntCodeComputer {
}
}
pub fn get_input(&self) -> &[i128] {
self.input_storage.as_slice()
}
pub fn clear_output(&mut self) {
self.output_storage.clear();
}