« first day (1942 days earlier)      last day (718 days later) » 

4:56 AM
github.com/PuercoPop/advent-of-code/blob/… one question about using ⌿ to filter the 'rows' in a 2d matrix down to one. How do I extract the final row to a vector? ⊃ would get only the first element and ↑ would swap the axis but there would still be two. I used ∨⌿ as a work around but I'm guessing there is a more direct way?
 
 
2 hours later…
6:52 AM
@PuercoPop You can do a scan with right tack like so ⊢⌿. It starts with the first two rows and the accumulator is the second row, which ultimately picks the last row.
 
 
1 hour later…
8:08 AM
Sorry, that's reduce, not scan, but I think that's what you want.
 
 
4 hours later…
12:20 PM
@PuercoPop Actually, for this problem all you need just 1=≢⍵:,⍵⋄
since there would always be only one line left.
I already forget what I did for this problem though.
 
1:20 PM
@LdBeth Ah makes sense, thanks.
 
 
9 hours later…
9:54 PM
@pitr I think dyalog<file.apl will do it.
 
didn't morten mention an ibeam for that in a presentation
 
Yes, 1010⌶ but it doesn't do that.
Maybe it should have such an option, though.
 
oh it displays the code
sorry should have checked
 
@PuercoPop Any first-axis reduction will do, or ⎕IO⌷ (you can replace ⎕IO with its value). But interestingly, I've been pondering a monadic function which would do exactly what you ask for, without resorting to strange things like reducing over a length 1 axis.
 

« first day (1942 days earlier)      last day (718 days later) »