diff options
author | Julien Dessaux | 2022-08-07 00:09:32 +0200 |
---|---|---|
committer | Julien Dessaux | 2022-08-07 00:09:32 +0200 |
commit | b5bfb6f025ce9dbbbd8353c6a019a0a428f4ddc6 (patch) | |
tree | 9bd9adc5a271e5b4b7c7002354b9457d156d5bb0 /src/pointer.zig | |
parent | Implemented the { (aka begin) funge command (diff) | |
download | zigfunge98-b5bfb6f025ce9dbbbd8353c6a019a0a428f4ddc6.tar.gz zigfunge98-b5bfb6f025ce9dbbbd8353c6a019a0a428f4ddc6.tar.bz2 zigfunge98-b5bfb6f025ce9dbbbd8353c6a019a0a428f4ddc6.zip |
Implemented the } (aka end) funge command
Diffstat (limited to 'src/pointer.zig')
-rw-r--r-- | src/pointer.zig | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/pointer.zig b/src/pointer.zig index 70c9a28..7dbf566 100644 --- a/src/pointer.zig +++ b/src/pointer.zig @@ -160,8 +160,15 @@ pub const Pointer = struct { p.sox = p.x + p.dx; p.soy = p.y + p.dy; }, - // TODO - '}' => return error.NotImplemented, + '}' => { + const v = p.ss.end() catch null; + if (v) |so| { + p.sox = so[0]; + p.soy = so[1]; + } else { + p.reverse(); + } + }, // TODO 'u' => return error.NotImplemented, 'g' => { |