From a521a0f18aad5c73c6aa6f88e8ad84eeac8cc5a2 Mon Sep 17 00:00:00 2001 From: mehbark Date: Thu, 19 Dec 2024 19:42:24 -0500 Subject: [PATCH] other stuff idk --- bf.zig | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/bf.zig b/bf.zig index a4d68ce..854b7d5 100644 --- a/bf.zig +++ b/bf.zig @@ -24,8 +24,6 @@ const Level1 = union(enum) { loop_end: u24, zero, - find_zero_left, - find_zero_right, const Self = @This(); @@ -59,8 +57,6 @@ const Level1 = union(enum) { .loop_start => |n| try writer.print("JEZ {d:0>4}", .{n}), .loop_end => |n| try writer.print("JNZ {d:0>4}", .{n}), .zero => try writer.print("ZER ", .{}), - .find_zero_left => try writer.print("FZL ", .{}), - .find_zero_right => try writer.print("FZR ", .{}), } } }; @@ -113,10 +109,6 @@ fn compileLevel1(allocator: mem.Allocator, src: []const u8) !ArrayList(Level1) { try out.append(.zero); skip = 2; cur = Level1.nothing(); - } else if ((src[i + 1] == '>' or src[i + 1] == '<') and src[i + 2] == ']') { - try out.append(if (src[i + 1] == '>') .find_zero_right else .find_zero_left); - skip = 2; - cur = Level1.nothing(); } else { cur = .{ .loop_start = 0 }; try openers.append(@as(u24, @truncate(out.items.len))); @@ -318,16 +310,6 @@ pub fn main() !void { if (memory[mp] != 0) ip = new_ip; }, .zero => memory[mp] = 0, - .find_zero_right => { - while (memory[mp] != 0) { - mp +%= 1; - } - }, - .find_zero_left => { - while (memory[mp] != 0) { - mp -%= 1; - } - }, } ip += 1; }