« first day (1316 days earlier)      last day (1331 days later) » 

2:04 AM
tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/v/… why is it saying 'Boolean singleton value required'?
 
@Razetime The value used for a guard has to be a boolean singleton (a 1-element array containing 0 or 1). You probably want 0<⍵: instead of ⍵:.
 
thanks a lot
 
 
5 hours later…
ngn
7:01 AM
@cannadayr tbh i don't understand why they had to replace all of linux
 
7:28 AM
@ngn What's the alternative? Partial replacement? How'd that work?
 
ngn
@Adám keep the original problematic drivers, comply with the gpl by publishing the rest of your kernel changes (which as far as i understand consist mostly of removing code), keep the k language and apps proprietary
 
 
2 hours later…
9:13 AM
@dzaima is there a way to draw arcs in APLP5?
 
This is very annoying why does ↑ pad with 0s rather than spaces
⋄ ↑(⊂⊣∘⍕,'*'⍴⍨⊢∘≢)⌸,+/¨⍳6 6
 
my logic says that instead of spaces it has been padded with the empty string
and apl is printing them as 0's with spaces between them
maybe just remove all the zeros in the final result
 
it still adds spaces in between characters too
not sure what's going on
with -style=max they seem to have +s on the border, whatever that means
 
try ]box on
it's probably packaging each * separately
 
9:19 AM
yeah I have ]boxing on -style=max
 
ok so is the tally converted to char?
 
Ah it isn't, that's the problem
 
⋄⍪(⊂⊣∘⍕,'*'⍴⍨⊢∘≢)⌸,+/¨⍳6 6
 
Alright fixed, thanks for the help @Razetime :)
 
9:25 AM
Ended up with {↑⍕(⊂⊣,'*'⍴⍨⊢∘≢)⌸,+/¨⍳⍵}
Ah damn it, not properly formatted
 
oh, changed to dfn
I used the forbidden unary ⍪
 
I should probably do some physics just now, rather than APLing
 
that one dosn't have pormatting either lol
⋄{↑⍕(⊂⊣,'*'⍴⍨⊢∘≢)⌸,+/¨⍳⍵ ⍵}6
 
@Razetime
 2 *  3 **  4 ***  5 ****  6 *****  7 ******  8 *****  9 ****  10 ***  11 **  1
      2 *
 
need a ⍤
 
9:28 AM
now only it get it on 12 lines
{↑⍕⍤(⊂⊣,''⍴⍨⊢∘≢)⌸,+/¨⍳⍵ ⍵}6 has the same output as ⍪(⊂⊣∘⍕,''⍴⍨⊢∘≢)⌸,+/¨⍳6 6
cya anyway
have fun with physics
 
@Razetime i don't think so
 
cool, no problem
 
9:50 AM
@Razetime Notice how your *s caused italic text!
 
dyalog.com/blog/2018/09/… the fact problem 3 doesn't work with ]boxing on annoys me slightly
 
10:33 AM
@Adám oh sorry about that lmao
 
11:32 AM
@rak1507 Well, it does work, but looks different. You can always add monadic ⎕FMT to make it "work".
 
anyone here happen to know haskell? don't think there's a haskell chat room :/
 
11:56 AM
@rak1507 there was, but it's frozen
 
12:30 PM
<kritixilithos> @rak1507 i know a tiny bit, also the ppcg discord has a channel for 'of monads and men' although that is inactive as well
 
12:45 PM
@cannadayr k9 will (apparently) eventually make it to risc-v, so who knows
2
 

 Haskell (and other functional languages)

Welcome! To optimize for timely discussion, don't ask to ask, ...
 
1:22 PM
Is there a way to append (1 2 3) to (4 5 6) so you get 2 3 ⍴ 1 2 3 4 5 6? I feel like ⍪ can probably do it but I'm struggling to figure out how
 
ngn
@rak1507 you should make 1 2 3 a 2d array before you catenate 4 5 6 below it
⋄(1 3⍴1 2 3)⍪4 5 6
 
@ngn
1 2 3
4 5 6
 
Yeah, is there an easy way of doing that with variable length arrays?
 
ngn
@rak1507 you could also use "mix": ⋄↑(1 2 3)(4 5 6)
 
 @ngn
1 2 3
4 5 6
 
