« first day (770 days earlier)      last day (883 days later) » 
10:00 - 18:0018:00 - 22:00

10:46 AM
@ASCII-only Good evening. Up for more?
 
maybe
working on something else, so i won't be here 100%
 
11:02 AM
@ASCII-only Understand how 2*⍣2⍳4 parses?
 
oh, yeah
had to scroll up because i wasn't paying attention for that part :P
 
So is a dyadic operator, which takes * as left operand and 2 as right operand, leaving to be called monadically (on 4).
 
yep
 
So it is important to know what's an operator and what's a function. User defined operators are pretty rare, and the built-in ones have a certain "look" to them. Most are "dotty", .¨⍨⍤⍣⍠ or "slashy" /⌿\⍀. Three are "boxy" ⍠⌺⌸ (but is not an operator). The rest are a bit arbitrary: is easy to remember as that is TMN function composition. Remains: @⌶&
And it is of course also important to know which operators are monadic, and which are dyadic. You'll get to know them all soon enough. Don't worry.
@ASCII-only You'll increase your vocabulary as you go along. Let me know when you're ready to learn about user defined functions.
 
i think i'm ready
 
11:13 AM
@ASCII-only OK. Do you know the Greek alphabet (a little bit)?
 
yeah :P
charcoal uses the lowercase greek alphabet for variables
 
@ASCII-only Ok, so the leftmost character is ⍺ and the rightmost is ⍵, right?
 
right
 
@ASCII-only They are used for that side's argument.
And the function is enclosed in curly braces.
E.g. sqrt←{⍵*1÷2}
And root←{⍵*÷⍺}
Functions can also just be anonymous and be used inline.
 
÷⍺ = reciprocal????
 
11:17 AM
@ASCII-only yes.
 
so would ⍵*÷2 work for sqrt
 
@ASCII-only Many (but not all) built-in functions use a default left argument when called monadically. It is good practice to write your own functions like that too.
@ASCII-only Yes. I wanted you to pick that up. Nice!
In fact, you can specify a default left argument by assigning to . That statement is only evaluated if the function was called monadically. E.g. root←{⍺←2 ⋄ ⍵*÷⍺}
As you can see, multiple statements are separated by unbreakable diamonds
 
it's beginning to look like a normal language :P
 
@ASCII-only Well, you can also just use multiple lines, but that requires an editor. The REPL can't (easily) do that.
@ASCII-only I think that's basically it for a brief intro. You should be well equipped to benefit from APL cultivation now. I'm here to assist of course. Try solving something easy like testing if an argument is prime!
 
11:33 AM
oh yeah, do you count braces when counting bytes in a function
 
@ASCII-only Yes, but not the assignment to a name. However, when you gain a little familiarity with this, you should look into tacit APL. It is often much shorter, and doesn't have braces.
 
:( ]Help only works for symbol -> description
 
@ASCII-only What were you looking for?
 
any (actually, i have no idea if this is even the APL way)
oh also a list of problems + TIO link set up with header and testcases would be nice, but i guess that would be a lot of effort
 
@ASCII-only Yeah. I did fiddle with letting the bot create a footer for you:
f←{⍺+2×⍵}
 
Then you populate the Input field with statements like 2 f 3
 
11:58 AM
@ASCII-only This may be handy:
)ref
 
12:26 PM
ok, i'm here
 
The most basic form of going tacit, is by just replacing with and with . Those two "tacks" are simple functions which return the argument the finger points at. And the braces go, of course.
 
Ven
bah, I was going to use @ for that challenge. What a waste
 
This gives us ⊢⊂⍨(⍴⊣)⍴⊢↑1
But there is an important principle. The rightmost part of a tacit function must be a function, not an array.
So we have to swap the arguments of to make this work: ⊢⊂⍨(⍴⊣)⍴1↑⍨⊢
@ASCII-only And that's the answer. There's a bit more to know about tacit functions, but this conversion method often works. Go ahead and post your first APL answer!
Potential rep grab:
16
Q: Determine the Base where a Given Equation is True

