From 9de4fa6ebd1623b382aa93f783d7e2bbed6c5153 Mon Sep 17 00:00:00 2001 From: Simon Cambier Date: Mon, 4 Dec 2023 21:05:32 +0100 Subject: [PATCH] Cleaning --- day4.p8 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/day4.p8 b/day4.p8 index 3b49218..e816c42 100644 --- a/day4.p8 +++ b/day4.p8 @@ -245,20 +245,16 @@ local iter = cocreate(function() local count = 0 for j, v in ipairs(mine) do if contains(winning, v) then - count = count + 1 + count += 1 -- yay exponential growth copies[i + count] = strdsum(copies[i + count], tostr(copies[i])) - -- lne(1, 0, 1, 10, 7) - -- pset(i, count, 7) - -- print(count) - -- circ(i%128, count*10, 1, 7) line(i % 128, 0, i % 128, count * 10 + 10, 11) yield() end end printh(" " .. count .. " winning cards") if count > 0 then - count = count - 1 + count -= 1 -- printh(2 ^ count) sum = strdsum(sum, tostr(2 ^ count)) end