aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCeleste <colean@colean.cc>2022-02-15 21:32:10 +0000
committerCeleste <colean@colean.cc>2022-02-15 21:32:10 +0000
commitab04bbcdb65f32f73060e6419b2378ef3b8bc38a (patch)
treea67b4eba6c302ad30d1492c85dcf45d0192d6653
parent1108291ad0f8d567ae38e3ba2b5dcff9ce1fd0a0 (diff)
fix stupid mistake
-rw-r--r--src/main.rs5
1 files changed, 4 insertions, 1 deletions
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);
}
}