added comparison operators
This commit is contained in:
parent
bfc8d86b54
commit
703f395998
|
@ -75,6 +75,20 @@ impl<'a> Vm {
|
|||
} else {
|
||||
self.stack.push(0)
|
||||
}
|
||||
},
|
||||
"<" => {
|
||||
if unwrap!() > unwrap!() {
|
||||
self.stack.push(1);
|
||||
} else {
|
||||
self.stack.push(0);
|
||||
}
|
||||
},
|
||||
">" => {
|
||||
if unwrap!() < unwrap!() {
|
||||
self.stack.push(1);
|
||||
} else {
|
||||
self.stack.push(0);
|
||||
}
|
||||
}
|
||||
"MOD"|"mod" => {
|
||||
let stack_top = unwrap!();
|
||||
|
|
4
until.fs
4
until.fs
|
@ -1,4 +0,0 @@
|
|||
variable loopy
|
||||
|
||||
BEGIN 12 1 loopy +! WHILE 10 loopy @ <> REPEAT
|
||||
trace stack
|
Loading…
Reference in a new issue