fix not reading input past the first character

This commit is contained in:
Crispy 2023-12-16 13:22:02 +01:00
parent de9af67e50
commit 07a7b44778

View file

@ -39,7 +39,7 @@ enum State {
fn main() { fn main() {
let args: Vec<_> = env::args().collect(); let args: Vec<_> = env::args().collect();
if args.len() <= 1 { if args.len() <= 1 {
println!("usage: sandworm source_file input_file"); println!("usage: worm source_file [input_file]");
exit(0); exit(0);
} }
let filename = &args[1]; let filename = &args[1];
@ -190,6 +190,7 @@ impl SandWormInterpreter {
.get(self.input_index) .get(self.input_index)
.copied() .copied()
.unwrap_or_default(); .unwrap_or_default();
self.input_index += 1;
self.worm_in.push(val); self.worm_in.push(val);
} }
b'=' => { b'=' => {