We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6211cf commit 2925d97Copy full SHA for 2925d97
1 file changed
src/lib.rs
@@ -294,13 +294,10 @@ impl VM {
294
Opcode::JMP(address) => self.ip = address as usize - 1,
295
Opcode::PR => print!("{}", self.memory[self.dp] as u8 as char),
296
Opcode::RE => {
297
- let mut buffer = [0; 2];
+ let mut buffer = [0; 1];
298
std::io::Read::read_exact(&mut std::io::stdin(), &mut buffer)
299
.expect("Failed to read input");
300
self.memory[self.dp] = buffer[0] as i32;
301
- if self.dp + 1 < self.memory.len() {
302
- self.memory[self.dp + 1] = buffer[1] as i32;
303
- }
304
}
305
Opcode::JZ(address) => {
306
if self.memory[self.dp] == 0 {
0 commit comments