From c69307c2ea2e44ba78e36dbea8cdf1542acb4847 Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Mon, 14 Dec 2020 19:32:56 -0600 Subject: [PATCH] sped up day 14; updated day 8 --- day14.onyx | 2 +- day8.onyx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/day14.onyx b/day14.onyx index e2e1789..2dff089 100644 --- a/day14.onyx +++ b/day14.onyx @@ -85,7 +85,7 @@ main :: proc (args: [] cstr) { file := reader.make(contents); mem : map.Map(u64, u64); - map.init(^mem, 64); + map.init(^mem, 257); defer map.free(^mem); mask : Bitmask; diff --git a/day8.onyx b/day8.onyx index 111c105..a93a243 100644 --- a/day8.onyx +++ b/day8.onyx @@ -14,9 +14,9 @@ Instruction :: struct { // Returns if the program successfully exited. get_acc_value :: proc (instrs: [..] Instruction, ret_acc: ^i32) -> bool { - already_been: i32map.I32Map(bool); - i32map.init(^already_been); - defer i32map.free(^already_been); + already_been: map.Map(i32, bool); + map.init(^already_been); + defer map.free(^already_been); ip := 0; acc := 0; @@ -27,8 +27,8 @@ get_acc_value :: proc (instrs: [..] Instruction, ret_acc: ^i32) -> bool { break; } - if i32map.has(^already_been, ip) do break; - i32map.put(^already_been, ip, true); + if map.has(^already_been, ip) do break; + map.put(^already_been, ip, true); switch instrs[ip].opcode { case OpCode.Nop do ip += 1; -- 2.25.1