First start

main
2wenty1ne 2024-11-05 16:14:43 +01:00
commit f39ebe66f2
1 changed files with 31 additions and 0 deletions

31
main.zig 100644
View File

@ -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();
}