fix not reading input past the first character
This commit is contained in:
parent
de9af67e50
commit
07a7b44778
1 changed files with 2 additions and 1 deletions
|
@ -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'=' => {
|
||||||
|
|
Loading…
Reference in a new issue