erdekhayserGiven 3 integers, determine the lowest possible base for the first two integers to multiply into the third. If you think of the Answer to the Ultimate Question of Life, The Universe, and Everything, 6 * 9 == 42, is true in Base 13. The inputs can include any numbers whose digits use the characte...

 
Ven
⎕←2{⍵⊂⍨(⍴⍵)⍴⍺0}⍳9
 
@Ven
DOMAIN ERROR
 
12:32 PM
hmm. :| how to fix {⍺(⊢⊂⍨(⍴⊣)⍴1↑⍨⊢)⍵}
 
@Ven ⍺0
@ASCII-only Oh, just use f←⊢⊂⍨(⍴⊣)⍴1↑⍨⊢
f←⊢⊂⍨(⍴⊣)⍴1↑⍨⊢
 
Ven
⎕←2{⍺0}0
 
@Ven
2 0
 
oh wait
⎕←3(⊢⊂⍨(⍴⊣)⍴1↑⍨⊢)1 2 3 4 5 6 7
 
12:36 PM
@ASCII-only
┌─┬─┬─┬─┬─┬─┬─┐
│1│2│3│4│5│6│7│
└─┴─┴─┴─┴─┴─┴─┘
 
what am i doing wrong :/
 
@ASCII-only Good catch. I made a typo. Should be for the original
 
yeah, the second and third tacks appear to be wrong
 
* two typos.
@ASCII-only Sorry about that ⍨
⎕←3(⊢⊂⍨(⍴⊢)⍴1↑⍨⊣)1 2 3 4 5 6 7
 
@Adám
┌─────┬─────┬─┐
│1 2 3│4 5 6│7│
└─────┴─────┴─┘
 
Ven
12:39 PM
@Adám What's the prettiest way to start from 1 upwards? ∇?
 
how to turn boxing on in TIO btw
 
Ven
]box on doesn't work?
 
@ASCII-only You can insert (⎕NS⍬).(⎕SE.UCMD'box on -f=on -t=tree'⊣enableSALT⊣⎕CY'salt') in the header.
 
Ven
Ok, Let's try this challenge in APL :).
 
@Ven No, because TIO runs an absolutely clean system with no utilities loaded.
@ASCII-only Another option is to stick ⎕JSON on the far left of your test expressions. Try it online!
 
Ven
12:43 PM
Is there a simple way to trigger an error when a value reaches N? I'm thinking 1÷n-MAX
 
@Ven Remove the 1.
 
what language would i use
 
Ven
Thanks!
 
extended?
 
@ASCII-only Just use Unicode. Extended can save you one byte, but you can get to it when you have a bit more experience.
@Ven Why not do them all at once and select the first successful one?
 
12:45 PM
nah it's mostly because Unicode uses Unicode :P
i.e. way too many bytes
and Classic doesn't have the box display. i guess JSON works?
 
@ASCII-only I adjust the byte count to be character count and replace the word "bytes" in the code golf template with [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?")<sup>[SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set")</sup>
 
Ven
@Adám Not sure yet.
I still don't understand why ⋄ runs left-to-right but the leftmost in a defn is returned
 
@Ven It isn't the leftmost, it is the first non-assignment.
⍞←{a←1 ⋄ b←2 ⋄ 3}⍬
 
@Adám 3
 
Ven
which in my case is the error checking
 
12:49 PM
⍞←{a←1 ⋄ 2 ⋄ 3}⍬
 
@Adám 2
 
@Ven Ah, then move the error checking to the far right of the next statement and separate them by
@Ven What exactly are you checking?
 
Ven
⍞←{⍺←1⋄(a b r)←⍵⋄(a+1)∇⍵⊣÷⍺-62}6 9 42
 
@Ven But why stop? The outcome of a case with no solution≤62 is undefined. Let it spin forever!
 
@Ven
 
Ven
12:53 PM
Is spinning forever considered a value junk value? Bah!
 
