that's all the Holy Lord Attila said as he gestured to the Heavens?
a
;P
I thought he would have said something to the effect of "Oh Lord, bless this thy APL grenade, that with it thou mayest blow thine code to tiny bits, in thy mercy."
Cuz APL makes code tiny... so it's like a code grenade?
Lord @AttilaVrabecz, or is it @ila doesn't find this humrus.
i've been just reading the transcripts from earlier
think i even said before that i don't subscribe to this whole q gods/mortals thing k/q is quite monotheistic - so far everything points to only having one Lord Arthur :)
@Adám well, half-way there. i've been reluctant to link with libm as that would bloat the binary, but ultimately i may have to. i also need to settle on a simple way to print floats, preferably without loss of information
Also, the actual file looks like it'll always return the square root, (since it does ⍺←2 before anything else) but I'm not entirely familiar with how APL deals with ⍵← and ⍺←, so it might just be my interpretation that's weird
@J.Sallé @Quintec A line beginning with ⍺← only gets executed if the fn is called monadically. ⍺←expression is basically shorthand for 0=⎕NC'⍺':expression ∇ ⍵
@J.Sallé It actually says (square) root to indicate that square is the default. Also, 0≠⎕NS'⍺':⍵*÷⍺ isn't right. ⎕NS makes a NameSpace. ⎕NC is Name Class of.
@nathanrogers Remember that APL started off as a better mathematical notation. That is a language to communicate ideas. It excels at describing algorithms. In fact, APL was first used internally by IBM to completely describe their new System/360. Anecdotally, APL was later implemented in 360 assembly, which became known as APL\360. (Does this contradict Gödel?)
those probably aren't exactly the triangles I want, I have a list of numbers and I want to make a triangle with 1 additional number per row starting at 1
@nathanrogers It solves a quadratic equation to get the inverse of the triangular number (the number of elements), then uses that to create a triangle of appropriate size, then populates the triangle with the data.
I see the sqrt of something in there, but I don't know why the constants, then the ¯1+? that's wierd, then half that, reshape with some arguments or another, and then you do the same listing that you did before
I need the result to modify the result of the next pair :(
This is my problem with APL is I can solve like-kind problems, but when I'm confronted with an interesting problem that I'd like to solve, I've solved in another language, but I can't figure out an idiomatic way to solve it in APL
:(
looking for largest descending path in the triangle
@nathanrogers My father taught me to approach problems top-down: Describe in English what you want. Then define in English what those terms mean. Then define those. Repeat until using basic concepts which have APL primitives.
And we can't decide until we've tried them all, because maybe it looks great staying left in beginning, but it causes us to loose some large numbers on the right further down.
For what it's worth, Adám's solution is much slower than it need be for the problem I think you were describing. The algorithm I believe you described is much faster, and also simple. For example, Adám's can't solve projecteuler.net/problem=67
@nathanrogers f-reduction of A is basically A[1] f A[2]f A[3] f … f A[≢A]
@nathanrogers That sounds like iteration. Look into ⍣
@nathanrogers Btw, you can use reductions like that. ngn tends to do so, and I've picked it it up from him. You just have to remember the definition of reduction, so you get order of execution right.
thats wonderful. forgive my frustration, but basically the only thing I contributed was the initial flawed idea about the greatest of the sum of an adjusted row