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