@Ven Shorter, neater, no-value on fail: {⍺←1⋄⍺≤62:(a b r)←⍵⋄(a+1)∇⍵}
@Ven Also, you can start at 1 with 1∘{
 
Ven
I'm just gonna let it spin, and the timeout message will be the junk value.
⍞←(13⊥42) 42=(13⊥6)×(13⊥9)
 
@Ven 0 0
 
Ven
I don't even understand the challenge.
I suppose I need to write my own base function :).
 
:/ well that took a whie
 
1:05 PM
⎕←42=10⊥13⊥⍣¯1⊢6×9
This maybe?
 
@Sherlock9
1
 
Ven
uh-oh.
 
@Adám Hmm. I wonder if it would be helpful to beginners to have an easy way to display the AST of an expression?
 
⎕←⊢⊂⍨(⍴⊢)⍴1↑⍨⊣
 
@Adám
┌─┼─────┐
⊢ ⍨  ┌──┼───┐
┌─┘ ┌┴┐ ⍴ ┌─┼─┐
⊂   ⍴ ⊢   1 ⍨ ⊣
          ┌─┘
          ↑
SYNTAX ERROR
 
1:12 PM
@ASCII-only Like ^ (ignore the error)
 
Ven
@Sherlock9 Well, thanks. I still think it's unclear in the challenge whether it's only the 2 numbers taht need to be base-converted, or the expected result as well
 
@Ven I agree on that lack of clarity.
#tio alias command ⎕← #tio apl {0::⎕←⊃⎕DM⋄⎕←%args%⋄⍬⊤⍬}(⎕NS⍬).(⎕SE.UCMD'box on -f=on -t=tree'⊣enableSALT⊣⎕CY'salt')
 
@Adám Added alias for ⎕←
 
⎕←⊢⊂⍨(⍴⊢)⍴1↑⍨⊣
 
@Adám
┌─┼─────┐
⊢ ⍨  ┌──┼───┐
┌─┘ ┌┴┐ ⍴ ┌─┼─┐
⊂   ⍴ ⊢   1 ⍨ ⊣
          ┌─┘
          ↑
 
Ven
1:14 PM
Dyalog has :: for error recovery, aye?
pulls out his reference card
 
@Ven Yes, {errnum(s)::result on error}
 
Ven
I need to do the same thing if it's invalid or if it errors.
 
#tio alias command ⍞← #TIO do apl-dyalog {0::⎕←⊃⎕DM⋄⎕←%args%⋄⍬⊤⍬}⍬
 
@Adám Added alias for ⍞←
 
@Ven Namely return nothing?
 
