From b5bfb6f025ce9dbbbd8353c6a019a0a428f4ddc6 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 7 Aug 2022 00:09:32 +0200 Subject: Implemented the } (aka end) funge command --- src/pointer.zig | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/pointer.zig') 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' => { -- cgit v1.2.3