« first day (2550 days earlier)      last day (99 days later) » 

12:01 AM
@Adám In case you're curious, the issue is that all cover functions are called at least once, monadically, with the argument ⍬, which returns the glyph of the function
 
 
3 hours later…
3:23 AM
Hi all, I am attempting to implement functionality like `sort -n` (available in the shell) in APL. I got something to work but it is a mouthful. I am curious what a more concise solution looks like.
https://gist.github.com/justin2004/e4ea60ca0e3c8a9cf77ecec25b4a6eef
 
 
1 hour later…
4:45 AM
{⍵[⍋' '//⍤⎕VFI¨⍵]}
is one approach
 
5:09 AM
I meant
{⍵[⍋(⊃2⊃⎕VFI)¨⍵]}
 
 
3 hours later…
7:49 AM
@justin2004 ^ although that will fail if there's no space after the leading digits. {⍵[⍋{⍎'0',⍵/⍨∧\⍵∊⎕D}¨⍵]} is concise and handles that but {⍵[⍋{⊃2⊃⎕VFI'0',⍵/⍨∧\⍵∊⎕D}¨⍵]} is faster. See also github.com/abrudz/Sort
 
 
4 hours later…
12:18 PM
@user23207160 Hi robert lonigro, if you want to participate here, please email access@apl.chat
@EssieRivers Where? Surely, it is possible to either call them dyadically instead, or to look at their source and choose how to call them?
 
1:00 PM
Welcome to APL Quest, 2023-3! Today's quest is Caesar Salad:
> In a Caesar cipher, each letter in the plaintext is replaced by a letter some fixed number of positions away in the alphabet, effectively "shifting" the alphabet.
Write a function that:
• takes a single integer left argument representing the size of the shift
• takes a character vector right argument representing the plaintext message
• returns a result with the same shape as the right argument representing the encrypted message
> Notes:
> • Use ' ',⎕A as the alphabet
> • You can assume that the plaintext message will contain only characters found in the alphabet.
 
{(⍺⌽a)[⍵⍳⍨a←' ',⎕a]}
 
That's nice.
 
I did not make a solution but can share my entry from last year. Not very advanced
{ r←⍺⌽a←' ',⎕A ⋄ r[a⍸⍵]}
 
Yeah, that's the same, since and are equivalent for found values.
I wonder if it is possible to write a tacit version that is invertible.
 
you mean something with under?
 
1:06 PM
No, just something where you can write ⍣¯1 to undo the encryption.
Btw, you don't have to rotate the alphabet. Another option is using | (with ⎕IO←0 or adjustment — why isn't | sensitive to ⎕IO‽)
 
I thought about converting the alphabet to numbers, adding the offset and than converting back. Which under can be used for?
 
Ah, that should work with Under.
 
@Adám something like {a[(≢a)|⍺+⍵⍳⍨a←' ',⎕a]}?
 
Yes.
But ≢a is always 27.
 
this seems to pass the tests even without io 0
@Adám sure, but this is one of the cases where magic numbers make the code less clear
nevermind, it only passes the tests some of the time
 
1:13 PM
Hm, we should fix that. The tests are semi-random.
 
of topic, but what should I do with this error message? Cant startup Dyalog:
A fatal error has occurred. Dyalog APL cannot continue.

In workspace (process ID:12464)

Syserror: 999 code: 0

Interpreter BuildID: 0x4afd1d1b
Interpreter Created: Oct 28 2022 at 05:17:18
Interpreter Version 120.22.46169.0 / 64 / Unicode

Serial Number : unavailable

If you choose to generate an aplcore, it will be saved as: "C:\windows\system32\aplcore".
It may be possible to retrieve objects from this file using:
No need to answer it now
 
@Richard Got it: {(27|⍺∘+)_U_((' ',⎕A)∘⍳)⍵}
 
Ah yes :)
I had a not succesfull atempt
how nice
 
any other approaches to this problem?
 
@Richard If it happens every time you start Dyalog, re-install. But please zip and email the C:\windows\system32\aplcore file to support@dyalog.com
 
1:17 PM
ok
 
@RubenVerg Not other approaches. It can be generalised to any character array and any alphabet, but the general approach would be the same…
… so I think we're about done.
 
can you spice up the next one?
btw I didn't use <. So probably many possibilties
 
@Richard Sure, handle a fourth element which can be something like 'alpha' or 'beta', rc etc.
 
ok!
 
Fine, see you next week for 2023-4: Like a Version!
 
1:25 PM
I'm not sure I'll be able to participate next week so just in case here's my solution (well two, but completely equivalent in approach): ⊃⍤~∘0>-< or ⊃⍤~∘0×⍤-
 
1:39 PM
thanks @EssieRivers and @Adám
 
 
3 hours later…
4:45 PM
@Adám It is, I mean that the cover for ∧ in ∧/ will be called with ⍬ - which will prompt it to return '∧' - so / knows what its operand is.
 

« first day (2550 days earlier)      last day (99 days later) »