const std = @import("std"); const IO = @import("frontend/ncurses.zig").IO; const Action = @import("actions.zig").Action; fn run(allocator: std.mem.Allocator) !void { var io = try IO.init(allocator); defer { io.deinit(); } try io.displayMessage("Initialized"); var action = Action.illegal; var tick_count: usize = 0; while (action != Action.exit) { const str = try std.fmt.allocPrint(allocator, "{}", .{tick_count}); defer allocator.free(str); try io.displayMessage(str); action = try io.waitForTick(); switch (action) { Action.tick => { tick_count += 1; }, else => {}, } } } pub fn main() u8 { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; const allocator = gpa.allocator(); run(allocator) catch { return 1; }; return 0; }