« first day (2678 days earlier)      last day (2166 days later) » 

9:00 PM
the second index is 1 and the third is 4, so the list becomes [2, 3, 5]
for the fourth index, you prefer 2 over 3, because 2 < 3, so your list is now [3, 5]
for the fifth index, you can't use 2 again, because now it's not in the list, so you use 3 instead, and you finally use 5, so the result becomes [0, 1, 4, 2, 3, 5]
 
CMC: Implement APL's grade function.
(and by implement, I mean using a built-in doesn't count)
 
@DJMcMayhem Nice challenge for main.
 
Hmm, yeah it would actually.
Has that really not been done?
 
I hate octal.
 
@DJMcMayhem Although you should restrict the argument to a (non-negative?) integer list. In version 16.0 Grade can grade multi-dimensional numeric or character arrays, but in 17.0 it can grade almost anything.
 
9:10 PM
>_< My parser doesn't want to parse 0
 
@Zacharý Of course not; it considers it nothing.
 
:D. My octal is crashing with decimal
 
Anybody has any idea where in TIO's file system to find the list of languages?
 
ngn
@Zacharý easiest fix: remove octal :) why do you need it anyway
 
9:13 PM
Easiest fix: make a separate case for 0.
 
@dzaima Hm, but that isn't available from inside the TIO sandbox, is it? ls /languages.json -R
 
Fixed.
 
@Adám No idea. Ask Dennis or something
 
0
A: Sandbox for Proposed Challenges

J843136028Othello Greedy Strategy The rules for Othello can be found here. In a greedy strategy, in each go, you just choose a square in which to place your counter such that there are no other places that could allow you to flip more counters. However, there is still often a choice where you need to dec...

 
@Dennis Is languages.json (or a list of proper language names) available from inside the TIO sandbox?
@DJMcMayhem It doesn't appear so. Feel free to sandbox it and I'll be happy to review. Relevant and related.
 
9:23 PM
There. My parser actually works now.
 
@FreezePhoenix yeah well 1. to a specified depth is annoyingly slow and also basically useless, and 2. most people wan't by a specified depth
 
I'll post the code up to my bitbucket now.
 
@user202729 :O amazing, how did you get the ~10x reduction
 
@EriktheOutgolfer Well, that allows built-in grading and sorting functions.
 
9:25 PM
@Adám tbh, I'm actually against banning built-ins, I just don't VTC as unclear for that
because, what's a built-in?
 
@EriktheOutgolfer a function (in the broadest sense) that already exists in the language
but yeah, diallowing a single function means a combination of two builtins is fine
 
@ASCII-only what if I say that sorted is actually 6 built-ins working together, making a function that happens to sort the given parameter? Or that s is actually 8 built-ins (the bits of the character)?
 
This whole comment thread seems a good argument for not banning something as subjective as builtins. — trichoplax Aug 26 '17 at 20:35
(see whole comment thread)
 
@dzaima well as long as you can execute each of them seperately? that's fine
 
0
Q: A tool to convert wiki math to be used in ppcg questions

AnushI am attempting to write a challenge which needs to quote essentially the whole of the Formulation section of https://en.wikipedia.org/wiki/Akra%E2%80%93Bazzi_method . Rendering the math nicely in the ppcg question seems to be a pain or at least I don't know how to do it. The only method I have ...

 
9:29 PM
@EriktheOutgolfer A single operation that does exactly what the challenge asks for
 
(of course, I don't think banning builtins is a good idea. I just think it's very clear what builtins are)
 
@ASCII-only there are many situations when you can't split apart multiple built-ins and execute them separately though
 
@dzaima like when :|
 
@DJMcMayhem the comment thread I've posted above pretty much proves that this isn't how you manage to define built-in :/
basically, any source restriction which requires knowledge of the language in order to be enforced isn't a good idea
 
@ASCII-only Dyalog APLs operators for example. In ∘.× the . isn't savable anywhere as an operator because upon calling it needs the two arguments ( and × here) immediately or else it'll error.
 
9:38 PM
@dzaima but it's still an operator, and that's what's important
 
dyadic operators, in this case, are really prefixes that take a function as their right operand and compose a monadic operator, however there are other reasons to argue about ∘....
 
it's still essentially bound to a function in the interpreter
 
Like that thing with Dennis, where Jelly automatically duplicated the argument.
 
@ASCII-only in the interpreter is not objective..
 