1:26 PM
@rak1507 also 1 2 3,[.5]4 5 6
 
⋄ 1 2 3 ,[.5] 4 5 6
 
@Bubbler
1 2 3
4 5 6
 
ngn
right, "laminate"
 
↑,⍥⊂ I guesss this works
Oh right
,[.5]
 
But: ⋄ 1 2 ,[.5] 4 5 6
 
1:27 PM
@Bubbler LENGTH ERROR
 
ngn
@rak1507 apl arrays are always rectangular (not "ragged"), so you must fill the gaps with something. if 0 is ok as a filler - "mix" () does exactly that.
 
@rak1507 So that's (↑,⍥⊂) the right way for different lengths
(Filler is 0 for numeric arrays and space for char arrays)
 
@rak1507 I like ⋄ 1 2 3 ⍉⍤,⍥⍪ 4 5 6 because it looks so cute.
 
@Adám
1 2 3
4 5 6
 
ngn
1:43 PM
i got a mysterious upvote on this 4-year-old answer and i noticed it can be shortened. mini-challenge: can anyone get to 16 bytes?
 
the question was answered 2 hours ago and then 1 hour ago, so I guess it's not mysterious
 
ngn
@mypronounismonicareinstate mystery solved :) challenge still stands
 
@mypronounismonicareinstate Welcome to the Orchard, btw. Intested in APL now?
 
2:03 PM
not really (I occasionally join this room silently, but I do not know APL)
 
@mypronounismonicareinstate We can fix that.
 
⋄ ]runtime -compare '{0}¨3 3⍴⍳9' '≠⍨3 3⍴⍳9'
 
@TessellatingHeckler VALUE ERROR
 
@TessellatingHeckler No user commands for the bot (and you can't copy in cmpx either).
 
{0}¨3 3⍴⍳9 → 3.5E¯7 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
≠⍨3 3⍴⍳9   → 4.6E¯7 | +31% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
then
I was predicting that not using a d-fn and each, and only using primitives, would be faster. And it isn't. How come?
 
ngn
2:10 PM
@TessellatingHeckler {0} is an idiom
 
@TessellatingHeckler {0}¨ is an idiom
 
ngn
even better
 
Operators have an overhead to set up.
@dzaima However:
      a←30 300⍴⍳9
      ]runtime -c {1}¨a =⍨a 1⍨¨a

  {1}¨a → 5.5E¯4 |    0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  =⍨a   → 1.2E¯7 | -100%
  1⍨¨a  → 3.7E¯7 | -100%
 
2:15 PM
set the array up first:

M←300 300⍴⍳9
]runtime -compare '{0}¨M' '≠⍨M'

{0}¨M → 4.4E¯7 | 0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
≠⍨M → 4.5E¯7 | +2% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
was trying to set up more proper tests (also with factorio not running in the background..) but seems y'all have got that covered
 
Interesting:
      a←⍳15
      ]runtime -c {2}¨a 1+=⍨a 2⍨¨a

  {2}¨a → 1.7E¯6 |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  1+=⍨a → 3.0E¯7 | -83% ⎕⎕⎕⎕⎕⎕⎕
  2⍨¨a  → 3.3E¯7 | -80% ⎕⎕⎕⎕⎕⎕⎕⎕
I think this is enough reason to allow and A⍤k
 
@dzaima +1 for mentioning factorio
 
java power... or something
what is Dyalog's IDE written in?
 
2:23 PM
@dzaima Interesting. Your array of 1s is int, right? Not bits.
@Razetime C.
 
hmm should be faster then right
 
@Razetime as a hint, a 1e100 item array would have the same performance
 
@dzaima Oh, 2⍨ not 2⍨¨
 
oh
 
@Adám eh, same thing
(≢a is 2147483647 as it's truncated to an int, not that the specific size changes anything anyways)
 
2:28 PM
@ngn Nailed it (and found a BQN bug in the process; hard refresh if it doesn't work).
 
nice pillow
 
ngn
@Marshall yes, you nailed it!
 
Are those quotes supposed to be there?
 
...but then I looked at other answers and Moris beat me to it by four years.
 
ngn
@Marshall huh! i hadn't noticed that
moris's code is exactly the same as what i had
 
2:33 PM
@Razetime In the output, yes. That's how it indicates a character array, since otherwise something like "1 2"≍"3 4" would be confusing.
 
2:45 PM
interesting
so there a command for removing those then
 
3:13 PM
@Razetime No. The formatter's not really part of the language; it's just how results are shown. In dzaima/BQN you can use •← to print a string directly, but the online version doesn't have any mechanism like that yet.
 
@Marshall in dzaima/BQN all printing/formatting is equal and all of it depends on global state (i.e. )oneline, )quote, •pp). i think having a -something for direct printing would be good
 
