« first day (1342 days earlier)      last day (1329 days later) » 

4:11 AM
@EliasMårtenson in k, (a;b;c) is syntax to make a list with elements a, b, and c. To call a function with multiple arguments, you simply say f[a;b;c]. Which is a pretty neat unification
 
 
4 hours later…
7:57 AM
Just saw this thing, codegolf.meta.stackexchange.com/questions/5243/…, are any of my answers eligible?
 
I was gonna say that in a comment.
 
Your comment is what showed me
 
yes many of yours are
so long as it's the first answer, yes.
go on and edit the post to add your answer.
this one isn't eligible because there's already an APL NARS answer for example.
most of the time it is 100. if you win the challenge, it is 200
also, if you are new, it's 200 i think.
 
Alright cool
 
8:21 AM
It's a shame that new questions are posted so infrequently
 
questions have to be before 2020 to be eligible.
 
Yeah but I don't really care about the rep, I just want some more fun questions to answer
 
use bubbler's SEDE quesry if you want challenges to answer.
there's a pretty good amount unanswered in APL.
 
Oh do you have a link to that?
 
it's on the bounty page
 
8:30 AM
cool thanks
 
Note that my SEDE query aims for 200/400s (winning the challenge is quite probable).
Maybe I should make another version to include 100s
 
codegolf.stackexchange.com/questions/109248/… ding this challenge, is there a way to golf {⍎('0~'⎕R'!0')⍣≡('!'⎕R'~')('1'⎕R'0!')⍵}?
Aside from using ⍞
Pretty bad solution with the repeated regexing but ⍣≡ is always fun
Down to two regexes, hmm
⍎⌽('!(\d.*)'⎕R'\1~')⍣≡⍞
0
A: Mathematics is fact. Programming is not

rak1507APL (Dyalog Extended), 23 bytes ⍎⌽('!(\d.*)'⎕R'\1~')⍣≡⍞ Repeatedly shift any !s to the right with the fixpoint ⍣≡ !!!!0! -> !!!0!~ -> !!0!~~ -> !0!~~~ -> 0!~~~~ Then reverse with ⌽, and execute with ⍎ Try it online!

 
9:03 AM
hmm, interesting.
 
9:59 AM
0
A: A naturally occurring prime generator

rak1507APL (Dyalog Extended), 48 bytes {l←⍵⋄{l≡≢(r←1~⍨2-⍨/⍵):r⋄∇⍵,(+/(0,1+≢)∨1↑⌽)⍵}7 8} Try it online!

Can anyone golf this any more?
 
10:18 AM
Does anyone know of an APL dialect with an easy way of doing prime factorisation?
NARS2000 has π but it's not on TIO :(
 
10:34 AM
@rak1507 Extended
 
Ah that's brilliant thank you
 
10:59 AM
codegolf.stackexchange.com/a/211731/95516 managed to knock a whole 18 characters off!
 
 
1 hour later…
12:25 PM
@rak1507 ok, if you need to answer in NARS, just do it without tio.
since it has a freely available interpreter it's all good.
but honestly, the features in Dyalog APL and dzaima's dialect are more than enough for golfing.
 
12:46 PM
Yeah dyalog extended has everything I would need (and more!)
 
Purely code golf wise, NARS is not a good choice (except when you need a very specific builtin) because of its source code encoding UCS-2
which means 2 bytes per character no matter what
 
1:33 PM
That's frustrating, does dzaima/APL not have ⎕R?
 
1:57 PM
How come this isn't working on TIO? It works locally
 
2:41 PM
@rak1507 Some built-ins are overridden to behave differently in Extended, so if it works locally you should just use Unicode (not extended)
though I don't immediately see what the problem is
Looks like updates to n are not visible to the outer dfn... I didn't notice because I rarely ever use modified assignment in APL golf
Also, if you want to get the most out of Extended, you should master
 
3:07 PM
@Adám Is ^^ a known issue?
 
I rarely use assignment, it was just a hack to get the iteration length (going to try and switch to dzaima)
 
For that I suggest to try out ⌂traj
 
4:12 PM
Is ⍸ changed in dzaima/APL?
Ah, indexing is
SyntaxError: Expected function, got [1 2 4 7 8 10]
⎕←{⍵[⍸2=/⍵]}0 0 0 1 1 0 3 3 3 2 2
¯¯¯¯¯¯¯
⎕←{⍵[⍸2=/⍵]}0 0 0 1 1 0 3 3 3 2 2



