« first day (1711 days earlier)      last day (936 days later) » 

4:38 AM
@rabbitgrowth i think if IO is 0 it can be shorter
ah wait no
well it makes it 2 bytes longer
 
4:57 AM
Yeah
Feels a bit like cheating sometimes choosing whichever ⎕IO leads to shorter code
 
 
1 hour later…
6:26 AM
0
A: Draw a hollow square of # with given width

Sohang ChopraDyalog APL, 31 29 bytes Takes number of lines as input from user, prints hollow square ∘.{' #'[1+∨/(∊∘1 n)¨⍺ ⍵]}⍨⍳n←⎕ Output (for user input 10) ########## # # # # # # # # # # # # # # # # ##########

I recently answered the above Code Golf question (to print a hollow square, user input is number of lines) with this code ∘.{' #'[1+∨/(∊∘1 n)¨⍺ ⍵]}⍨⍳n←⎕
Any suggestions for improvement / character reduction?
 
 
2 hours later…
8:13 AM
Update : I simplified the above code using the Over operator (⍥). Here is the new code :
{' #'[1+∘.∨⍥(∊∘1 ⍵)⍨⍳⍵]}
for hollow square (function)
 
 
5 hours later…
12:53 PM
@SohangChopra you can bring the (∊∘1 ⍵) out of the - {' #'[1+∘.∨⍨(∊∘1 ⍵)⍳⍵]}5
 
1:48 PM
'# '[×∘.⌊⍨⍤⌊∘⌽⍨⍳⎕] (⎕IO←0)
 
@dzaima ← that as '# '[∘.∨⍨1⍵∊⍨⍳⎕] beats that
 
that doesn't work you still have a ⍵ in there
 
@dzaima at risk of going off topic, what's a good bqn solution look like for this?
 
@chrispsn {" #"⊏˜0=⌊⌜˜⌽⊸⌊↕𝕩} is okay-ish
{" #"⊏˜∧⌜˜⌽⊸∧0=↕𝕩} is better
 
 
5 hours later…
7:24 PM
@rabbitgrowth Quite often. Btw, @dzaima the tacit ⎕←(∘.∨⍨⍳∊1∘,)5 works
 
@Adám
1 1 1 1 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 1 1 1 1
 
@rabbitgrowth It is technically possible, but you shouldn't do it: {⍵,{⍵,1(86⌶)'⍵'}'i'}'o' gives 'oio' (but is prohibited on TryAPL).
 
 
3 hours later…
10:40 PM
{a←1⋄{a←2⋄{1(86⌶)'1(86⌶)a'}⍬}⍬}⍬ how come this doesn't work
it should do
 
86⌶ is probably implemented in a (hacky?) way that doesn't allow nesting such calls.
 
:(
 
It was only added to allow things like ]disp sniff at their caller's stack frame, not as a general-purpose mechanism.
 
Ah nvm it does work, I just needed to do ''a''
 
Oh, of course, as it is a form of
 
10:52 PM
yep
that's quite a cool feature
 
Please don't use it.
 
{{a←1⋄1(86⌶)'¯1(86⌶)''a'''}⍬}⍬ aw it doesn't work with negative left arguments
now that would be fun
 
I think there was a while when GNU APL had ⍺⍺ and ⍵⍵ mean the caller's arguments etc.
 
and completely pointless probably... but still fun
 
@rak1507 What would that mean?
@rak1507 Like negative arguments for ⎕DL
 
10:55 PM
execute in the child's stack frame or something, not sure it makes sense really
@Adám yep
 
@rak1507 You mean "execute in the executor's stack frame", no?
 
something like that
actually that makes no sense at all nvm
 
> What do we want? – A time machine!
> And when do we want it? – Whenever!
 
11:21 PM
how do people get the tree display that are used in talks? aaron uses them as well
 
@nathanrogers Tediously.
@WolfgangTS Painstakingly. Dyalog APL comes with ability to make basic tree diagrams of tacit functions. Try it online! I started with that... — Adám Mar 27 '17 at 20:23
@nathanrogers I have the line drawing chars on my keyboard layout.
 

« first day (1711 days earlier)      last day (936 days later) »