From 199812e2139c4977c2a8f1479dbd9039bcc27e73 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Fri, 22 Dec 2023 09:47:26 -0600 Subject: [PATCH] day 22 solution runs in ~1.5s. Bug was if 2 bricks adjoin in two+ spots. Now to vacuum conditionals... --- 2023/day22.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/2023/day22.m4 b/2023/day22.m4 index 9b2a97d..b116dd3 100644 --- a/2023/day22.m4 +++ b/2023/day22.m4 @@ -62,7 +62,8 @@ macro(`part2', 0) macro(`mop', `ifdef(`list', `pop(guts(`list'))pop(`list')$0()')') macro(`_audit', `ifelse($2, `', `macro(`part2', incr(part2))pull($1)', `ifdef(`bad$2', `$0($1, shift(shift($@)))')')') -macro(`audit', `ifelse($2, `', `', `_$0($2, atop$2)$0($1, shift(shift($@)))')') +macro(`audit', `ifelse($2, `', `', $2, $3, `$0($1, shift(shift($@)))', + `_$0($2, atop$2)$0($1, shift(shift($@)))')') macro(`pull', `ifdef(`bad$1', `', `push(`bad$1')push(`list', `bad$1')audit(`$1', supports$1)')') forloop(1, bricks, `pull(', `)mop()') -- 2.11.4.GIT