From ab04bbcdb65f32f73060e6419b2378ef3b8bc38a Mon Sep 17 00:00:00 2001 From: Celeste Date: Tue, 15 Feb 2022 21:32:10 +0000 Subject: [PATCH] fix stupid mistake --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 0439a7e..f655269 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,7 @@ fn main() { let instructions = fs::read_to_string(&args[1]) .expect("Instructions could not be read."); let mut i: i32 = 0; + let mut ii = 0; if Path::new("registers").exists() { let lreg = fs::read_to_string("registers") @@ -25,6 +26,7 @@ fn main() { let split: Vec<&str> = instructions.split("\n").collect(); loop { + ii = ii + 1; let s = split[i as usize]; if s.contains("inc") { let splitinstr: Vec<&str> = s.split("inc ").collect(); @@ -61,7 +63,8 @@ fn main() { a = a + 1; } } - println!("Program Step: {}", i); + println!("Instruction Pointer: {}", i); + println!("Program Step: {}", ii); process::exit(0x0100); } }