clean up old comments

This commit is contained in:
Jeeves 2025-04-29 06:46:27 -06:00
parent ef86001b04
commit bc3932d432

View file

@ -73,39 +73,6 @@ pub fn main() !void {
try circuit.connectComponents(&and2.component, 0, &or2.component, 2);
try circuit.tick();
// battery1.component.process();
// battery2.component.process();
// battery3.component.process();
// not1.component.process();
// or3.component.process();
// or6.component.process();
// and1.component.process();
// or1.component.process();
// or4.component.process();
// or7.component.process();
// and2.component.process();
// or2.component.process();
// or5.component.process();
// or8.component.process();
// std.debug.print("Input:\n{}\n\n", .{input});
// std.debug.print("{}\n{}\n\n", .{
// or1.component.outputs.items[0].signal,
// or2.component.outputs.items[0].signal,
// });
// std.debug.print("{}\n{}\n{}\n\n", .{
// or3.component.outputs.items[0].signal,
// or4.component.outputs.items[0].signal,
// or5.component.outputs.items[0].signal,
// });
// std.debug.print("{}\n{}\n{}\n{}\n{}\n\n", .{
// or6.component.outputs.items[0].signal,
// and1.component.outputs.items[0].signal,
// or7.component.outputs.items[0].signal,
// and2.component.outputs.items[0].signal,
// or8.component.outputs.items[0].signal,
// });
}
pub const Circuit = struct {
@ -125,7 +92,6 @@ pub const Circuit = struct {
}
pub fn deinit(self: *Circuit) void {
// std.debug.print("process_order.len {d}\n", .{self.process_order.?.len});
if (self.process_order) |p| self.allocator.free(p);
for (0..self.components.items.len) |i| self.components.items[i].deinit(self.allocator);
self.components.deinit(self.allocator);
@ -184,7 +150,6 @@ pub const Circuit = struct {
// check each connection of the current output
connections: for (output.connections.items) |connection| {
const new_idx = self.componentIndex(connection.component).?;
// std.debug.print("{}@{d}\n", .{ connection, new_idx });
// check if component is "ready"
// i.e. it hasn't already been added to the process list, but all its inputs have.
@ -207,12 +172,9 @@ pub const Circuit = struct {
}
component_idx = stack.pop() orelse break :dfs;
// std.debug.print("backtracking to {}\n", .{component_idx});
}
}
// std.debug.print("{any}\n", .{visited});
if (self.process_order) |p| self.allocator.free(p);
self.process_order = try process_order.toOwnedSlice();
}