-
Notifications
You must be signed in to change notification settings - Fork 1
/
10.q
21 lines (18 loc) · 985 Bytes
/
10.q
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// --- Day 10: The Stars Align ---
t:flip `py`px`vy`vx!flip { {x where not null x}"J"$" "vs inter[x;.Q.n,"- "] } each read0`:input/10.txt
f:{ exec (px+x*vx;py+x*vy) from t }
m:0w
s:-1+(1+)/[{ $[m>=c:count distinct first p:f x;[m::c;1b];0b] };0]
-1@trim r where not all null flip r:./[(g;g:1+max (raze/) msg)#" ";;:;"#"] msg:flip f s;
/###### ##### ###### # # # ### ###### ####
/# # # # # # # # # # #
/# # # # # # # # # #
/# # # # # # # # # #
/##### ##### # ## # # # #
/# # # ## # # # # ###
/# # # # # # # # # #
/# # # # # # # # # # #
/# # # # # # # # # # ##
/# # ###### # # ###### ### ###### ### #
-1"\n",string s;
/10867