aboutsummaryrefslogtreecommitdiff
path: root/src/field.zig
diff options
context:
space:
mode:
authorJulien Dessaux2022-08-14 00:08:32 +0200
committerJulien Dessaux2022-08-14 00:08:32 +0200
commit307183aad7d2a2d2bf8253621cd120441d487d00 (patch)
treed7e31b41d1f9d71a09e3478f248c30b69a193b29 /src/field.zig
parentAdd environment handling (diff)
downloadzigfunge98-307183aad7d2a2d2bf8253621cd120441d487d00.tar.gz
zigfunge98-307183aad7d2a2d2bf8253621cd120441d487d00.tar.bz2
zigfunge98-307183aad7d2a2d2bf8253621cd120441d487d00.zip
Implemented the y command requirements
Diffstat (limited to '')
-rw-r--r--src/field.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/field.zig b/src/field.zig
index e96a44a..9a12a80 100644
--- a/src/field.zig
+++ b/src/field.zig
@@ -244,6 +244,9 @@ pub const Field = struct {
if (y >= f.y and y < f.y + @intCast(i64, f.lines.items.len)) return f.lines.items[@intCast(usize, y - @intCast(i64, f.y))].get(x);
return ' ';
}
+ pub fn getSize(f: Field) [4]i64 {
+ return [4]i64{ f.x, f.y, @intCast(i64, f.lx), @intCast(i64, f.lines.items.len) };
+ }
fn init(allocator: std.mem.Allocator) !*Field {
var f = try allocator.create(Field);
errdefer allocator.destroy(f);