@dzaima •i and •o would be nice, also as inverses, so you can do F⌾•i 0 to get input, transform it, and output it.
 
@dzaima (but with that i still think •← for print-debugging (so full formatting) without need to worry about spaces (and, though unsupported currently, allowing printing functions/modifiers directly in-place) is wonderful)
 
@dzaima Wouldn't an operator that is a no-op with the side-effect of printing be better for debugging? Like {⎕←⍺⍺ ⍵} or maybe {⍺⍺ ⎕←⍵} in APL.
 
@Adám edited in a counter-argument as you posted that :p
 
3:20 PM
@dzaima True, but it is really awkward to output intermediary values while a train is running.
 
@Adám true, i've been annoyed by that. {•←𝕨𝔽𝕩} does seem useful for that
 
@chrispsn very interesting do you have any links you could send me?
 
ngn
3:33 PM
@cannadayr are you in the google group? have you tried k9?
 
@ngn i am not and have not.
 
ngn
3:53 PM
@cannadayr see the links at the top of shakti.com
 
4:37 PM
@cannadayr In general, you can find links about APL-related subjects on aplwiki.com
 
5:04 PM
damn the fact the winner didn't know any APL before and was able to win shows some serious dedication, I assumed everyone who got prizes would've been APLing for years
 
@rak1507 I don't think I'd have a chance in the competition, and I've been doing APL for over 3 decades.
 
Interesting, what do you think makes people likely to do well in it if not experience?
 
ngn
people with decades of experience tend not to be students :D
 
I forgot it was a student competition, fair enough, I guess doing CS at uni or something helps
 
@rak1507 No, that'll probably lessen your chances.
 
5:13 PM
It'd probably help more than doing any other subject though
 
@ngn When I has 2 decades of APL experience, I was still a student :-)
2
@rak1507 Mathematical inclination, I'd say, and attention to detail.
 
5:38 PM
Fair enough
 
@ngn could win the professional prize if he wanted to.
 
@Adám - As far as I am concerned, when it comes to programming languages, regardless of how many years of using the language I have, I am always and forever a student... :)
 
@JeffZeitlin Regarding the language, sure, but I was actually in a school.
 
@Adám - OK... but then, there's always SHK... the School of Hard Knocks... :)
 
6:01 PM
@rak1507 also, 3/4 of the winners mentioned ppcg, woot
 
6:12 PM
~~what is ppcg~~
 
<kritixilithos> =programming puzzles and code golf, a former name for this site
 
Oh cool
@Adám in your bounty thing, what's the reason for 'The challenge was posted before 2020'?
 
@rak1507 New challenges get more attention anyway and I didn't want to simply reward all new APL answers, but rather try to get APL to "catch up" on older ones. It has the additional benefit for the site as a whole, to get some focus on older challenges with untapped potential.
 
Fair enough!
 
6:44 PM
Can anyone find a golfier way to do:
⋄ ↓⍉2(⊥⍣¯1)1 2 4 8 7 14
 
@rak1507 DOMAIN ERROR
 
oh ffs
↓⍉2(⊥⍣¯1)1 2 4 8 7 14
┌───────┬───────┬───────┬───────┬───────┬───────┐
│0 0 0 1│0 0 1 0│0 1 0 0│1 0 0 0│0 1 1 1│1 1 1 0│
└───────┴───────┴───────┴───────┴───────┴───────┘
formatting is butchered but you get the idea
 
@rak1507 (⊥⍣¯1)⊥⍣¯1⊢
@rak1507 Ctrl+K!
 
I did ctrl K
Maybe I didn't do it correctly
 
ngn
@rak1507 1 2 4 8 7 14 -> ⎕a⍳'BCEIHO'
 
6:47 PM
'ABDHGN' if ⎕IO←1
 
clever, thanks
Tbh I don't think this is where the byte saving will be important
 
