« first day (2679 days earlier)      last day (2165 days later) » 

12:17 AM
In RAD, what should 1 2 3+4 5 do? I don't want it to error.
 
fill the short one?
5 7 3
same as Jelly
 
I was thinking something along the lines of (1 + 4 5)(2 + 4 5)(3 + 4 5)
 
@Zacharý that's +/ in J
I really like the Jelly behavior
 
Maybe I can make it a ⎕something controlled behavior?
@FrownyFrog What use cases would that have?
 
@Zacharý Why that and not (1 2 3+4)(1 2 3+5)?
 
12:27 AM
@Adám That could be done as 1 2 3∘+¨4 5
 
@Zacharý As opposed to 1 2 3+⊂4 5
 
@Zacharý 1 2 3 +⍨ 4 5
should be doing this
 
@Adám On functions that vectorize to depth 0, your idea seems to work.
 
@Zacharý K has each-left and each-right for that.
 
@Adám RAD will as well, I'm just thinking of what to do with just + (or any other function like that)
 
12:30 AM
@Zacharý How about falling back to ∘.+ if the arguments are mis-matched?
@FrownyFrog Wouldn't work for non-commutative functions.
 
i see
 
⍃⍄ or ⍅⍆ for each left and right?
I think I'll use the idea, I'll just have to decide on a default.
 
@Zacharý Oh no! Not more primitive-changing -names! Plz.
″‶
 
@Pavel what if the type system doesn't let it...
 
Does " mean anything in APL?
@ASCII-only Sure it does. Booleans are ints.
 
12:37 AM
@Pavel No, but ¨ does.
 
@Pavel You do know it's invalid in most C-derived languages (i.e. the ones with more strict typing) right?
 
@ASCII-only But in Python, booleans are ints.
 
bool is a subclass of int
int isn't a subclass of bool
 
12:52 AM
Right, and if checks ints
Python didn't even have bools for a long time
 
@Adám I'll generalize it: make it a monadic operator (which the user can change) which determines what certain functions do upon a length error
 
Calling __bool__ on ints is A) pointless and B) super slow
 
Also, because I don't want to have to think of an order for those things
I'll also generalize ⎕IO as well: ⎕IO←2 will be possible.
@Pavel I have it planned as a ⎕UCS alias for RAD
 
@Zacharý Like a re-assignable system operator? ⎕MISMATCH←{⍺⍺/↑⍺ ⍵} for the fill option?
@Zacharý ⎕IO←1.5J¯2?
 
