From 07a7b4477871222fed6a86689190ec1283673231 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Sat, 16 Dec 2023 13:22:02 +0100 Subject: [PATCH] fix not reading input past the first character --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index b1c4f18..9e7b6b1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,7 +39,7 @@ enum State { fn main() { let args: Vec<_> = env::args().collect(); if args.len() <= 1 { - println!("usage: sandworm source_file input_file"); + println!("usage: worm source_file [input_file]"); exit(0); } let filename = &args[1]; @@ -190,6 +190,7 @@ impl SandWormInterpreter { .get(self.input_index) .copied() .unwrap_or_default(); + self.input_index += 1; self.worm_in.push(val); } b'=' => {