Initial commit

This commit is contained in:
Dimitri Lozeve 2024-11-12 21:43:32 +01:00
commit f242d2b0df
420 changed files with 62521 additions and 0 deletions

25
2023/day19/day19.bqn Normal file
View file

@ -0,0 +1,25 @@
Split•Import"../bqn-libs/strings.bqn"
wsps01¨(+`¨)•FLines"input"
p•ParseFloat¨¨2¨¨","Split¨¯1¨1¨ps
idsprogs{":"Split¨¨","Split¨¯1¨𝕩}(1)<˘>"{"Split¨ws
ParseProg{𝕊tr: (("<>"1t)<>)(•ParseFloat 2t)(("xmas"𝕩)),r ; 𝕩}
wParseProg¨¨progs
Apply{n𝕊r: r ; fr𝕩 (F 𝕨)𝕨𝕊(1𝕩),r}
Sel{𝕊"A": "A" ; 𝕊"R": "R" ;(/𝕩¨ids)w}
Run{𝕩(ApplySel¨)•_while_{¬´¨"AR"¨𝕩}(𝕩)<"in"}
•Show +´('A'=Run p)/p
lsns<˘>(((•ParseFloat 2)+('>'=1)))¨¯1¨¨¨progs
b1¨¨ns¨¨"xmas"ls
db1¨+`¨4001¨b
c0
{
c+(×´𝕩¨db)×"A"Run𝕩¨b
i+´`0=𝕩
(i¯1+¨b)˙(i) -1(i) 𝕩
}•_while_{𝕩40}¯1+¨b
•Show c+("A"Run¨b)××´¨db