@Adám I have to stop somewhere, so only integers (or I might just make sure it's a number and do the required math on it)
 
12:58 AM
@Zacharý I'd rather get rid of ⎕IO and settle on a default, but then have a monadic operator {⎕IO←0 ⋄ ⍺←⊢ ⋄ ⍺ ⍺⍺ ⍵} for the other option.
 
@Adám Isn't it {⍺⍺⌿↑⍺⍵}?
@Adám That's the one primitive-changing thing I'm keeping.
⎕ML is GONE though
 
~⎕IO∊0 1 is rarely useful. You'd better allow to be a range generating function, so 0…9 is (⍳9)-⎕IO and …4 is 0 1 2 3 4, for example.
@Zacharý Yes, typo.
 
@Adám Knew I was forgetting a codepoint.
Let's assign to be that: there is NO way I'm programming gotos.
 
@Zacharý Why, though? If Ⓞ←{⎕IO←0 ⋄ ⍺←⊢ ⋄ ⍺ ⍺⍺ ⍵} then {⎕IO←0 ⋄ blah blah} can be replaced with {blah blah}Ⓞ.
 
@Adám It's just a pointless generalization, just like the number system.
 
1:02 AM
@Zacharý Have you settled on a character set already‽
 
If you look at the bitbucket page, RAD_IO (the ⎕IO internal variable) is in a file called RAD_Defaults, so I'm hoping I can get away with what APL does.
 
@Zacharý It is interesting how newbies seem to like the settable ⎕IO. APL old-timers universally hate it.
 
And is a codepoint.
I ran out of APL in Miscellaneous and technical.
 
ngn
@Adám I've hated it since the time I first saw it
 
I am neutral when it comes to just programming (uses of it both ways), but like it for code golfing (since either is accepted without cost, and both can be useful)
But ⎕ML is definitely pointless if starting from scratch
 
1:07 AM
@Zacharý What will monadic do?
 
@Adám Flatten. (Monadic ⍷ will do similar, just with differences with strings)
 
@Zacharý Will you have a prototype system like APL?
@Zacharý Strings?
@Zacharý Have you decided whether monadic f/ should use the "insert" system or the "reduce rank" system?
 
Wow, Dyalog does not like vectors of characters distinct from strings
@Adám ∊'aa' 'bb' will be like Dyalog, and ⍷'aa' 'bb' will just leave the vector unchanged
@Adám R AD. So, obviously the first one
 
@Zacharý OK, "reduce depth" then. I.e. will ,/'abc' 'def' give 'abcdef' or ⊂'abcdef'?
 
@Adám Yes, I might even have an atom for getting the prototype.
 
1:13 AM
@Zacharý Like monadic in ⎕ML←0
 
'abcdef'
Yeah, maybe one of these in the monadic function case as a prototype atom: ∍⋾
 
@Zacharý So monadic flattens everything except leaf character vectors? Why shouldn't it do the same for leaf numeric vectors?
 
@Adám In case one wants strings to be treated separately from numerics. I remember running across either the and cases in different languages and esolangs, but not both in one.
 
@Zacharý In my imaginary APL where ⎕IO is fixed to 1, array[0] will give the prototype. (And array[¯3] gives the 3rd last element.)
 
@Adám Might add that as well (definitely adding in the "last element part")
 
1:18 AM
@Zacharý Sure, I can see the need for both, but why make monadic and the same on numbers?
 
@Adám They are. (⍷(1 2)(3 4))≡∊(1 2)(3 4)
@Adám If this ever is a thing: ÁPL
 
@Zacharý But how can that work with ⎕IO←0? Which number would you use for the prototype, and would the last element be ¯0
 
No, just generalize it, even for weird results. ⎕IO-1 is prototype, ⎕IO-2 being last element.
I'm not expecting RAD to be like ngn/apl or Dyalog.
 
@Zacharý Uh, array[¯2] for the last element. You're kidding, right?
@Zacharý So ⍷(1 2)'abc' is 1 2 'abc'
 
@Adám Yeah.
@Adám No. The main reason for ⎕IO in RAD is for golfing purposes
I know! I'll use á as an always (⎕IO←1) indexing!
 
1:23 AM
I like the symmetry in 4⌷array: 4th major cell; 4↑array: 4 leading major cells; ¯4⌷array 4th-last major cell; ¯4↑array: 4 trailing major cells; 0⌷array: prototypical major cell; 0↑array empty prototypical array.
 
0↑array definitely won't work in RAD: that'll always be , or [] in Pythonic notation
 
@Zacharý Or '', no?
 
Whoops, yeah. But it won't work with any kind of higher dimensional stuff.
 
@Zacharý What does it even mean to support prototypes if you don't support empty arrays?
 
@Adám I made a mistake
@Adám have ↑ work as expected
 
1:27 AM
@Zacharý This is why I dream of folding depth into rank, not the other way around. DAD.
 
._.
Adámic Depthless APL-ish Masterpiece
@Adám By mistake, I mean typographical error
 
Getting late. ○/
 
wait ... what symbol is that?
Holy crap. It's . dang it looks weird
I'll start programming in actual evaluation logic tomorrow, still haven't decided on a default ⎕M/⎕MISMATCH
 
ngn
@Zacharý how are you going to represent arrays?
 
(1 2)(3 4)
The parser can already do that
 
ngn
1:38 AM
@Zacharý I mean what does that parse as? what does the underlying Python object look like?
 
[[1,2],[3,4]]
 
ngn
@Zacharý so APL array = Python list
 
RAD array vector = Python list (I call them vectors for RAD since there's no rank)
 
ngn
How will you distinguish between ⊂1 2 and ,⊂1 2 ?
 
... pardon me for saying this: there is no
 
ngn
1:40 AM
@Zacharý oh, ok
 
It's not meant to be an APL, J, nor K dialect. It's more like an unintelligible variety of all three (mostly APL and K) :D
@ngn Are those different in K?
 
ngn
@Zacharý in k ,1 2 is like APL's ,⊂1 2
there are no enclosed scalars
only lists that can contain other lists
 
@ngn Yeah, RAD has surprisingly alot of stuff in common with K...
 
ngn
however, simple scalars do exist: 1 is distinct from ,1
 
@ngn Same in RAD (probably even same notation)
APL is to J as RAD is to K ... pretty much
 
ngn
1:46 AM
@Zacharý to a large extent k is discovered, not invented :)
 
But of course: RAD might win a few golfing competitions just by removing {} :P (I won't do that for a submission, unless it's trivial_
 
ngn
@Zacharý yeah, I must add those in every ngn/k answer and that bothers me too...
 
@ngn That's why I'm making it semi-esoteric, that way it's still understandable, but is competitive within APL/J/K.
α:1
ω
Is perfectly legal
(And RAD fills up a codepage with potential atoms)
 
Hello peoples
 
Hello φ~π
 
1:52 AM
What language are you talking about?
 
A Rankless APL Derivative (a language I'm developing, in the vein of APL / J / K)
AKA: RAD
 
ngn
@Zacharý or φπn't according to the latest meme :)
 
RAD is definitely already better than MY
@DJMcMayhem, I ask your opinion: should this be moved to a room?
 
2:08 AM
Unrelated: I'm about to buy a new domain name and hopefully (eventually) turn it into a cool website: neuroscience.space
 
2:52 AM
Okay: I'm going with the "fill" that @FrownyFrog gave
 
3:46 AM
@Anush And that's why we need MathJax.
 
I just discovered that 1 2⍪ 1 3⍴3 4 5 doesn't work
 
._.
Length error, mate!
 
That's how you do the fill thing in J
It appends with a 0, then you sum the rows
seriously, you can't do that in APL?
 
APL > J
 
L is for lame
 
4:01 AM
At least APL knows how to be original
 
and for LENGTH ERROR
 
... that's why RAD'll be a thing
(AKA APL + K's love child, pretty much)
 
LAPK
PLAK
 
Rankless APL Derivative.
 
4:04 AM
How many bytes does it take to do {⍺=2:3⋄⍵∊1 2:4⋄⍺+⍵} in J?
RAD:
 
I can't read that
 
⍺=2:3
⍵∊⍳2:4
+
 
what's :
 
branch, sorta like if
If left argument is 2,return 3. Otherwise if right argument is 1 or 2, return 4. Otherwise, return the sum
 
thanks
 
4:06 AM
How many would that take in J?
 
I don't know
less than a kilobyte
 
._.
Does J even have an if-like structure?
 
yes
 
What is it?
 
yes, I'm firguring it out atm
it's if. do. end.
 
4:12 AM
APL wins again, one byte suckas (or three)
I probably should learn J sometime
 
...
 
It's 45 bytes in one line
 
APL > J
 
@Anush A possible way is to use stack snippet. Although I have not yet figure out how to use markdown inside.
Also, you can view markdown source of wikipedia pages.
 
5:13 AM
tacit, 27 bytes
I guess ((2*2=[)>.]e.1,2:){+,4,3: is the golfiest
 
5:28 AM
Still sad
 
only the 27-byte one truly branches, the other 2 always do the addition
 
J > Perl tho.
 
6:08 AM
@FrownyFrog ↑(1 2)(3 4 5)
 
thanks
 
@FrownyFrog Also, APL has a full-fledged prototype system, so it will use the top left element as fill but with all numbers set to 0 and all characters set to space. Oh, and mixed-type arrays are allowed.
 
got it
 
0
Q: To find 3 nearest values that are fully divisible by an user given value

HARRY HARRYCode challenge - i want to get 3 nearest values to an value given by user but that 3 nearest values should also fully divisible by the user given value. Eg: Input=30 Output=60,90,120. Also, i want to get 3 more values but which are nerest and lower than user value but which can divide the user va...

 
@FrownyFrog In fact, it goes all the way: If the top left element is (or contains) an instance of a class that has a niladic constructor, it will fill with (arrays that contain) new instances of that class!
 
6:19 AM
hi @Adám
 
@LeakyNun Hello Kenny.
@FrownyFrog 4[^:(1 2 e.~])3[^:(2=[)+ works as well.
 
nice one
 
@Adám do you say oygn or ayin?
אויגן / עַיִן‎
 
@LeakyNun oyg (singular), oygn (plural).
 
@Adám it doesn't work
the arguments to ^:(...) are not the original ones
 
6:25 AM
@FrownyFrog Oh, right, of course.
 
f=. 4 :'3[^:(x=2)4[^:(y e.1 2)x+y'
 
@FrownyFrog bet that requires pre-set vars.
 
@Adám costs 5 bytes
4 means dyadic only, 3 means you have to specify both cases
or something like that
you can specify only the monadic case, but if you don't, you need a : in the beginning, I think that's how it works
actually I have no idea
yes, a single : lets me omit the monadic case
but it doesn't work in a one-liner
 
6:45 AM
@FrownyFrog J's explicit notation is horrible, imho. Dfns are so neat in comparison, and even tradfns are not that bad.
 
can't argue at all
 
7:11 AM
@FrownyFrog +`4:@.(1 2 e.~])`3:@.(2=[) truly branches
 
amazing
+`4:@.(e.1,2:)~ saves a byte
 
0
Q: X Steps Forward, 1 Step Back

Kevin CruijssenHere the first 100 numbers of an easy sequence: 0,1,0,2,1,4,3,7,6,11,10,16,15,22,21,29,28,37,36,46,45,56,55,67,66,79,78,92,91,106,105,121,120,137,136,154,153,172,171,191,190,211,210,232,231,254,253,277,276,301,300,326,325,352,351,379,378,407,406,436,435,466,465,497,496,529,528,562,561,596,595,63...

 
7:37 AM
@FrownyFrog OK, but only because plus is commutative.
 
1
Q: New Password Idea: Word-walker

Troels M. B. JensenI thought of a new way to generate my passwords, and even though it's probably not very clever in the long run, it could still make for a fun code-golf. Taking a string of words, the password is generated thus: Pick the nth character in the nth word If n is larger than the word, continue count...

 
@NewMainPosts :| I can directly port this but IDK if I should
 
@Adám yeah, I did edit that in just before the time limit, finals really do corrupt your memory
@Adám the last 6 bytes are redundant...
 
I'm reading grammar.y (SPL source code) to see what's inside.
 
7:53 AM
Ah, right. But good practice, imho.
 
@ASCII-only Explanation added (hopefully)
(too bad that SPL doesn't recognize */ as one token)
 
9:02 AM
0
Q: Alphabet Position Finder

Theo CInspired by the Codewars Kata. Your goal is to take an input string such as this one: "'Twas a dark and stormy night..." and return a string containing the position of each character in the alphabet, separated by spaces and ignoring non-alphabetical characters, like this: "20 23 1 19 1 4 1 1...

 
@user202729 I would love to know how to use a stack snippet for this
hi all
oh dear.. maybe I set a challenge too hard for ppcg?!
 
@Anush I just have other things to do...
 
@user202729 even worse! :)
@user202729 are you busy for a while now?
 
Busy with other challenges.
 
ah.. that's like saying you are busy with your other girlfriends/boyfriends :)
(that was a joke of course!)
 
9:16 AM
Another problem with the stack snippet is that the content can only be displayed inside the snippet.
Just like the leaderboard snippet.
 
@user202729 hmm ok.. in principle the process of translating the wiki to ppcg format should be automatable I think
I mean all you do is download the svgs, convert them to png and add them .. but you need to work out the right scale and I don't understand how to fix the vertical centering
 
You can get the source Markdown by clicking "edit" on the wikipedia page.
 
@user202729 it's not Markdown...
 
I see abc <-- render as mathjax
**markdown does not work**
you have to use html instead
 
It's WikiMark
 
9:21 AM
@ASCII-only Somewhat.
Fine, but what's inside <math>..</math> is latex.
So just find a markdown/something to html compiler.
@ASCII-only You know any wikimark to html compiler?
 
I wonder if this could be turned into a PPCG challenge
that actually also helps PPCG
 
Doesn't sound very interesting...
 
some people get a hit from being helpful :)
 
Let me try... First, copy the HTML source from Wikipedia.
 
9:38 AM
for(var a of $('.mwe-math-element'))a.textContent='$'+a.firstChild.firstChild.getAttribute('alttext')+'$';copy($('.mw-parser-output')[0].innerHTML)
(that converts every math image into latex formula with $ wraparound then copy the page)
 
@user202729 inspect element...
 
@ASCII-only I end up using that.
 
0
A: Sandbox for Proposed Challenges

Frenzy Li Hexarun! king-of-the-hill javascript work-in-progress Hexarun (stylized as Hexarun!) is a simultaneous game with complete information. Hexarun is intended for a minimum of three (3) players. Overview Up to twelve (12) players start on a regular hexagonal toroidal board with a number...

 
9:56 AM
@Anush This should look good now (except the font)
@Anush Besides, we have serious contender rule. "Answers must be a serious attempt at the winning criteria"
2^(2^(n-b))×2^(2n-b)×poly(n) doesn't sound very serious for a fastest-code challenge.
 
@user202729 It is a serious contender if it's the fastest, surely
@user202729 Nicely done!!
 
@Anush Although the previous SPL quine is the smallest, nobody would call it a serious contender for code golf.
Quote Mego:
@Anush (fastest possible, not fastest posted)
still finding the quote
 
I don't fully understand that.. the words "serious contender" must refer to being a serious contender for winning under the stated rules. So all that matters is the relative speed, not the absolute speed
 
> [...] if the only way a submission could win a challenge [...] is if no other solutions were posted, it's almost certainly not a serious contender [...].
Yes, the relative speed matters.
 
@user202729 could that snippet have been made automatically do you think? That is did you have to apply any judgement to make it?
 
10:03 AM
@Anush I just have to select the correct part.
 
or could a script have done it in principle
 
But... having a very slow solution makes people doubt about whether their is a serious contender.
 
@user202729 may be but also might make other people more optimistic about their chances
 
@Anush Also that.
(last time I posted the second worst solution, and after that, people all post their better solution. Can't remember when)
 
there may be a smart solution for b = 1 of course
@user202729 oh that's interesting
maybe I should have asked a code-golf question for b = 1 first, to warm people up
or just a question about b = 1 :)
 
10:11 AM
Still very hard...
Anyway. I will just post the first answer to encourage others.
 
thanks!!
for b=1 the sequence for n=4...9 seems to be 4, 6,12,20,40,70 which is oeis.org/…
@user202729 will your code work for n=10, b = 1?
 
Generate all distinct substrings of a length is hard enough...
Still coding.
This is fastest code, I have to find a way to make the code as fast as possible, to my ability.
 
 
1 hour later…
11:42 AM
@cairdcoinheringaahing did we ever actually find a use for BrainFlump? I don't think it's ever actually been used, looks like the TIO version doesn't even work
 
11:54 AM
If (a) is a subsequence of (b), then (b) is a [...] of (a)?
 
@user202729 supersequence
apparently
 
That sounds really weird.
 
I think it's right though
 
12:10 PM
Debugging just takes forever...
 
true!
that's why we are all supposed to code in Haskell so it takes forever to write the code in the first place :)
 
Only if you're not familiar with Haskell.
(yes, I'm not familiar with Haskell too)
 
Not planning to post yet, but review request: codegolf.meta.stackexchange.com/a/16451/59487
 
typo "And example of a concave matrix:"
 
@JoKing (what have you done? If that's on the constants part I'd rather working on that myself, you may post your own answer if you want)
And I have not read it.
I don't want spoilers.
@Mr.Xcoder I think the specification has bugs.
 
12:27 PM
@user202729 Could you please be more specific?
 
Your specification implies that for a concave matrix,
all elements in column 1 are larger than all elements in column 2, while 4<5.
 
Indeed, you are right.
I'll fix that
 
For n=2, any matrices that are not flat are both concave and convex.
 
@user202729 spoilers - lower char codes
 
Wait, but...
Last time I check ! gives more bytes than ..
Wait...
I think I misremembered?
 
12:32 PM
@user202729 who knows. ! does have the lowest ASCII code though (excepting space)
 
Wait but...
Well...
I think things changed when I subtract everything by 31.
Nope.
Now I have absolutely no idea why I used . instead of !.
Must be some silly mistakes.
 
1:05 PM
@user202729 Mostly changing the print sections yeah, but as pointed out, ! is smaller than . and : (for scene declarations)
Also, there were a couple of superfluous bits like You be you in there
 
1:46 PM
And that's after I remembered to s/you be a/you/.
 
@Dennis Can you grant 354613 explicit write access to 52405?
 
@Adám Done.
 
@Anush My program doesn't even work for n=7,b=1.
 
@Dennis Thank you so much.
 
(work = run fast enough)
I need better algorithm.
 
1:57 PM
@user202729 ah...
 
The problem is I can't think of one.
If each sequence of length n-b is the subsequence of exactly two sequences of length n then it's an instance of the vertex cover problem (which is already NP-complete)
 
hmm... I must have been much cleverer in 2013 :)
@user202729 can you use a library to do the np-complete parts? Some of them are quite fast
e.g. igraph
 
@Anush I still could not reduce it to a well known classical problem.
That is "if".
That is not just true.
 

« first day (2679 days earlier)      last day (2165 days later) »