« first day (1774 days earlier)      last day (55 days later) » 

adr
4:18 AM
Hey y'all. Taking the opportunity afforded by Advent of Code to finally hunker down and learn APL. Having a blast thus far. Today really pushed me in some new directions (recursion and higher order functions: https://git.sr.ht/~adregan/advent-of-code-2021/tree/mainline/item/3.apl)

I was wondering, however, why it isn't necessary to pass the operand through on recursion. Ie. If I have a fn that takes ⍺, ⍺⍺, and ⍵, I only needed to recurse with the arguments: ⍺∇⍵. Do recursive calls share the same scope as the initial call?
 
 
1 hour later…
5:20 AM
Hello, is there a function like segs but also works on more than 1 character?
 
5:31 AM
Hi there! Is there any way to replace a given element of a matrix? (i.e. like regular matrix assignment but returning a modified matrix instead of mutating the original)
or more generally, do an operation on only a set of rows or columns
 
5:50 AM
@SimonBranch See the @ operator
(9@2 4)4 3⍴⍳12
 
hello, i am having a frusturating problem
i have a list where the second element onward is a string expressing a bingo board
(for aoc)
{↑⍎¨⊃' 'Split(⎕UCS 10)Split ⍵}2⊃input This code will get the board for the second board just fine
but as soon as i try to ¨ that across the entire input, it fails
{↑⍎¨⊃' 'Split(⎕UCS 10)Split ⍵}¨1↓input gives me a value error
AH it's because the file ends in a newline
 
@gamma_delta not a direct answer to you question, but if you are still struggling with input processing, try github.com/Dyalog/link
 
it's driving me crazy yeah
i've been trying to solve it in APL and in a lisp i wrote
doing the input processing is easy in lisp but the actual problem is a nightmare
and inversely, i've been trynig to get apl to read the damn file for like an hour but the problem itelf looks so easy in apl
 
mkdir Foo; echo "[
0 1 2 3 4
]" > data.apla;

then in Dyalog APL, with Link correctly installed,

]LINK.import Foo Foo
Foo.data
0 1 2 3 4
and with a text editor, you can very easily turning today's input text into apl arrays.
@adr Simple answer, yes. Brief answer: it is like how dynamic scoping is treated in early days lisp.
 
 
3 hours later…
9:21 AM
@gamma_delta Here's how I read and parsed the data: gist.github.com/xpqz/95303a2498a91cac80efa3cfb6470556
Today's effort was :P -- maybe someone has a smart version; part 1: gist.github.com/xpqz/3853e6e5051f73ba0c7f692e03b2293c
I need to tidy up my p2 a bit...
 
10:01 AM
I wonder what languages anyone with a rank uses. Probably includes APL, and some other golfing languages with interactive interface.
My personal best is getting #264 in day three's part 1
 
 
2 hours later…
12:04 PM
Today's AoC has properly challenged my budding APL knowledge: gist.github.com/klao/b37b9a8f28c8235972ce94e8d6cc9f0e
I'm relatively happy with my solution (no ugly loops, no recursion, no power operator), but still. Would want to simplify the ends thing to be a proper array computation.
 
@klao nice work
 
@xpqz Thanks! It means a lot!
 
12:26 PM
github.com/rak1507/Advent-Of-Code-APL/blob/main/2021/… todays was a 1 char change from part 1 to part 2
 
 
5 hours later…
4:59 PM
@xpqz silly bean - use a single membership followed by just and- and or-reductions on matrices - then apply using rank 2
although maybe you could get fancy and rank-less with dyadic transpose?
 

« first day (1774 days earlier)      last day (55 days later) »