This commit is contained in:
2019-12-09 11:37:00 +00:00
parent 289aa920d0
commit 421455f8ba
6 changed files with 123 additions and 24 deletions

17
09/src/main.zig Normal file
View File

@@ -0,0 +1,17 @@
const std = @import("std");
const intcode = @import("intcode");
pub fn main() anyerror!void {
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
const alloc = &arena.allocator;
var program = try intcode.loadFromStdIn(alloc);
var machine = try intcode.Machine.init(alloc, program);
try machine.writeToInput(1); // BOOST program in test mode
try machine.run();
std.debug.warn("Day 9, Part 1: {}\n", try machine.readFromOutput());
}