« first day (822 days earlier)      last day (1822 days later) » 

3:56 AM
The programming language APL is distinctive in being symbolic rather than lexical: its primitives are denoted by symbols, not words. These symbols were originally devised as a mathematical notation to describe algorithms. APL programmers often assign informal names when discussing functions and operators (for example, product for ×/) but the core functions and operators provided by the language are denoted by non-textual symbols. == Monadic and dyadic functions == Most symbols denote functions or operators. A monadic function takes as its argument the result of evaluating everything to its right...
the Wikipedia example for showing Pascal's Triangle in APL is 25 character function, 5 are "each", and it doesn't draw Pascal's Triangle
:|
it's missing all the 1s down the right hand edge
 
@TessellatingHeckler βŽ•io←0
 
@H.PWiz πŸ‘ that does draw OK now. I wonder why the Wikipedia example output is wrong, if the person developed it with quad IO 0
@H.PWiz did you see something specific to say that, or was it a general thing to try because it's a common flaw for one thing being missing, a general off-by-one fix?
 
No, just guessed. I wrote that before looking at the code
 
 
1 hour later…
5:07 AM
hmm; this was the original code
{0~¨β¨aβŒ½βŠƒβŒ½βˆŠ¨0,¨¨a∘!¨a←⌽⍳⍡}
I took it apart and understand mostly the transforms that are happening, but not how anyone came up with them to know that they would produce Pascal's Triangle.
I wanted to rebuild it without "each", and came up with this:
βŽ•←{ 0~⍨¨a⌽T×(⍴T)⍴0 1 ⊣T←2/βŠ–β‰a∘.!a←⌽⍳⍡} 5 βŠ£βŽ•IO←0
 
@TessellatingHeckler
β”Œβ”¬β”€β”¬β”€β”¬β”€β”¬β”€β”¬β”€β”¬β”€β”¬β”€β”¬β”€β”¬β”€β”
β”‚β”‚ β”‚ β”‚ β”‚ β”‚1β”‚ β”‚ β”‚ β”‚ β”‚
β”œβ”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”€
β”‚β”‚ β”‚ β”‚ β”‚1β”‚ β”‚1β”‚ β”‚ β”‚ β”‚
β”œβ”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”€
β”‚β”‚ β”‚ β”‚1β”‚ β”‚2β”‚ β”‚1β”‚ β”‚ β”‚
β”œβ”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”€
β”‚β”‚ β”‚1β”‚ β”‚3β”‚ β”‚3β”‚ β”‚1β”‚ β”‚
β”œβ”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”Όβ”€β”€
β”‚β”‚1β”‚ β”‚4β”‚ β”‚6β”‚ β”‚4β”‚ β”‚1β”‚
β””β”΄β”€β”΄β”€β”΄β”€β”΄β”€β”΄β”€β”΄β”€β”΄β”€β”΄β”€β”΄β”€β”˜
 
it's barely faster, as well as needing a temporary variable, and I can't work out how to get rid of the "each" on the far left; but I'm pretty happy, except with the fact that it's still working by magic
 
 
4 hours later…
8:59 AM
{ 0~⍨¨ a⌽(0 1⍴⍨2×⍡)\ βŠ–β‰a∘.!a←⌽⍳⍡} 5
Expand! no temporary variable, feels a bit cleaner
 
 
4 hours later…
ngn
1:12 PM
@TessellatingHeckler if this is for golfing: (0 1⍴⍨2×⍡)\ -> βͺ↑¯2↑¨ or βͺ¯2↑⍀0
 
 
8 hours later…
9:24 PM
@H.PWiz Thanks, reported to relevant party.
 

« first day (822 days earlier)      last day (1822 days later) »