day8
This commit is contained in:
parent
f892834fa6
commit
ac77d9ee45
3 changed files with 24 additions and 1 deletions
12
aoc.bqn
12
aoc.bqn
|
@ -50,4 +50,14 @@ Day5 ⇐ {
|
|||
Day6 ⇐ {{𝕨+ ⊑/ ≡⟜⍷˘ 𝕨↕𝕩}⟜(•FChars 𝕩)¨ 4‿14}
|
||||
# ⟨ 1929 3298 ⟩
|
||||
|
||||
# •Show Day6 ⊑•args
|
||||
Day7 ⇐ {𝕩, "mercury only"!0}
|
||||
|
||||
Day8 ⇐ {
|
||||
_rots ← {F‿x←𝔽‿𝕩, >{F⌾𝕏x}¨⟨⊢,⍉,⌽˘,⍉⌽⟩}
|
||||
A ← {+´⥊ ∨˝ ∧´∘(⊑>1⊸↓)¨ 𝕩}
|
||||
B ← {⌈´⥊ ×˝ {1⊑⎊(1-˜≠𝕩)/ (⊑≤⊢) 𝕩}¨ 𝕩}
|
||||
(A⋈B) ¯1⊸↓∘↓˘_rots '0'-˜ >•FLines 𝕩
|
||||
}
|
||||
# ⟨ 1843 180000 ⟩
|
||||
|
||||
# •Show Day8 ⊑•args
|
||||
|
|
2
aoc.m
2
aoc.m
|
@ -45,6 +45,7 @@ run_day(Day, Part, Lines, Out) :-
|
|||
:- import_module day5.
|
||||
:- import_module day6.
|
||||
:- import_module day7.
|
||||
:- import_module day8.
|
||||
|
||||
:- pred solution(int::in, sol::out(sol)) is semidet.
|
||||
solution(1, day1.run).
|
||||
|
@ -54,3 +55,4 @@ solution(4, day4.run).
|
|||
solution(5, day5.run).
|
||||
solution(6, day6.run).
|
||||
solution(7, day7.run).
|
||||
solution(8, day8.run).
|
||||
|
|
11
day8.m
Normal file
11
day8.m
Normal 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").
|
Loading…
Reference in a new issue