This commit is contained in:
rhiannon morris 2022-12-08 09:32:27 +01:00
parent f892834fa6
commit ac77d9ee45
3 changed files with 24 additions and 1 deletions

12
aoc.bqn
View file

@ -50,4 +50,14 @@ Day5 ⇐ {
Day6 {{𝕨+ / ˘ 𝕨𝕩}(•FChars 𝕩)¨ 414} Day6 {{𝕨+ / ˘ 𝕨𝕩}(•FChars 𝕩)¨ 414}
# ⟨ 1929 3298 ⟩ # ⟨ 1929 3298 ⟩
# •Show Day6 ⊑•args Day7 {𝕩, "mercury only"!0}
Day8 {
_rots {Fx𝔽𝕩, >{F𝕏x}¨,,˘,}
A {+´ ˝ ´(>1)¨ 𝕩}
B {´ ×˝ {1(1-˜𝕩)/ () 𝕩}¨ 𝕩}
(AB) ¯1˘_rots '0'-˜ >•FLines 𝕩
}
# ⟨ 1843 180000 ⟩
# •Show Day8 ⊑•args

2
aoc.m
View file

@ -45,6 +45,7 @@ run_day(Day, Part, Lines, Out) :-
:- import_module day5. :- import_module day5.
:- import_module day6. :- import_module day6.
:- import_module day7. :- import_module day7.
:- import_module day8.
:- pred solution(int::in, sol::out(sol)) is semidet. :- pred solution(int::in, sol::out(sol)) is semidet.
solution(1, day1.run). solution(1, day1.run).
@ -54,3 +55,4 @@ solution(4, day4.run).
solution(5, day5.run). solution(5, day5.run).
solution(6, day6.run). solution(6, day6.run).
solution(7, day7.run). solution(7, day7.run).
solution(8, day8.run).

11
day8.m Normal file
View file

@ -0,0 +1,11 @@
:- module day8.
:- interface.
:- import_module basics.
:- import_module univ.
:- pred run(part::in, lines::in, univ::out) is cc_multi.
:- implementation.
:- pragma no_determinism_warning(run/3).
run(_, _, _) :- die("bqn only").