added <> (!= in most languages)

This commit is contained in:
Goren Barak 2023-12-30 16:48:00 -05:00
parent 27923e8c0e
commit e31e72af40

View file

@ -67,6 +67,13 @@ impl<'a> Vm {
self.stack.push(0); self.stack.push(0);
} }
}, },
"<>" => {
if unwrap!() != unwrap!() {
self.stack.push(1);
} else {
self.stack.push(0)
}
}
"MOD"|"mod" => { "MOD"|"mod" => {
let stack_top = unwrap!(); let stack_top = unwrap!();
let stack_second = unwrap!(); let stack_second = unwrap!();
@ -106,6 +113,9 @@ impl<'a> Vm {
self.stack.push(stack_top); self.stack.push(stack_top);
self.stack.push(stack_second); self.stack.push(stack_second);
}, },
"DROP"|"drop" => {
let _ = self.stack.pop();
},
"HERE"|"here" => { "HERE"|"here" => {
self.stack.push(self.dictionary.dp); self.stack.push(self.dictionary.dp);
}, },