From 8bc0e74e10884a293e7da3fbccad98e50a339ebc Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Wed, 21 Jul 2021 17:45:33 +0200 Subject: [PATCH] Day 19 part 2: some bash cleanup --- day19/ex2.bash | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/day19/ex2.bash b/day19/ex2.bash index cd2c992..99b30cd 100755 --- a/day19/ex2.bash +++ b/day19/ex2.bash @@ -69,20 +69,20 @@ done # hack: -# 1) build part 1 tree +# 1) build rules 42 and 31 # 2) calculate rule 8 and 11 with some "guessed" minimum possible value -# 3) rebuild tree from scratch, but with rules 8 and 11 pre-loaded -buildtree 1 var_0 0 +# 3) build rule 0 -# This value was found manually: stable from 5. +# result starts to be "stable" from this value SOME_LIMIT=5 + +buildtree 1 var_0 42 +buildtree 1 var_0 31 tmp8="(${MATCH[42]})+" tmp11="(${MATCH[42]}${MATCH[31]})" for ((i=2; i