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

17
2022/day09/day09.bqn Normal file
View file

@ -0,0 +1,17 @@
ToNats,Split•Import"../bqn-libs/strings.bqn"
Dirs{𝕩'R' ? 10; 𝕩'U' ? 01; 𝕩'L' ? ¯10; 𝕩'D' ? 0¯1}
dn<˘>' 'Split¨•FLines•args
inp(¨ToNats¨n)/Dirs¨´d
Dist´|-
Follow{𝕩+(2𝕩 Dist 𝕨)×(××|)2÷˜𝕨-𝕩}
Move{Follow`𝕩+𝕨}
F{
pos(<𝕨<0,0)Move`𝕩
inds>¯1¨pos
# Disp←{⊑⟜".#"¨(⍉⌽˘(1⊸+⌾(𝕩⊸⊑))𝕨⥊0)}
# •Show (1+(⌈´-⌊´)inds) Disp inds
inds
}
•Show 210 F¨ <inp

2000
2022/day09/input Normal file

File diff suppressed because it is too large Load diff

8
2022/day09/test1 Normal file
View file

@ -0,0 +1,8 @@
R 4
U 4
L 3
D 1
R 4
D 1
L 5
R 2

8
2022/day09/test2 Normal file
View file

@ -0,0 +1,8 @@
R 5
U 8
L 8
D 3
R 17
D 10
L 25
U 20