« first day (2585 days earlier)      last day (64 days later) » 

12:01 AM
@Adám, next Dyalog apl will support Vision Pro, first language support spatial computation, all you need just finger to input apl symbols,
 
12:16 AM
Got the historical comparison table together. Easier than I expected since the infoboxes are more complete here.
 
 
11 hours later…
10:56 AM
@Richard Maybe someone else can run a weekly event, tackling e.g. LeetCode problems.
 
 
2 hours later…
1:00 PM
Welcome to APL Quest, 2023-8! Today's quest is Critical Thinking:
> Double critical days can be calculated respectively using multiples of:
      23 23 28∧⍥(÷∘2)28 33 33
322 379.5 462
> The dreaded “triple critical day” only occurs every (∧/23 28 33÷2) or 10,626 days.
> Write a function that:
• takes a 3-element integer left argument representing a valid birthdate
• takes a 3-element integer right argument representing a valid date occurring on or after the left argument
• returns a 3-element integer array representing the date of the next double or triple critical day occurring on or after the date represented by the right argument.
Interestingly, the info about the triple critical day is actually a red herring. Any triple critical day is of course also a double critical day, so we just need to find the next double critical day.
 
for the contest I had (3∘↑⍤⊃¯1∘⎕dt)(⌊/⊢+322 379.5 462∘|⍤-)⍥(1⎕dt⊂)
 
> Note: All the dates in this specification are to be in the form year month day
And we also have this competition entry:
19 hours ago, by Richard
{d←1⎕DT⍺⍵ ⋄ m←322 379.5 462 ⋄ 3↑⊃¯1⎕DT ⌊/d[1]+m×⌈m÷⍨--/d}
 
I remember I didn't really like this problem since all the ⎕dt stuff makes parsing & serializing about as long as the actual core of the solution
I assume there's no other way to do the parsing and formatting?
 
Not really.
We can, however, move parts around a little in your solution to shorten it overall.
 
I had (3↑∘⊃¯1⎕DT⊣+322 379.5 462(⌊/⊣×∘⌈÷⍨)-⍨)⍥(1⎕DT⊂), which looks like basically the same thing as Richard's
 
1:09 PM
But again can be shortened/simplified a bit.
(3∘↑⍤⊃¯1∘⎕dt)(⌊/⊢+322 379.5 462∘|⍤-)⍥(1⎕dt⊂)
(3∘↑⍤⊃¯1∘⎕dt)(⌊/⊢+322 379.5 462|-)⍥(1⎕dt⊂)
(3∘↑⍤⊃¯1∘⎕dt)(⊢+322 379.5 462(⌊/|)-)⍥(1⎕dt⊂)
(3∘↑⍤⊃¯1∘⎕dt)(⊢+322 379.5 462⌊.|-)⍥(1⎕dt⊂)
(3∘↑)(⊃¯1⎕dt⊢+322 379.5 462⌊.|-)⍥(1⎕dt⊂)
3↑(⊃¯1⎕dt⊢+322 379.5 462⌊.|-)⍥(1⎕dt⊂)
 
right, of course it's a .!
 
@rabbitgrowth Do you want the progress to the same solution too?
 
should've taken the time to work on this a bit more instead of just giving the sol i had for the contest
 
Oh I see how the | works with the negative number now, that's pretty nice
@Adám You mean the step-by-step simplification?
 
Yes.
 
1:15 PM
Hm, let me see if I can figure it out myself
 
@rabbitgrowth Yes, many programming languages have a less useful "mod" result for negative args.
 
Okay so as a first step I changed ⌊/⊣×∘⌈÷⍨ to ⊣⌊.×∘⌈÷⍨, but that's just as long
 
But you're just implementing residue |
 
Ah I see, yeah I can see how to replace parts step by step to arrive at 3↑(⊃¯1⎕dt⊢+322 379.5 462⌊.|-)⍥(1⎕dt⊂)
 
OK good. Well, despite the wall of text, this really wasn't that hard.
@RubenVerg A purer form would just take Dyalog Date Numbers (or any other days-since-epoch format) as arguments.
 
1:26 PM
yeah, that's what I was thinking too
 
Heh, wouldn't it be nice if we had Under and it knew that ¯1⎕DT was the inverse of 1⎕DT?
3↑(⊢+322 379.5 462⌊.|-)⍢(1⎕dt⊂)
 
I thought so too
 
Oh well, two more to go. See you next week for 2023-9: Flipping Pairs!
 
See you all next week!
 

« first day (2585 days earlier)      last day (64 days later) »