Same length but simpler: ⋄ (4⍴2)∘⊥¨⎕A⍳'ABDHGN'
 
ngn
@Adám delenda est
 
@Adám 15 30 60 120 105 210
 
Meh, I mean ⋄ (4⍴2)∘⊤¨⎕A⍳'ABDHGN'
 
6:48 PM
@Adám 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 1 1 1 1 1 1 0
 
nice
 
ngn
⋄2⊥⍣¯1⊢5 11 19 34
 
@ngn DOMAIN ERROR
 
@ngn bot is paranoid.
 
ngn
⋄↓2⊥⍣¯1⊢5 11 19 34
 
6:51 PM
@ngn DOMAIN ERROR
 
ngn
@Adám what is it afraid of?
 
How can I flatten a vector of vectors?
 
ngn
@rak1507 ∊
 
⋄10|(↓⍉2⊥⍣¯1⊢⎕A⍳'ABDHGN')(-,⍥⊂+)¨⍨⊂4 5 6 7
 
@rak1507 DOMAIN ERROR
 
6:52 PM
∊ flattens it all
 
@rak1507 ⊃,/
 
Thanks!
great now I need to apply this function recursively, time to kill my PC
 
@rak1507 Pro-tip for when nobody is around: APLcart.
 
Ah yeah
 
@rak1507 Why kill your PC? If you forget a stop condition, you can always interrupt.
@ngn Tight loops that cannot be interrupted with a weak interrupt, and bugs in the inverse code that crash the interpreter.
I've since improved the bot's code, but it hasn't been updated yet.
 
ngn
6:56 PM
@Adám this message seems to contradict your previous message :)
 
@ngn I know it seems that way, but a user can issue strong interrupts while an APL green thread can only issue weak interrupts to kill its fellow green thread without killing itself.
 
ngn
@Adám green threads are very ethical
 
hmm currently this algorithm that I'm writing would potentially need a a vector of 12^12 other vectors
 
ngn
@rak1507 what are you solving?
 
codegolf.stackexchange.com/questions/69187/… but please don't beat me to it <3
I think I'll go in reverse order
 
ngn
7:08 PM
@rak1507 i don't care much about rep
 
My current thoughts are a function that takes something like (0 0 0 0)(0 0 0 1)(0 0 0 2)... the current paths and returns all new possible paths from that
And then use the power operator or something to apply it to 0 0 0 0 15 times or however many it takes to generate all 10000
 
ngn
@rak1507 for the thing we golfed, shouldn't you include 4-vectors with 2 consecutive 1s too?
 
And then some sort of search and just print it out
 
@ngn I think you have a pretty good reputation already
 
@ngn good point, up to 3 didn't see that
only 3 more characters
 
ngn
7:15 PM
⋄⎕io←1⋄↓↑∪,(-⍳4)∘.↑,\3⍴1
 
@ngn
 1 0 0 0  0 1 0 0  1 1 0 0  0 0 1 0  0 1 1 0  1 1 1 0  0 0 0 1  0 0 1 1  0 1 1
      1
 
⋄↓⍉2⊥⍣¯1⊢⎕A⍳'ABCDFGHLN'
 
@rak1507 DOMAIN ERROR
 
one byte less
 
ngn
@rak1507 usually ⎕io← isn't counted
 
7:18 PM
ah
fair enough
Got any bright ideas for the main meat of the program?
 
ngn
@rak1507 not yet
 
ngn
8:18 PM
@rak1507 i have an idea now
 
oh cool
 
ngn
compute the matrix of neighbours - 0000..9999 along the first axis and what we golfed before (with their negatives too) along the second axis
then compute the distances from 0000 to each of 0000..9999
 
The distances don't matter, all that matters is the sequence right?
 
ngn
then use recursion or maybe ⍣ to recover the path from the input to 0000
 
Ah fair enough
 
ngn
8:20 PM
@rak1507 yeah, it's just an intermediate step
 
sounds pretty tough
(-,⍥⊂+)
I was using this for plus or minus
 
ngn
@rak1507 not trivial, but i guess it should be doable in <100 bytes
 
Yeah
 