SyntaxError: brackets contained a function
⎕←{⍵[{⍸2=/⍵}]}0 0 0 1 1 0 3 3 3 2 2
what do you want from me dzaima/APL!!!
 
@rak1507 that's TIO being outdated. {⍵[⍸2=/⍵]} works locally
 
is there another dzaima/APL repl I can try
 
you can use {⍵⊇⍨⍸2=/⍵} in TIO (and in general, anything about [] is poorly implemented)
@rak1507 no other ones online, but using locally is simple (on linux, and probably on WSL too, assuming java 11+ is installed)
 
Slight issue that I don't have an APL keyboard on my linux VM but oh well copy paste will have to do
 
@rak1507 if that linux vm uses X11, setxkbmap -layout au,apl -variant '' -option -option 'compose:rwin,grp:switch' for right-alt input
(feel free to ignore that compose:rwin, that's a leftover from copying what i use, it sets the XCompose key)
@dzaima (and, assuming python is there too, java 8 works though convert.py in app/ in place of ./build)
 
4:22 PM
could have mentioned that before I started installing java 11! Oh well lol
 
:p
 
well idk what on earth rlwrap is but I guess I'm installing that too
 
@rak1507 it's what makes you able to use left/right arrow keys to move around in the REPL (obviously, among other things)
 
Ah cool, all working now, that's great ty
 
:D
 
4:26 PM
NegativeArraySizeException lol
 
@rak1507 yeah i didn't do a particularly good job of checking things that java checks for me
but, as the up-side, ,10+¯2 ¯2⍴⍳4 works :p
 
4:40 PM
@rak1507 (for reference, what gave that?)
@dzaima (not that i'll fix it, but i'd at least add it to my 72-item TODO list)
 
Oh it was just me being dumb dw
 
4:58 PM
@dzaima dzaima/APL is so cool I love it
 
:D
 
@Bubbler for your challenge (codegolf.stackexchange.com/questions/205336/…) does it matter if it errors for 1 element + empty?
 
@dzaima If you find the index range ahead of time with min/max, Java might be able to vectorize that part and you can use special code if there are no negative indices.
Just compared the self-hosted compiler against in dzaima/BQN on the compiler source (wrapped in {𝕩⋄…} so nothing actually executes) and it's only a factor of 3-4 difference now.
 
@Marshall :o
(my compiler uses linked lists and multiple temporary objects per token, but then again my runtime could be sped up multiple times in a language more suitable for it)
 
Hmm should I wait for bubbler to tell me I suck or just go for it
 
5:09 PM
@rak1507 That second one sounds pretty good.
 
0
A: Cut resistance of a list

rak1507[APL (dzaima/APL)], 23 bytes {1-⍨≢{⍵[⍸2=/⍵]}⍡{⍵≡⍬}⍵} Doesn't work on TIO :(

 
@Marshall i somewhat doubt it'd be able to utilize the calculated min/max, but maybe res[i] = xi[Math.max(0, Math.min(c, xi.length))]; would be an improvement anyways; i'll test later
@rak1507 {1-⍨≢{⍵⊇⍨⍸2=/⍵}⍡{⍵≡⍬}⍵} seems to output things in TIO
 
@dzaima I meant get the max and min of all indices before indexing, so you don't have to check each index during the loop.
 
@Marshall ah, you mean to just not have the inner ifs. that makes more sense
 
Ah yeah thanks @dzaima :)
 
5:15 PM
@rak1507 you can convert the outer dfn to a train for -2 bytes
 
@dzaima I guess Java will still do its own bounds checking on x[c], but unless it knows how to merge those with your checks that cost is the same either way.
 
@dzaima I tried but failed
 
@rak1507 leftArg dyadicFn monadicFn rightArgdyadicFn∘monadicFn
 
Ah yeah nice
 
5:34 PM
@rak1507 1-⍨∘≢≢1↓
 
Oh yeah of course
 
 
3 hours later…
8:41 PM
@Bubbler Yes, assignments can clash, because n+←1 becomes n plus+←1. I should maybe make extended insert ∘⊢ to the right of all names. That'll also fix the 1+n←2 becoming 1 plus n←2 issue.
 

« first day (1342 days earlier)      last day (1329 days later) »