aboutsummaryrefslogtreecommitdiffhomepage
path: root/samples/aoc/2018
diff options
context:
space:
mode:
authorMarvin Borner2024-10-26 21:36:34 +0200
committerMarvin Borner2024-10-26 21:36:34 +0200
commit0a64553fb3f97021eea303fc9ba8b26d67db709c (patch)
tree4223751b72a44e7481c70a0c89a4a9efbbb1fcd6 /samples/aoc/2018
parentf0114240cecd453c2be7bb760455f0eb5b7a02a0 (diff)
Synced AOC checks
Diffstat (limited to 'samples/aoc/2018')
-rw-r--r--samples/aoc/2018/01/output.check2
-rw-r--r--samples/aoc/2018/01/solve.bruijn7
2 files changed, 4 insertions, 5 deletions
diff --git a/samples/aoc/2018/01/output.check b/samples/aoc/2018/01/output.check
index ede73be..d1c48e3 100644
--- a/samples/aoc/2018/01/output.check
+++ b/samples/aoc/2018/01/output.check
@@ -1 +1 @@
-?> <1t : [0]>
+?> 1/15 (approx. 0.06666667)
diff --git a/samples/aoc/2018/01/solve.bruijn b/samples/aoc/2018/01/solve.bruijn
index 0fd0448..3d26a2e 100644
--- a/samples/aoc/2018/01/solve.bruijn
+++ b/samples/aoc/2018/01/solve.bruijn
@@ -5,10 +5,9 @@
part1 ∑‣ ⧗ (List FrequencyDiff) → Frequency
-part2 z [[[[rec]]]] S.empty (+0) ⧗ (List FrequencyDiff) → Frequency
- rec (S.has? 1 2) case-end case-cont
- case-cont 3 (S.add 1 2) (1 + ^0) ~0
- case-end 1
+part2 z [[[[rec]]]] S.empty (+0)
+ rec S.has? 1 2 1 go
+ go 3 (S.add 1 2) (1 + ^0) ~0
main [parts nums]
nums string→signed-number <$> (init (lines 0))