fixed lt and gt

This commit is contained in:
MCorange 2023-03-13 23:33:06 +02:00
parent b6bbb2d251
commit f9b1184f18
2 changed files with 3 additions and 3 deletions

View File

@ -42,14 +42,14 @@ pub fn run(tokens: Vec<crate::constants::Operator>) -> Result<(), &'static str>{
ti += 1;
},
OpType::Gt => {
let a = stack_pop(&mut stack)?;
let b = stack_pop(&mut stack)?;
let a = stack_pop(&mut stack)?;
stack.push((a > b) as i32);
ti += 1;
},
OpType::Lt => {
let a = stack_pop(&mut stack)?;
let b = stack_pop(&mut stack)?;
let a = stack_pop(&mut stack)?;
stack.push((a < b) as i32);
ti += 1;
},

View File

@ -1,4 +1,4 @@
1 2 < if
2 1 < if
1 print
else
0 print