diff options
author | Julien Dessaux | 2022-08-06 09:44:47 +0200 |
---|---|---|
committer | Julien Dessaux | 2022-08-06 09:45:09 +0200 |
commit | 28d9795fdee4c29b68936250abd380cf7ae3f228 (patch) | |
tree | 6a7c9602a95a8d4e44b130d42ac2da9ba1ab1629 /src/pointer.zig | |
parent | Do not add the top of the stack stack on the array list (diff) | |
download | zigfunge98-28d9795fdee4c29b68936250abd380cf7ae3f228.tar.gz zigfunge98-28d9795fdee4c29b68936250abd380cf7ae3f228.tar.bz2 zigfunge98-28d9795fdee4c29b68936250abd380cf7ae3f228.zip |
Implemented the { (aka begin) funge command
Diffstat (limited to 'src/pointer.zig')
-rw-r--r-- | src/pointer.zig | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pointer.zig b/src/pointer.zig index 082ce37..70c9a28 100644 --- a/src/pointer.zig +++ b/src/pointer.zig @@ -152,8 +152,14 @@ pub const Pointer = struct { ':' => try p.ss.toss.duplicate(), '\\' => try p.ss.toss.swap(), 'n' => p.ss.toss.clear(), - // TODO - '{' => return error.NotImplemented, + '{' => { + p.ss.begin([2]i64{ p.sox, p.soy }) catch { + p.reverse(); + return null; + }; + p.sox = p.x + p.dx; + p.soy = p.y + p.dy; + }, // TODO '}' => return error.NotImplemented, // TODO |