« first day (2116 days earlier)      last day (545 days later) » 

5:16 AM
@Jeremygee Amazing. I've edited a bit to conform better to wiki standards, but you've done a great job. One hint for next time: There's a "Preview" button you can use instead of committing your change.
 
 
1 hour later…
6:45 AM
@Adám (⌽(=⍥≢∘⊃)⊢) I know I can use fewer parens, but why doesn't this work?
I want to know when the count of the pick of reverse = count of the first
I thought this would do that
(⌽=⍥(≢⊃)⊢) is ok, because ≢⊃ is an atop but ≢⍤⊃ didn't work
and I'd like to use it is right operand to ⍣ but ⍣ is dyadic...
binding is from left to right, so its trying to bind (=⍥≢... before ...≢⍤⊃)?
 
Yes.
⌽=⍥≢⍥⊃⊢ should work.
 
confirmed it does work
 
Also =⍥≢⍥⊃∘⌽⍨ if you want to avoid a train.
 
7:04 AM
I don't get it, it looks to me like its doing pick of reverse on left and right arguments?
oh
 
Left-to-right, my friend, left-to-right.
 
so =⍥≢⍥⊃ is one function
 
The whole thing is one derived function, but yes, that's a "sub-function".
 
so when you say f∘⌽⍨ its (⍵f⌽⍵)
 
Correct.
 
7:08 AM
neat
=⍥≢⍥⊃∘⌽⍨⍤⊣ for right operand to ⍣
clunky
{(≢⊃⌽⍺)=≢⊃⍺} is fewer characters :(
 
@nathanrogers Shouldn't that be (=⍥≢⍥⊃∘⌽⍨⊣) ?
 
yes I had one too many ⌽
 
Then the tacit one is shortest.
Wouldn't it be nice if monadic was "last" so you could write ⊃=⍥≢⊇ ?
 
2017 has my favorite problems so far
except day 9. Don't have an array centric approach for that one
 
Maybe add an entry at apl.wiki/Advent_of_Code?
 
7:25 AM
@Adám done
 
7:35 AM
There seems to be a rather uniform style in other submissions
I'm not sure how I would describe it. Direct, procedural, linear flow of execution. I seem to grab for function definition and composition over single line primitive composition like everyone else.
this is a pretty good example of how the preponderance of solutions are implemented
I don't know that I even understand the structure. So if someone were to ]link these directories, the code would simply be executed? or do they define tradfns? I'm not certain
although my tendency to reach for functions and composition could very well have been a side-effect of the architectural decision to make the solutions testable, thus making them functions which all universally return a length 2 array of solutions for (part1, part2) process ⍵ where ⍵ is the lines from the input file
 
@nathanrogers They are probably just dumps of code, but the new shell script support can run such things.
 
 
4 hours later…
11:31 AM
@nathanrogers iirc jayfoad tries for leaderboard positions so he's focusing on trying to get the answer fast rather than make it 'testable' or whatever
@nathanrogers imo it seems more of a consequence of your lisp-y style, no reason more 'direct' solutions couldn't be testable
 
 
1 hour later…
1:00 PM
Welcome to APL Quest 2017-1! Today's quest is What an Odd Bunch:
> Write a function that will return the first n odd natural numbers.
This is another simple one, but I have some twists we can add.
 
{1-⍨2×⍳⍵}
yes please
 
That's perfect. Now, first thing is to make that tacit. Should be straight-forward.
 
¯1+2×⍳
 
Yup, that works.
Now, two twists:
∘ Can you shorten it by a character?
∘ Can you make it palindromic?
 
ooo
 
1:03 PM
And a hint: Try to shorten it first; that'll lead you on to a palindromic solution (of the same shortened length!)
 
no, not yet... Using ⍳, probably in the middle then
 
OK, here's another twist:
∘ Remove all constants
 
does ⍳+¯1+⍳ count?
 
No, but very very close.
 
⎕io for 1
 
1:07 PM
Aha
⍳-1-⍳
 
:O
 
That's bingo for the shorter and the palindrome. Now remove the constant.
 
wow!!!
 
Nice spot Brian
@Adám ⍳-×-⍳
 
⍳-≢-⍳
 
1:08 PM
There we have it, folks!
Those were the exact two I had in mind.
 
@awagga :D
 
Beautiful, ain't it?
 
yes!!
 
yesss! that was pretty eventful for such a simple question
 
And without ⍳?
I tried something with ⍣
 
1:10 PM
Now, how might you change a single character and get the even numbers instead? (Don't introduce any constants!)
@Richard +⍀
Iota←+\⊢⍴×
 
@Richard ¯1+2×+\⍤×⍤⍴⍨
 
:)
 
⎕← (+\≢,⊢⍴≢+≢) 5
 
@Adám 1 3 5 7 9 11
 
ooO
 
1:13 PM
⎕← (⍸2∘×⍴1 0⍨) 5
 
@Adám 1 3 5 7 9
 
@TryAPL Oops, I have one too many numbers.
+\-⍤≢+⊢⍴≢+≢ will fix the issue.
Anyone for the one-character transformation of ⍳-×-⍳ or ⍳-≢-⍳ to make even numbers, while staying palindromic (meaning you have to change the × or ) and not introducing any constants?
 
Closest I got was ⌈⍳-÷-⍳
 
⍳-≡-⍳?
 
Indeed.
 
1:16 PM
Aha
 
how nice
 
How about changing to an operator?
 
⍳-∘-⍳
 
That's it!
Should we stop here or do you want more extended challenges?
 
This is really beautifull Adam
 
1:19 PM
:-)
 
apl ≡ art
 
See you next week for 2017-2: Good Evening!
 
 
1 hour later…
2:56 PM
@Adám No problem happy to help.
 
 
1 hour later…
4:00 PM
@rak1507 That's something I hadn't considered. Speed to solution would lead to a much more direct, and probably idiomatic APL solution
@rak1507 I didn't mean to suggest one is more testable than another. What I meant was that if I start from the position of "what is the interface for testing the solutions" you'll end up in a different place than had you started from the mindset of "2015 day 1 part 1" and just writing the solutions directly
Or put simply, if you start from different places, you'll probably end up with different results
I'm interested in understanding and learning the other places people start so I can understand different tools for solving problems in APL, especially because I do come from Lisp and FP first, and so you're right, my solutions do tend to reflect that
 
4:53 PM
is there a shorter way to sort the vectors in a vector by the first vector? {⍺[⍋⍺](⍵[⍋⍺])}/ seems waay too long
e.x. |304761│9 3 3 6 7 27| -> │013467|3 27 9 3 7 6│
 
5:15 PM
{(⊂⊂⍋⊃⍵)⌷¨⍵} is an option
 
hmm, i was thinking of a similar one but couldnt realize it
oooh, i see, a double enclosure
 
5:40 PM
@nathanrogers yeah fair enough
 

« first day (2116 days earlier)      last day (545 days later) »