commit f39ebe66f26dff9514b77a9d64ab8555a349b8ae Author: 2wenty1ne Date: Tue Nov 5 16:14:43 2024 +0100 First start diff --git a/main.zig b/main.zig new file mode 100644 index 0000000..9f450e0 --- /dev/null +++ b/main.zig @@ -0,0 +1,31 @@ +const std = @import("std"); +const writer = std.io.getStdOut().writer(); +const expect = std.testing.expect; + +fn Vec3(comptime T: type) type { + return struct { + const Self = @This(); + x: T, + y: T, + z: T, + fn init(this: *Self, x: T, y: T, z: T) void { + this.x = x; + this.y = y; + this.z = z; + } + + fn print(this: Self) !void { + try writer.print("X: %d\nY: %d\nZ: %d\n", .{this.x, this.y, this.x}); + } + + //fn add(this: *Self, other: Self) { + // + //} + }; +} + +pub fn main() !void { + var vec1: Vec3(u64) = undefined; + vec1.init(2, 4, 3); + vec1.print(); +}