@dzaima in the spec then?
 
9:40 PM
@ASCII-only not objective either. That's the problem with objectively defining built-ins
 
@dzaima how is the spec not objective?
 
what's "the spec"...it's the implementation that counts, the spec isn't part of it
 
@ASCII-only if SOGLs spec was there are no built-ins would there be, by spec, no built-ins?
 
@dzaima No. Because the spec would have contradicted itself by detailing all the builtins?
@EriktheOutgolfer well yeah but apparently "in the interpreter" is not objective? idk
 
9:43 PM
technically, every token is bound to a function in the interpreter
 
@ASCII-only alternatively, if the spec said there are infinitely many built-ins for every sequence of characters and each built-in must end and start together with the program?
 
CMC (inspired by the 2018 APL Problem Solving Competition's Phase II, Cryptography 1:2) : Given two Booleans, produce their XOR. All built-ins are prohibited.
 
@dzaima The spec can't just say "let this be a builtin" and expect everyone to go "oh clearly that's a builtin because you totally didn't describe the actual builtins in other places)
@Adám all :|
 
@Adám ._. does that just prohibit ∧/ and ×/ ?
 
@Adám so, ?
 
9:47 PM
@Zacharý Hehe, very funny.
 
I'm not going to post anything either way though.
 
@Adám That's extremely unclear
 
@ASCII-only Yes. No functions, operators, atoms, libraries, verbs, … you name it.
@Zacharý ⌊/
 
@Adám forgot about that one
 
@DJMcMayhem What's unclear? I'll answer whether something is allowed or prohibited if asked.
Btw, I believe this CMC is solvable in most mainstream languages. I can do it in 18 bytes in Dyalog APL.
 
9:50 PM
@ASCII-only also, what if there is no spec? Is the built-in-ness of a string unknown then?
 
In RAD, would having ⍺, ⍳, ⍴, and ⍵ be the actual greek letters be annoying?
 
@dzaima then the interpreter is the one and only correct implementation
@Zacharý well if you're using a lot of unicode then no
 
@Adám so, you didn't use :Select, did you?
 
@Zacharý αιρω instead of ⍺⍳⍴⍵? That would preclude ever using Greek identifiers.
 
Well, it's going to have a codepage, and all the greek letters are either functions or nilads, or look too much like a latin letter
 
9:53 PM
@Adám It's the exact same problem as last time you posted this CMC. Eventually, you said lambda x,y:0 if x else 1if y else 1if x else 0 works in python, but lambda a,b:(a and b==False)or(b and a==False) doesn't. How is == a built-in and lambda/if/else are all not?
 
@EriktheOutgolfer It is called :Select, but no, that solution takes 36 bytes.
 
@DJMcMayhem 0/10. not golfy enough. Wuldn't 0if ... work?
 
@DJMcMayhem Oops. I forgot I had CMC'd it before. Sorry.
 
@Zacharý That's not even my solution. I'm just complaining about ambiguity
 
@DJMcMayhem Because == is an operator while the others are keywords.
 
9:54 PM
@DJMcMayhem well if/else are control flow :P
 
Yes, and they are built in to the langauge
 
@DJMcMayhem Right, but they can't stand on their own.
 
@DJMcMayhem but they're not functions?
on the other hand == is just operators.__eq__
 
Neither is ==
 
@ASCII-only what if the only interpreter of a hypothetical language with byte long built-ins (with no source code available) was optimized by a compiler that hard-coded the actions of every possible 3 built-in sequence (but you don't know that originally they were split apart)? By the interpreter there are tons of 3 byte built-ins but really they are 1 byte.
 
9:55 PM
@ASCII-only OK, fair point
@Adám If lambda is allowed, then and must be too since they're both keywords.
May 17 at 16:56, by Adám
@DJMcMayhem No, because you use == and and.
 
@DJMcMayhem :| but isn't and just an operator in disguise - just because it's made of letters doesn't make it not an operator
 
@DJMcMayhem Ninja'd ^
 
@dzaima then i don't see any reason why they aren't a single builtin - Mathematica basically does this (has huge numbers of builtins)
so what they've made is just mthmtca but less useful
 
@Adám Haskell: 41 bytes. More interesting to solve then with numbers, because then pattern matching wins
 
@ASCII-only I didn't say it's because it's made of letters. Adam said keywords are allowed.
How is any of this task even remotely objective?
 
9:59 PM
@ASCII-only so you're saying that there can be 2 100% identical languages that have different definitions of built-ins? That's just plain wrong IMO
 
@DJMcMayhem but and isn't a keyword just because it's made of letters?
(well I guess it is, just because it's made of letters (i.e. is a valid identifier and therefore has to be banned from being used as an identifier))
 
@DJMcMayhem So, if a language had errors on every stand-alone instance of functions/keywords, and they're all made of letters, wouldn't it have no built ins?
 
@H.PWiz That looks very interesting. How does it work?
 
@Adám It's Haskell: just accept the magic
 
10:01 PM
@Zacharý ⍨
 
@DJMcMayhem well yeah. just realized keyword isn't the right word to use here, see message below
keywords are literally just words reserved for syntax :/
 
@DJMcMayhem It's not.
 
clearly this means Python is just an inferior language. the ideal language would have no keywords
 
@ASCII-only Ok, so then what is allowed?
 
@EriktheOutgolfer I think this one is interesting: :Select⎕⋄:Case⎕⋄0⋄:Else⋄1⋄:EndSelect
 
10:03 PM
@ASCII-only APL has no keywords AFAIK :p
 
@dzaima ^^
 
@DJMcMayhem I'd say basically anything but functions and operators (i.e. basically functions builtin to the syntax)
 
And yet somehow not and, which is neither a function nor an operator
 
if you've removed those then all that's left is basically if/for/while/sometimes switch which are near minimal for TC-completeness
@DJMcMayhem but it's an operator?
 
@H.PWiz Nice! You got me quite confused with the let for a moment.
 
10:05 PM
@dzaima APL has no reserved words, i.e. an identifier that is available to the user can never clash with any part of the language, and indeed, original APL had no keywords, but today's APLs have; they're just prefixed with special characters that are not allowed in user defined identifiers.
 
I guess it can't actually be translated directly into a function though
 
@Adám x takes one argument and returns a function (like any two argument function in Haskell). The syntax f x|cond1=...|cond2=... is for giving seperate branches for a function. If x gets True it returns n (not). Otherwise (for some reason the empty let is True and is shorter than True), return k (Identity... should have called it i)
 
@ASCII-only ...
Where's the definition?
 
@Laikoni I've got a feeling it can be beaten with simple pattern matches
 
I don't see it here
And what if I wanted to do this in brain-flak? Does that mean all 8 commands are forbidden?
I just don't think no built-ins can ever be an objective definition.
 
10:07 PM
@DJMcMayhem yes?
@DJMcMayhem of course. because if they were implemented there you'd require a change to the way the operators there are called, since it short circuits
(clearly this is because Python is inferior)
 
@DJMcMayhem That's because of the various natures of programming languages, but for languages that have well-defined parts (e.g. APL), it is 100% what it means to prohibit all primitives.
 
@ASCII-only So? Why does that make and an operator?
 
plus the fact that and and or do the same thing regardless of type
@DJMcMayhem Hmm? I'm just explaining why they can't be there
the only way to add it would be making the function take two lambdas with 0 args
 
It just seems really arbitrary to me that if (which is built-in to python) isn't a built-in but and which is no different in any way is.
(other than effect obviously)
 
@DJMcMayhem and only takes expressions though? like all other operators?
 
ngn
10:11 PM
@Adám is a[b] prohibited?
 
@ngn No. (Except in J.)
 
@H.PWiz Shorter with n b|b=False
 
@ASCII-only if only takes expressions...
 
@DJMcMayhem >_> oh yeah.
@DJMcMayhem but if also accepts a program as the other operand (well if it was an operator)
 
ngn
@Adám in k: {((0 1;1 0)x)y}
 
10:13 PM
@ngn Oh, right, of course. Clever!
 
@ASCII-only Ok, so it's more powerful than other operators because it can affect control flow
Why is it magically exempt from "built-ins?"
 
because it's not a function?
functions can't really take a program as an argument
 
And shouldn't lambda x,y:0 if x else 1if y else 1if x else 0 be invalid since it's going to call __bool__ somewhere?
 
@ngn Why isn't {(0 1;1 0)x y} valid?
 
@DJMcMayhem IMO, yes
 
ngn
10:16 PM
@Adám x and y don't strand - it parses like (0 1;1 0)[x[y]] or equivalently (0 1;1 0)@x@y
 
Then it's unclear (like I've been saying all along)
 
ngn
@Adám in apl: {a _←(0 1)(1 0)[⍺]⋄a[⍵]} (with ⎕io←0)
 
@ngn I know, but I would have thought that x y is a composite function where y is applied to x's result, and that is then applied to the array.
 
ngn
@Adám why would it be a function? x and y are numbers
 
@ngn Very clever unpacking method. a _←(0 1)(1 0)[⎕]⋄a[⎕] is slightly shorter.
 
10:20 PM
@DJMcMayhem :| so actually even with this relatively non-restrictive definition nothing is possible without builtins
 
@ngn I thought arrays were mapping functions.
 
@DJMcMayhem No, because it doesn't call __bool__ on values that are already numbers.
It only calls it on values it needs to convert to a number
 
@Pavel does it not call __bool__ on anything that's not a boolean? (source?)
 
@ASCII-only Well booleans are numbers, so I assume it doesn't call it on numbers.
 
@Pavel but wouldn't it have to check whether the value is a number then?
 
10:24 PM
huh.
 
@dzaima I think that's faster than always calling a function
Function calls in python are slower than checking type
 
:| so it's just going to be a pain to figure out when it's called
I'll try doing it later
 
ngn
@Adám here's a shorter one in apl: {⍺:{⍵:0⋄1}⍵⋄⍵}
 
@ngn Oooh.
 
@ASCII-only User-defined objects
Most "simple" types, it's optimized out anyway
 
10:27 PM
@Pavel i mean for integers
 
Oh, for integers I don't think it's ever called
 
@Pavel I meant that even if __bool__ wasn't called if the value was a number, it'd have to check if the type is a number (which is a built-in)
 
@ngn Dang.
Whenever I get RAD up and running ⍺:{⍵:0⋄1}⍵⋄⍵ (imagine s are newlines, and ⍺ and ⍵ should be the greek values, not APL)
 
@H.PWiz I found a 30 byte version which runs with import Prelude (print,Bool(..)) in the header.
 
@ngn Shorter: {⍺:1 0[⍵]⋄⍵} (⎕IO←0)
 
ngn
10:31 PM
@Adám it looks so obvious now, why didn't I think of that :)
 
I'd have thought that array access counts as a builtin
 
@ngn Branch-less (but longer) solution: {⍵(1 0[⍵])[⍺]} (⎕IO←0)
 
@Pavel you don't think isn't good enough :P
 
@ASCII-only This isn't node.js, the python people are actually smart and make good design decisions.
Calling __bool__ when you don't need to is dumb.
 
What differentiates between , [...], and then? Is one not a built-in because it has special syntax?
 
10:38 PM
@Zacharý Function, syntax, function.
 
Then how come + isn't allowed in languages where functions are called like f(...)? As someone has said before, no way this challenge is objective
 
@Zacharý Because operators are prohibited too.
 
I'm just glad this isn't a challenge type
 
@Laikoni hmm, I have 34
 
@Adám You can access it as /srv/usr/share/tio.run/languages.json, but there's no guarantee it will be up-to-date. The safest form is to look at the files inside. /srv/wrappers
 
10:54 PM
@Dennis the wrappers don't list the proper name, afaict.
 
Ah, you want the common name, not the ID. For that, there's only languages.json.
 
@Laikoni I've got 26 bytes
 
@ngn How does this work?
 
ngn
@Zacharý (0 1;1 0) is a vector of vectors, we index it with x and get one of the two 2-element subvectors, then we index that with y
 
You can index it like that?
 
ngn
11:01 PM
@Zacharý in k there are several equivalent ways to index: juxtaposition (x y), M-expression (x[y]), or with a verb (x@y)
 
o_O.
 
ngn
@Zacharý unlike in APL, two variable names don't strand
strands can consist only of numbers, for forming other lists you need parens and semis: (element0;element1;element2)
 
@DJMcMayhem My brute forcer.
 
ngn
@Zacharý also, in k there's no (syntactic) difference between calling a function, indexing an array, and looking up a value from a dict by key
 
@Dennis Thanks.
 
11:18 PM
anyone here ever used webrtc?
 
yes, I've made calls on discord x)
it's 4:20, anyone here in the same time zone?
 
@Pavel who says if accepts ints though?
 
11:46 PM
@ASCII-only Common sense
It would be super dumb if it didn't
 

« first day (2678 days earlier)      last day (2166 days later) »