aboutsummaryrefslogtreecommitdiff
path: root/src/pointer.zig
diff options
context:
space:
mode:
authorJulien Dessaux2022-08-08 21:41:55 +0200
committerJulien Dessaux2022-08-08 21:41:55 +0200
commit362fdc1118ebe4699df05a4cbb0bbbe8f2a30a59 (patch)
treead75509bc9962454804ce1bdc836b57babef9276 /src/pointer.zig
parentImplemented the } (aka end) funge command (diff)
downloadzigfunge98-362fdc1118ebe4699df05a4cbb0bbbe8f2a30a59.tar.gz
zigfunge98-362fdc1118ebe4699df05a4cbb0bbbe8f2a30a59.tar.bz2
zigfunge98-362fdc1118ebe4699df05a4cbb0bbbe8f2a30a59.zip
Implemented the under funge command
Diffstat (limited to 'src/pointer.zig')
-rw-r--r--src/pointer.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pointer.zig b/src/pointer.zig
index 7dbf566..7578a65 100644
--- a/src/pointer.zig
+++ b/src/pointer.zig
@@ -169,8 +169,11 @@ pub const Pointer = struct {
p.reverse();
}
},
- // TODO
- 'u' => return error.NotImplemented,
+ 'u' => {
+ if (p.ss.under() catch true) {
+ p.reverse();
+ }
+ },
'g' => {
const v = p.ss.toss.popVector();
try p.ss.toss.push(p.field.get(v[0] + p.sox, v[1] + p.soy));