Ven
1:16 PM
@Adám namely recurse into `a+1
wait, minimum base is 2, not 1. I can't error in this case.
 
#tio alias command ⋄ #TIO apl {0::⎕←⊃⎕DM⋄%args%⋄⍬⊤⍬}(⎕NS⍬).(⎕SE.UCMD'box on -f=on -t=tree'⊣enableSALT⊣⎕CY'salt')
 
@Adám Added alias for ⋄
 
Ven
I'm not sure Start Control Word should link where it links to.
Ah, I guess I'm just being confused because of the left-side panel.
 
@Ven Looks right to me. Click "Open topic with navigation" and you get a tree view of all the control structures and words on the left.
 
Ven
I seemed to remember : to short-circuit, but I can't find it anymore.
 
1:22 PM
@Ven Short circuit? You can only have one condition. There is a proposal for {cond1:cond2:res}
 
Ven
...I guess maybe recursing indefinitely isn't the best solution :).
well, I could a-62:0 to stop it
looks at shy results
⎕←(2∘{(a b r)←⍵⋄r=10⊥⍺(⊥⍣¯1)a×b:⍺⋄(⍺+1)∇⍵})6 9 42
 
@Ven
13
 
Ven
That... Seems correct.
 
@Ven Do you want golfing tips?
 
Ven
not yet :)
)bar
 
1:28 PM
lb?
 
Ven
Got it
Uh. It doesn't seem to work on TIO.
 
@Ven Link?
 
Ven
f←(2∘{(a b r)←⍵⋄r=10⊥⍺(⊥⍣¯1)a×b:⍺⋄(⍺+1)∇⍵})6 9 42
 
Ven
@Adám Here.
 
1:33 PM
@Ven You're assigning the result of the function application to f. Try it online!
 
Ven
@Adám I just wanted to get a bot-generated TIO link
If you link at my link, I'm not doing any such thing
 
@Ven Right, you're not assigning, just applying the function. Code needs explicit output ⎕←
 
Ven
I'll use your link.
With the header+footer.
 
)tio ⎕←(2∘{(a b r)←⍵⋄r=10⊥⍺(⊥⍣¯1)a×b:⍺⋄(⍺+1)∇⍵})6 9 42
 
1:35 PM
Bot uses TIO to evaluate APL that generates a link to TIO to evaluate APL…
 
Ven
⎕←2∘{⍵[3]=10⊥⍺(⊥⍣¯1)×/⍵[1 2]:⍺⋄⍵∇⍨⍺+1}
 
@Ven
 ∘
┌┴┐
2 {⍵[3]=10⊥⍺(⊥⍣¯1)×/⍵[1·2]:⍺·⋄·⍵·∇⍨⍺+1}
 
Ven
⎕←2∘{⍵[3]=10⊥⍺(⊥⍣¯1)×/⍵[1 2]:⍺⋄⍵∇⍨⍺+1}6 9 42
 
@Ven
13
 
Ven
OK, those were my ideas. Not sure now, so I'll take your tips please :).
 
1:38 PM
@Ven Swap and and use }∘2 to save the . Use 2↑⍵ instead of ⍵[1 2]. Remove parens. Use 3⊃⍵ instead of ⍵[3].
 
Ven
⎕←6 9 42({3⊃⍺=10⊥⍵(⊥⍣¯1)×/2↑⍺:⍵⋄⍺∇⍵+1}∘2)
 
@Ven
SYNTAX ERROR
 
Ven
Getting "Missing right argument" in tryAPL
 
@Ven {…}∘2 is a monadic function. Monadic functions only take a right argument.
 
Ven
oh.
So, that's how it works.
 
1:43 PM
⍞←({3⊃⍺=10⊥⍵(⊥⍣¯1)×/2↑⍺:⍵⋄⍺∇⍵+1}∘2)6 9 42
 
@Adám 13
 
@Ven Also, don't forget to remove the parens.
 
Ven
I did ;-).
 
hai
 
Ven
0
A: Determine the Base where a Given Equation is True

VenAPL (Dyalog Unicode), 61 bytes {3⊃⍺=10⊥⍵(⊥⍣¯1)×/2↑⍺:⍵⋄⍺∇⍵+1}∘2 Try it online! Thanks to Adám for the help and to Sherlock9 for base conversion.

Posted! Thank you, Adám.
 
1:45 PM
@Ven You may want to adjust your byte count. And remove the ()
 
↑0 1↓↑+.×/5/⊂2 2⍴1 1 1 0
n←↑0 1↓↑+.×/5/⊂2 2⍴1 1 1 0
n
 
@EthanSlota If you are intending to use the bot, start your message with ⎕←
 
Ven
Updated.
 
thanks
⎕←↑0 1↓↑+.×/5/⊂2 2⍴1 1 1 0
 
@EthanSlota
5
3
 
1:47 PM
@Ven 29 bytes
 
Ven
@Adám Oh, TIO wasn't taught about that. Welp. Updated.
 
@Ven Are you going to explain it so you can get 200 rep rather than 100?
 
⎕←↑0 1↓↑+.×/100/⊂2 2⍴1 1 1 0
 
@EthanSlota
3.542248482E20
2.189229958E20
 
Ven
@Adám Yes, but first I'm gonna get some work done :). Give me 15-30min
 
1:49 PM
@Ven NP, ping me on the bounty post.
 
can anybody tell me what A+ looks like?
there's a wikipedia page on it but it has nothing
and the school proxy blocks everything
 
@EthanSlota It looks a lot like APL, but is dead.
 
really?
no information on it whatsoever?
 
@EthanSlota Uh, aplusdev.org
 
Ven
1:54 PM
@Adám In any case, thanks -- this was fairly fun, and if I forget Sherlock9 basically gave me the algorithm, my solution wasn't totally awful.
 
Challenge: I've got 32 for
44
Q: Now I know my ABCs, won't you come and golf with me?

ETHproductionsWrite a program or function that outputs this exact text, case-insensitive: A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z. (Based on the alphabet song that many American kids learn to help memorize the alphabet, though edited for more compressibility.) The outpu...

 
Ven
2:31 PM
@Adám Seems like it even wins the challenge
 
@Ven Hence 200.
 
Ven
I didn't realize you'd already factored that in -- I didn't.
Sorry.
 
@Ven Bountied.
 
@Ven I don't understand how this answers the question, it can't do a a 64 for example
 
2:47 PM
0
Q: In Dyalog APL, how do I turn off auto-scaling in a Form?

SteveHIn the examples in the Dyalog chm help file on drawing simple lines in a form, I drilled down into all of the various options you can place on a Form window creation and could not find a way to turn off the auto-scaling. That is, when I resize the Form, I don't want any object drawn within it t...

 
3:05 PM
@Ven Sorry for just giving you the algorithm :S
 
@H.PWiz @Ven Yeah, you're missing 10⊥¨: {3⊃⍺=10⊥⍵⊥⍣¯1×/2↑10⊥¨⍺:⍵⋄⍺∇⍵+1}∘2 Try it online!
 
Ven
@Sherlock9 what? just?
 
Well sort of? But sorry for just giving a correct solution instead of letting you figure it out yourself
 
Ven
@Adám what's " " before the {? a jot?
@Sherlock9 no, no, I don't think the notion of "inverse" would've led me to guess that solution anyway,
 
Ahhh
 
3:10 PM
@Ven I don't understand.
 
Ven
@Adám : { what's the middle char?
 
That's not part of the program
 
@Ven Using ⊥⍣¯1 instead of to get as many digits as needed is a well-known trick.
 
He's saying, "10⊥¨ is a missing portion, here's the code: etc"
 
Ven
@Sherlock9 Ooh... Thanks.
@Adám Updated + byte count + explanation.
 
3:15 PM
@Ven Clearly, the result also needs decoding, as 36jk isn't in decimal.
@Ven Using all the test cases is a very good practice :-)
 
Ven
3:30 PM
@Adám IDK how to use TIO's test cases feature. I'll take a look at how to enable it.
 
@Ven I didn't know TIO had any such feature. I just call f on all the cases in the Input field.
 
ngn
@Adám i think it's better practice to print an easily recognizable string (like "ok") when the output matches the expected result
this was you can see at a glance if the tests passed. you don't need to compare manually against the expected values
 
@ngn I know you do that, but I find it too noisy, and I don't like the right answer appearing anywhere in the input.
 
ngn
@Adám the expected right answer is in the test itself
if a test fails, i print a list of (input; expected; actual)
@Adám if you don't have an expected value as part of the test, how can you tell if it passed or failed?
 
3:47 PM
@ngn I put the OP next to the TIO window and compare them.
 
ngn
@Adám that's a lot of manual work. i don't think many people who read your solutions would go through this
but anyway, everyone's entitled to their style of testing
 
@ngn imo an "ok" is useless and i have bad memories of miswriting that kind of testing and it returning "ok" for everything :p
 
ngn
@dzaima if your test runner can't be trusted, i don't know about the tests themselves... :)
 
also could be a problem if the output format is different than the reference in the question - reversed, ±1, enclosed, transposed, etc
 
ngn
@dzaima most challenges are not like that
for those cases normalization could be applied before comparison, or we could simply resort to manual testing
 
3:58 PM
@ngn normalization can easily go wrong, and it's standard practice on PPCG to allow different types of output, and I often switch between tradfn, ⎕←, dfn
 
ngn
@dzaima why are you focusing on the minority case? most challenges have definite expected answers
for those "ok" is not useless. it says that the test passed
 
@ngn I'm pretty sure 99% of challenges that force either a function or direct output to stdout have score below 0..
 
ngn
it does the same thing you are supposed to do manually - check whether actual output matches expected output. so why not automate it?
 
@ngn does Dyalog provide a way to redirect ⎕← or tradfn output to your own?
making a testing environment that only allows for dfns & trains limits my golfing, so i choose against it
 
@dzaima Yes.
 
4:03 PM
@Adám and how long is the code to do that?
huh, by some reason i recall ⎕←arr not passing trough ]box on
oh right that was in namespaces
(relatedly, this was my testing environment for yesterdays masked cumulative sum challenge)
 
@dzaima Do ]box on -f=on
 
ngn
@Adám i got to 33, still trying...
 
4:19 PM
@ngn no idea how many, but many challenges allow choosing ⎕IO, ascii-art may allow trailing spaces, matrices usually can be represented both as matrices & vector vectors, some allow floating-point imprecision, challenges taking a set amount of inputs may benefit from argument order - A f B, B f A, f A B, f B A. really the only things safe are challenges with a single number input & output, both being unrelated to ⎕IO
 
ngn
@dzaima even if the challenge allows flexibility, you know what choices you made in your solution, so your test needn't be all that flexible
 
@ngn I very often try different options though - it's not that easy to tell which method will be definitely the best sometimes
 
I try one, two or three tests firsts and then add more later. With a test base that small, it might be ok to print 'ok'
But also with a test base that small, I've (usually) got a good enough memory that I can just memorize the three results I'm expecting
 
Ven
⎕←({=/10⊥¨(3⊃⍺),⍵⊥⍣¯1×/2↑10⊥¨⍺:⍵⋄⍺∇⍵+1}∘2) (1 0) (1 0) 64
I thought I could save some bytes by using 10⊥¨ + , then =/, but nope
 
@Ven

Rebuilding user command cache... done



Real time: 60.003 s
User time: 0.009 s
Sys. time: 0.008 s
CPU share: 0.02 %
Exit code: 124
 
4:29 PM
@ngn you have the advantage of being ngn though, your experience may be different
 
ngn
@Sherlock9 that's cruel to those who just want to check your solution, and maybe cruel to yourself when you eventually forget about that particular challenge :)
 
Ven
I return a wrong answer for 10 10 100, too :-(.
 
@ngn most of those people wouldn't know apl and would have no idea what that 10 15⍴'correct result!' does
 
@ngn Which is why it's also good practice for the challenge writer to put test cases in their challenge and the solution poster to run the test cases in that order so they can check it :)
 
those who know APL can probably read the code
@dzaima for those people, not having the results in the code would probably make the answers way more convincing anyways
 
4:34 PM
Does production APL have a testing suite like Jest or Selenium?
 
ngn
for me it boils down to this: is there any reason for doing the actual≡expected check manually? if there is (e.g. tradfn handicaps, too flexy output fmt, etc) then fine, i have a reason not to automate
 
@Sherlock9 We don't have a standard or anything, but it is obviously good practice to have a test suite.
 
ngn
in all other cases: i trust code more than my eyes and i value my attention more than cpu time. my attention shouldn't be wasted on computing ⍺≡⍵
 
Ven
@Adám would 36jk be (3 6 19 20)?
 
@ngn yeah, it's just that i find it to not be worth it as I am gonna tradfns & ⎕← and try multiple input & output formats if applicable
 
4:38 PM
@Ven Yes:
⍞←{⎕IO←0⋄⍵⍳⍨⎕D,819⌶⎕A,⎕A}'36jk'
 
@Adám 3 6 19 20
 
Actually, that should be {⎕IO←0⋄⍵⍳⍨⎕D,(819⌶⎕A),⎕A} but doesn't matter here
 
Ven
@Adám it does matter for aA and bB though :).
 
@ngn Also I have no idea how your suggestions on my jumping numbers post work codegolf.stackexchange.com/a/180768/47581
 
Ven
There's yet again something I don't do correctly.
 
ngn
4:47 PM
@Sherlock9 you mean they don't work? or i need to explain them?
 
@ngn Pardon me. Could you explain them?
⍎¨⍕ I understand (eventually)
⎕⊢0 is confusing
And is magic
 
@Ven You're using base-10 instead of base-⍵
 
ngn
@Sherlock9 sure. 1+⍣{...}... adds 1 to the argument until the right-operand dfn returns true
the dfn is the check for a "jumping number"
 
@Ven And btw, ⍵⊥⍵⊥⍣¯1 is a no-op — quite obviously.
 
Ven
@Adám Sure ;-).
 
ngn
4:50 PM
@Sherlock9 so the whole thing so far moves on to the next jumping number. then, ⍣⍵ does that times and we get the -th jumping number
 
Ven
so, 10⊥⍵⊥⍣¯1(3⊃⍺) with a tack I suppose.
 
@ngn So ⎕ in the second one is get input and 0 is our jumping number start, and ⊢ is there because we need to start the train with a function?
 
@Ven No, why are you doing the base-10 thing?
 
Ven
I guess I can remove that from both sides
 
ngn
@Sherlock9 yes, except is there only to separate the operand from the argument
 
ngn
@Sherlock9 you know, when we have an operator like , if we write operand0⍣operand1 arg and operand1 arg1 are both arrays, they would strand. so instead we write (operand0⍣operand1)arg or the golfier: operand0⍣operand1⊢arg
@Sherlock9 there is no train there
 
Ven
Removed mine.
 
@ngn Strand?
 
ngn
@Sherlock9 oh... stranding is when you put some arrays next to each other - they form a vector of (possibly nested) arrays
 
Ven
It obviously doesn't work and is suboptimal. The trick to only multiply the two first elements is cute, though.
 
4:58 PM
@ngn Right okay because there's data at the end. What's it called? A derived function?
@ngn Ahhh I didn't know that phenomenon had a name
 
ngn
@Sherlock9 an expression
 
Of course
Turning the short version in your comment into a TIO link looks like it's going to be tricky. Not sure how to test 1 through 30 here tio.run/##SyzI0U2pTMzJT///36j6Ue/…
 
ngn
@Sherlock9 this is one of those cases dzaima was talking about earlier - bare expressions are harder to test than dfns
@Sherlock9 there's a way to surround the expression with { }, replace with , and execute it (), but it's probably more complicated than it's worth
 
Well, I'd be willing to try it
 
Ven
⍞←({(⍵⊥3⊃⍺)=×/⍵⊥¨2↑⍺:⍵⋄⍺∇⍵+1}∘2)6 9 42
 
5:04 PM
@Ven
 
Ven
⍞←({3⊃e=×/2↑e←⍵⊥¨⍺:⍵⋄⍺∇⍵+1}∘2)6 9 42
 
@Ven
 
Ven
I'm a bit out of idea. @Adám it seemed to me like you completly disregarded the conversion to 10 and I tried to mimic that, but...
 
ngn
@Sherlock9 but the solution occurs twice there. there's danger you might change one and forget to update the other
@Sherlock9 see this one
if you use ⎕io←1, then 1⌷ should be 2⌷
 
5:18 PM
@ngn oh god why
 
ngn
@dzaima in the name of automated testing :)
 
@Ven The arguments need to be given as digit vectors.
⍞←({3⊃e=×/2↑e←⍵⊥¨⍺:⍵⋄⍺∇⍵+1}∘2)6 9 (4 2)
 
@Adám 13
 
Ven
oh..
however:
⍞←({3⊃e=×/2↑e←⍵⊥¨⍺:⍵⋄⍺∇⍵+1}∘2)(1 0) (1 0) (6 4)
 
5:21 PM
@ngn reminds me that SE chat has an "ignore user" feature
 
ngn
4 mins ago, by ngn
if you use ⎕io←1, then 1⌷ should be 2⌷
@Sherlock9 ^
 
Pardon me
 
@Ven
 
Ven
Yep...
I'm not equipped with a debugger and it seems I slower tryapl down.
 
@Ven tryapl should time out after about 10 secs
 
ngn
5:26 PM
@dzaima am i being too annoying? did i say anything bad?
 
Ven
@ngn I think it was meant as a joke on "it's too horrific"
 
@ngn you used regex to parse code
 
ngn
@dzaima :D
 
@Ven I think ∘2 isn't good. The starting base should be one higher than the largest digit, no? Otherwise:
⍞←({3⊃e=×/2↑e←⍵⊥¨⍺:⍵⋄⍺∇⍵+1}∘2){⎕IO←0 ⋄ ⍵⍳⍨⎕D,(819⌶⎕A),⎕A}¨'a' 'a' '144'
 
@Adám 8
 
Ven
5:28 PM
erm, well, isn't yours the same?
 
And it must at least be base 11 to have a
@Ven Sure, but maybe the proper solution would be ⊢{3⊃e=×/2↑e←⍵⊥¨⍺:⍵⋄⍺∇⍵+1}1+⌈/∘∊
 
Ven
@Adám max of is ⌈/,/⍺?
oh, I guess enlist works just as well and takes 1 less char
@Adám Yes, that works. I just had to change 10 10 with (1 0) (1 0)
 
@Ven More than 1. You'd need 1+⌈/⊃,/ which is not a valid train, so you'd need {1+⌈/⊃,/⍵}
 
@Adám in your array model, what would (1 2⋄⋄3 4) be?
 
Ven
@Adám Guess I'm gonna use that then. I'll update the explanation tomorrow -- it's 6:30 here and I should go home. Thank you.
 
5:42 PM
@dzaima (1 2)(3 4)
 
Ven
@Adám Ah! Someone posted a golfier answer to that challenge an hour ago.
 
@Ven That's ok.
 
hmm since i already allow newlines in parenthesis, should ('ab' ⋄) be ,⊂'ab', a syntax error or the same as ('ab')?
 
@dzaima So newlines in parens are counted like spaces?
 
Ven
Well, it can't stay outgolfed forever. But by now the part I've written is less than half of it so it feels a bit weird :\.
 
5:47 PM
@Ven Nah, it's fine.
@Ven I wonder if the other answers handle degenerate cases like a a 144
 
@Adám yeah. I've never really liked the fact that newlines are so special in APL
 
@Adám that is undefined behavior, it just happens to 100% of the time look like a vector
(ok yes, newlines are spaces that don't work as strand separators)
 
@dzaima I don't know what that means. Isn't it that
(
 a
 b
)
means ((a)(b))?
 
@Adám ok maybe i'm misremembering how my apl works ¯\_(ツ)_/¯
@Adám yeah, but that's only because of me being lazy while implementing parenthesis
 
5:56 PM
@dzaima … because that was one of the ideas that was considered within Dyalog. It has the benefits of being really simple (to explain) and can also work to create multi-line trains.
 
@Adám also gives a simple way to have monadic functions in trains - {2 + +\⌽⍵}(2+ ⋄ +\⌽)
 
I posted that solution at last, @ngn. I don't think this explanation's very good, but that's partly because I don't know how to explain ⍎¨⍕, so I guess I don't really understand it
 
@Sherlock9 ⍎¨⍕ is eval each char of the string representation of the number
 
10:00 - 18:0018:00 - 22:00

« first day (770 days earlier)      last day (883 days later) »