Extended IntCodeComputer.
This commit is contained in:
1 parent
420b6152fb
commit
c8cef9c0ce
1 file changed
+5
@@ -217,6 +217,7 @@ impl IntCodeComputer {
|
|||||||
op.params[0].store(&mut self.ram, *v, self.relative_base_offset);
|
op.params[0].store(&mut self.ram, *v, self.relative_base_offset);
|
||||||
self.pc += 2;
|
self.pc += 2;
|
||||||
} else {
|
} else {
|
||||||
|
self.input_storage.clear();
|
||||||
return false;
|
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) {
|
pub fn clear_output(&mut self) {
|
||||||
self.output_storage.clear();
|
self.output_storage.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user