« first day (1040 days earlier)      last day (1911 days later) » 

08:21
How do you write the sum of "repeated applications of f over a range"? Like, f⍣⍳Ms⊢Av?
08:48
2
Q: Repeated function application in APL

August KarlstromGiven the integers p, q and n I would like to generate a vector of length n with the elements (⌊p ÷ q) (⌊(⌊p ÷ q) ÷ q) ... In other words I want to construct a vector where the i:th element is {⌊⍵ ÷ q} applied i times on p. How can I do that in APL?

XD thanks
Turns out I didn't need it, but the reason why would involve me spoiling Advent of Code, so I shall refrain from explaining for the time being
 
2 hours later…
10:21
haha, I've been doing Advent of Code in APL too
it took me ~4 minutes in PowerShell and ~2 hours in APL by being stuck on the loop
(and now it's led me to a possible display bug in the way Dyalog shows a function)
I'm planning on recording AoC solutions this year if you all want to watch me suffer :) youtube.com/…
@voidhawk I'm sure I saw you post an APL solution in the megathread while I was clicking away, and when I went back to read it, I couldn't find it
what happened?
I had issues with the formatting, for some reason my code block was all getting concatenated on one line
Figured it out and reposted though
ah, cool
@Adám not sure if trivial display bug, but here's a how-to-repro if interested paste.fedoraproject.org/paste/9IaJjVMNYUuU0cIA3RGMFA
ah you went for a similar part 1 to me, and a totally different, shorter, tidier looking part 2
10:40
Well the solution I got in the video for part 2 is much uglier - and of course as soon as I hit stop I figured out how to improve it :P
11:00
⎕←⌊ (-∘2 ÷∘3)
@KritixiLithos
┌─┴─┐
⌊ ┌─┴─┐
  ∘   ∘
 ┌┴┐ ┌┴┐
 - 2 ÷ 3
blimey, I've just managed to cobble together a couple of versions using the power operator
@KritixiLithos I think it needs ]box -trains= whatever the default option, not box or tree, to show without the parens
11:35
@TessellatingHeckler You're right. I'll log it, but unfortunately, the person who worked on that passed away recently.
11:51
@Adám I understand; just trying to be helpful - not meant to be a complaint or a demand
@TessellatingHeckler Oh, don't get me wrong. It certainly should be fixed, and we're grateful that you reported it, it may just take some time to be fixed. John was working on this feature when he passed away, so it has some unfinished parts. If you use ]box -t=parens (which he had implemented long time ago) it displays right.
@Adám ah yes, -t=parens does, and adds even more parens :)
12:51
(AdventOfCode spoiler) there's my power-operator rewrite reddit.com/r/adventofcode/comments/e4axxe/2019_day_1_solutions/… which took longer to get to, and isn't as nice as voidhawk's (except for avoiding ¨)
Incidentally, I'm trying to do the 2018 Advent of Code puzzles and I'm stuck on Day 1 XD. I'm just trying to paste the 951 different numbers into APL, and I keep getting input errors
I suppose I could take it in as file input
13:07
@Sherlock9 i usually do a←'' ⋄ )ed a, paste there & ⍎a
aaaaaa
13:20
here's my dzaima/APL AoC part 2 solution (both a bad version and a better one)
I want to get an array of a function f applied argument n, n times: n (f n) (f f n) ... ((f repeated n times) n). I know this is possible using the fixpoint operator ⍣, but I wish to do this using the each operator ¨ instead.
A valid solution is something like {(f⍣⍵)n}¨⍳n, but I want to rewrite this as a train. How do I do it?
@ZhengqunKoo dzaima/APL has for that
@ZhengqunKoo you aren't able to pass operator operands from trains
@voidhawk (and also everyone else using RIDE!) there's a Backward or Undo shortcut (by default set to ctrl-shift-backspace, which i've replaced with ctrl-d). It goes trough the history of entered things, making it very quick&easy to modify the previous executed thing
13:39
@dzaima i see, thanks
 
7 hours later…
20:26
@Sherlock9 I just did ,⍎¨⎕csv FILE 😇
20:37
i've now set up day ← {⍺←2019 ⋄ ≢p⊢←(method:'GET' ⋄ e:(cookie:'session=....')) ⎕lns "https://adventofcode.com/",(⍕⍺),"/day/",(⍕⍵),"/input"} for myself (not that i'll be trying to get wr times (probably, maybe))
 
3 hours later…
23:09
@Sherlock9 I cribbed from Jay Foad's Advent of Code 2018 answers here github.com/jayfoad/aoc2018apl to get ideas; might be a place to reference if you haven't seen them before.

« first day (1040 days earlier)      last day (1911 days later) »