Skip to content

Commit

Permalink
Update lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
aryavsaigal committed Jun 22, 2021
1 parent 69d5c17 commit 6ff37ec
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ pub fn interpret(content: String) {
let c = chars[index];

if c == '+' {
if cell == 255 {
cell = 0;
}
else {
cell += 1;
};
cell = cell.wrapping_add(1);
}
else if c == '!' {
print!("{}", String::from_utf8(vec!(cell)).expect("Unknown value."));
Expand Down Expand Up @@ -66,4 +61,4 @@ pub fn interpret(content: String) {

index += 1;
}
}
}

0 comments on commit 6ff37ec

Please sign in to comment.