« first day (123 days earlier)      last day (2534 days later) » 

4:21 AM
 
 
3 hours later…
6:55 AM
@Uriel Save an additional two bytes by swapping the order of a and b, while making it into a tacit train: {3⍕⍵/⍨1E¯6>|⎕-1○○⍵÷180}⊢+1E3÷⍨(⍳1E3×-) However, I think the last 1E3 should be 1001 to make the range inclusive, assuming ⎕IO←0. Try it online!
 
 
3 hours later…
9:31 AM
For the Interleaving Reversing challenge, I got 27 bytes bytes in APL and wonder how it can be golfed
It's a tradfn
it is uncomfortably verbose
 
 
1 hour later…
10:44 AM
@KritixiLithos Firstly, you can save a few bytes by combining stuff: A⊣A[i]←⌽A[i←2×⍳⌊2÷⍨⍴A←⎕]
 
that's neat
 
@KritixiLithos In version 16.0 (the beta is out, so you should be able to use it on PPCG, even though TIO hasn't upgraded), you can do ⌽@{2|⍳≢⍵} (assuming ⎕IO←0).
 
I can't test it... in which case you should post it
 
@KritixiLithos Hang on – I'll make a plug-in for TIO.
 
I'll post the 15.0 version
 
10:58 AM
@KritixiLithos If you look at the source code for @, you'll notice that the last line reads A⊣A[I]←⍺ ⍺⍺(A←⍵)[I] All the previous lines are just preparation, the last line does the actual work, which is pretty much your expression.
@KritixiLithos OK, I'll post the 16.0 version.
 
11:17 AM
@KritixiLithos Neater:
A←B A
A[i]←⌽A[i←2×⍳⌊2÷⍨⍴A]
But I'm not sure how that counts on PPCG.
 
markdown doesn't work on multiline messages
 
 
3 hours later…
1:48 PM
@Adám it produced only the positive solutions when i tested it
 
2:03 PM
@Uriel I don't understand. The TIO link gives ¯1080.000 ¯900.000…, no?
 
my wifi provider blocks tio, i use the offline distribution
 
@Uriel Ah, right, I forgot. Is tryapl.org allowed?
 
yea, but nevermind. i just tested it again and it worked
 
@Uriel OK. Don't forget to set and say ⎕IO←0. Before APL on TIO, I used tryapl.org and made substitutions for things are not available on tryapl.org, e.g. TryAPL!
@Uriel When I notice one of your APL submissions, do you want me to edit in a TIO link?
 
@Adám what is the ⎕IO←0 for? also, i think the 1001 is necessary (regarding the OP specs that gave 1080 and -1080 both as solutions)
@Adám nah, i think that would not be necessary. i would just include tryapls, like the one i did on the reciprocal
 
2:16 PM
@Uriel ⎕IO sets the Index Origin. Most languages are either 0-indexed or 1-indexed. APL traditionally gives you the choice. This is really useful in codegolf, because we don't count the setting of ⎕IO because some systems have ⎕IO←0 as default, while others have ⎕IO←1.
@Uriel Yeah, tryapl is fine, but sometimes you can't (⎕←, ←⍞, , ⎕DL, etc.)
 
@Adám is like python's eval?
 
@Uriel Yes, it's called execute.
 
is there some kind of an apl reference? (like the hoverable one in the ide and tryapl, but not hoverable)
 
@Uriel Like this?
 
this looks a bit like an overkill
 
2:27 PM
@Uriel How about this?
@Uriel Btw, I strongly recommend Mastering Dyalog APL.
 
@Adám the last one looks good
btw, is it specific to dyalog? or all apls?
 
@Uriel Too bad, my mother just went to Israel. She could have taken one along for you. Maybe next time.
 
regarding the ⎕XX parts
 
@Uriel It is specific to Dyalog, but most basic system functions are identical or close to identical across dialects. Do you use any other dialect of APL?
 
@Adám nothing to worry, i prefer e-books anyway
@Adám well, i ran windows so the only one i managed to get to work is the dyalog one, and so the gnu apl and stuff are irrelevant
 
2:36 PM
@Uriel Well, there's APLX and APL2 and APL+ and NARS, but appart from NARS, they are rather stagnant.
 
dyalog looks like the best choice of them all, though nars seems a little more featured
 
@Uriel I agree. While NARS is good for number theory, primes, and hypercomplex numbers, it is notoriously bad for golfing, as each character is 2 bytes, and it does not have tacit functions (neither does does any of the other main dialects).
@Uriel Also, NARS is intended to be an experimental system (Nested Array Research System) without consideration for pesky things like performance. Dyalog spends a lot of effort on tuning performance, so simple code Dyalog APL code can at times run faster than carefully hand-crafted C.
 
3:04 PM
@Adám how can I get an array of the lowercase ascii (or uppercase + lowercase)? (something like ⎕A - 48)
or, if shorter, to create something like ⍵.upper()
 
@Uriel For now, 819⌶⎕A, or include a library that has them, e.g. AGL. If you don't need Dyalog specific features, you can also claim to use APLX, which has the (anomalous) ⎕a.
@Uriel 1(819⌶)'mytext' makes it uppercase. If you need it as a function, 819⌶⍨∘1 is one byte shorter than 1∘(819⌶).
 
@Adám returns DOMAIN ERROR: Invalid I-Beam function selection
Im trying to do something like {∧/⌽⍵=⌽⍵}{⍵∊'AEIOUaeiou'}{⍵/⍨⍵∊⎕A,⎕a} 'Dennis' for codegolf.stackexchange.com/questions/123194/…
 
@Uriel What version of Dyalog APL are you on? Hint: ⎕WG'APLVersion'
 
14.0
 
@Uriel Do yourself a favour and upgrade to 15.0 (and soon 16.0). 15.0 is completely free. 14.0 is going out of support in a few months.
 
3:14 PM
@Adám done
 
@Uriel Now you should have 819⌶.
 
@Adám i downloaded from dyalog.com/download-zone.htm and it downloaded the 14.0 version, where can find 15.0?
 
@Uriel dss.dyalog.com/apply.php?ltype=pe ← Used to cost money. Now free.
 
hmm. I usually prefer to avoid such forms.
 
@Uriel We will never give out your information, and we only send you information relevant to your install (although you can just ask not to be on the mailing list). We do need your contact info to be able to sue you in case you use the product for commercial purposes.
@Uriel Here is a way to model 819⌶ in version 14.0 (which is also what TryAPL uses).
 
3:33 PM
bookmarked and kept, yet way too long for golfing purposes
 
@Uriel No, I mean you can develop on 14.0 using the model, and then post on PPCG using 819⌶.
@Uriel I can solve that challenge in 24 chars.
 
well, i've just seen that kritixi have posted a 33 byte solution, and with aplx it's 34: {(∧/⊢=⌽)∊'AEIOUaeiou'∊⍨⍵/⍨⍵∊⎕A,⎕a}
mine came almost identical excpet for the ,⎕a and the aeiou'
 
@Uriel Not really, 'cause APLX doesn't have the Dyalog specific features of {dfns} and tacit functions (∧/⊢=⌽).
 
@Adám then i guess the byte count should be reversed and squared?
 
@Uriel :-D Yeah, something like that.
@Uriel Note what you are doing with ∧/⊢=⌽ First you compare each element to the corresponding element of the reverse, then you ask if they are all true. You could ask whether the entire array is identical to its reverse: ⊢≡⌽
 
4:07 PM
@Adám ⎕R?
 
@KritixiLithos Nope. Basically same method as yours.
@KritixiLithos The trick is saving bytes by converting to lowercase instead of uppercase, and using set functions instead of filtering.
 
4:23 PM
but then you also have to lowercase ⎕A
hmm...
 
@KritixiLithos Yes, exactly, but note that 819⌶ works on any array.
 
 
2 hours later…
6:49 PM
@Adám I just reread the post. seems like it will count indeed.
spent tooo much time firguring this indices stuff
 
@Uriel Which post are you talking about?
 
Save a few bytes by combining the statements and making the operand tacit: (11⍴⍉⌽f)[⍋11⍴⍉f←,∘⍴⌸+/?100 2⍴6]Adám 11 mins ago
 
@Uriel Regarding scoring: Lately, Dyalog has added some new primitives with glyphs that do not occur in ⎕AV (the Atomic Vector – the Classic single byte character set), so if you use any of those, you either have to report the byte-count of a Unicode representation, or substitute each such character with ⎕Uxxxx where xxxx is the hex code for that character. You may also have to add a space after the hex code if the thing on the right is an identifier.
@Uriel Also, regarding , you often should use to avoid edge cases. ⍴4 is an empty vector, while ≢4 is 1. gives the overall array shape, while gives the count of major cells.
 
7:13 PM
@Adám I believe the ⎕Uxx would usually consume more bytes, given the low chance that Dyalog decided to add emojis into its character set.
And if you did - I call dibs on the use of 🦄 for representing imaginary units.
 
 
1 hour later…
8:28 PM
@Uriel ,∘⍴⌸+/?100 2⍴6 is 22 bytes, ,∘⍴⎕U2338+/?100 2⍴6 is 19 bytes. The problematic characters are ⊆⍠⍤⌸⌺⍸. Oh, and the imaginary unit is 0J1 = 0+1𝑖.
 
8:51 PM
@Adám how's that coming in terms of trigonometric functions (s)?
 
@Uriel What? X○Y
 
Yea, that was what I looked for (phase, X=12).
@Adám how do you conjugate a number?
 
cool! so APL supports quater-imaginary base!
 
@Uriel APL supports any base, including mixed base. E.g. ten thousand seconds is 24 60 60⊤1E4 = 2 46 40 i.e. 2 hours, 46 minutes and 40 seconds.
 
9:08 PM
I don't get why isn't this language more popular.
 
9:22 PM
@Uriel People are not willing to or clever enough to see the truth.
@Uriel Also, using APL makes it possible to use fewer programmers, which is neither conducive to its spread not to popularity among IT department managers.
@Uriel Finally, it is so easy to learn and use that relatively little literature and few courses have been available, leading to lack of exposure.
 
I'm not sure about the easy part, because I've been exposed to it after C and python (and befunge) and its still not a piece of cake, but it surely have the right features (considering it's performance is as you describe)
but sure it's much easier than the lisp they teach today
 
@Uriel Well, your exposure to C and Python is probably only a hindrance. APL is more of an executable mathematical notation than a programming language (despite its name). It is often very hard for "traditional" programmers to let go of their old ways when learning APL.
 

« first day (123 days earlier)      last day (2534 days later) »