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

29
2023/day16/day16.bqn Normal file
View file

@ -0,0 +1,29 @@
grid>•FLines"input"
PBM•Import"../../bqn-graphics/pnm.bqn"
Mat{1˙¨(𝕩)(grid)0}
Sim{
Step{𝕨𝕊ivnv:
{𝕊1: ("img/out"(1•Fmt 1e4+i)".pnm")•file.Chars PBM ¬Mat ¨v ; 0}𝕨
nexts{´(0<(grid))𝕩}¨/{𝕊pd:
{
𝕊'.'·: p+d,d ;
𝕊'/'·: p-d,-d ;
𝕊'\'·: p+d,d ;
𝕊'|'1: p+d,d ;
𝕊'|'0: p+10,10,p-10,-10 ;
𝕊'-'0: p+d,d ;
𝕊'-'1: p+01,01,p-01,-01
}pgrid,|d
}¨nv
i+1,nvv,(¬nextsv)/nexts
}
¨1𝕨Step•_while_{02𝕩} 0𝕩
}
•Show 1 Sim00,01
mngrid
starts(10¨0¨m)(¯10¨(m-1)¨m)(01¨0¨n)(¯10¨(n-1)¨n)
•Show ´¨Sim¨starts