ngn
8:33 PM
⋄⎕io←0⋄x←9871⋄ m←10⊥¨10|(,⍳4⍴10)∘.+,∘-⍨↓↑∪,(-1+⍳4)∘.↑,\3⍴1⋄t←{⍵⌊1+⌊/⍵[m]}⍣≡0,⍴⍨9999⋄1↓¨⍕¨1e4+1↓{×⍵:⍵,∇a[⊃⍋t[a←⍵⌷m]]⋄0}x
 
@ngn 9881 9991 0001 0000
 
ngn
x input, m matrix of neighbours, t distances
 
9:28 PM
(ignore the crap code) tio.run/##SyzI0U2pTMzJT///… why does this error?
Works fine for me :/
 
ngn
@rak1507 probably because tio uses an old version of dyalog
 
how frustrating
Ah using ∪ doesn't account for different paths to the same number
is there a way to get the elements with unique left parts?
 
ngn
@rak1507 can't we output any shortest path?
 
Yeah, as long as they're equally short, but atm I'm getting cycles, so when I go to find the path, I could find a longer one
If that makes any sense haha
 
ngn
@rak1507 what do you mean by "elements with unique left parts"?
 
9:39 PM
┌─────────────────┬─────────────────┬─────────────────┬─────────────────┬─────────────────┬─────────────────┬─────────────
│┌───────┬───────┐│┌───────┬───────┐│┌───────┬───────┐│┌───────┬───────┐│┌───────┬───────┐│┌───────┬───────┐│┌───────┬────
││0 0 0 1│0 0 0 0│││0 0 0 9│0 0 0 0│││0 0 1 0│0 0 0 0│││0 0 9 0│0 0 0 0│││0 0 1 1│0 0 0 0│││0 0 9 9│0 0 0 0│││0 1 0 0│0 0
│└───────┴───────┘│└───────┴───────┘│└───────┴───────┘│└───────┴───────┘│└───────┴───────┘│└───────┴───────┘│└───────┴────
└─────────────────┴─────────────────┴─────────────────┴─────────────────┴─────────────────┴───────────────
my stuff looks like this, where the right is what produced what's on the left
so I was thinking I'd backtrack at the end
 
ngn
@rak1507 so, group by left part, and pick one from each group?
 
yeah something like that
 
ngn
@rak1507 train: (⊃¨{⊂⊃⍵}⌸⊢)
 
amazing thanks
f⍣12 gets 10000! amazing
time to write the backtracking and then I think I'm basically done
 
10:13 PM
@rak1507 Polyfill.
 
 
1 hour later…
11:19 PM
⋄ (' '∘≠(/)⊢)'a b'
 
@TessellatingHeckler SYNTAX ERROR
 
SYNTAX ERROR is "The function does not take a left argument", but why? The tree view of the train looks like I intend, there is no left argument for my train (intentionally), there is a left argument for not-equal and it does take one
this is going to turn out to be something I've seen before, I can feel it
⋄ {(' '≠⍵)/⍵}'a b'
 
@TessellatingHeckler ab
 
perfect
⋄ ((' '≠⊢)/⊢)'a b'
 
@TessellatingHeckler 1
 
11:24 PM
broken
⋄ ((' '≠⊢)(/)⊢)'a b'
 
@TessellatingHeckler 1
 
isolate the reduce so it's compress/replicate ... still no
 
@TessellatingHeckler Slashes don't translate well to trains
You can use ⊢⍤/ though
⋄ ((' '≠⊢)⊢⍤/⊢) 'a b'
 
@Bubbler ab
 
Also (' '≠⊢) → ' '∘≠
⋄ (' '∘≠⊢⍤/⊢) 'a b'
 
11:30 PM
@Bubbler ab
 
@Bubbler But what's wrong with it when the slash is isolated inside parens to avoid it being treated as an operator?
 
@TessellatingHeckler Isolated slash alone is still a slash syntax-wise
So the previous workaround to force it to a function was (/⍨⍨)
which makes / an operand to an operator
 
:o I could have sworn I've used that before; I see it, in the -trains=tree view it's binding as an operator, the tree view doesn't look like I intend
Thank you, Bubbler
 
Btw, if the sole purpose is to remove spaces, you can just ~∘' '
⋄ (~∘' ') 'a b'
 
@Bubbler ab
 
11:37 PM
@Bubbler "without space" 😃 that's beautiful
 

« first day (1316 days earlier)      last day (1331 days later) »