Day 7.1
This commit is contained in:
@@ -13,7 +13,7 @@ pub fn loadFromStream(alloc: *std.mem.Allocator, stream: *std.fs.File.InStream.S
|
||||
var trimmed = std.mem.trimRight(u8, num, "\r\n");
|
||||
program[i] = try std.fmt.parseInt(i32, trimmed, 10);
|
||||
|
||||
std.debug.warn("{},", program[i]);
|
||||
// std.debug.warn("{},", program[i]);
|
||||
|
||||
i += 1;
|
||||
}
|
||||
@@ -118,6 +118,11 @@ pub const Machine = struct {
|
||||
while (try self.step()) {}
|
||||
}
|
||||
|
||||
pub fn deinit(self: *Machine) void {
|
||||
self.input.deinit();
|
||||
self.output.deinit();
|
||||
}
|
||||
|
||||
/// Read an immediate or position value from memory. Parameter determines
|
||||
/// which field following the current instruction to read from
|
||||
inline fn __read(self: *Machine, parameter: usize, mode: Mode) i32 {
|
||||
|
Reference in New Issue
Block a user