« first day (2568 days earlier)      last day (2275 days later) » 

Anonymous
3:00 PM
It's matrices all the way down
 
-2
Q: Sorting for search by monotomy

fgrieuStatement Given distinct integers, output them in order such that the jth output is larger than the (j/2)th output if and only if j is odd, for j from 2 to the number of given integers. This is a code golf. Output shall be in decimal, with some separator. 2 to 99 non-negative distinct integers ...

 
@Adám Yeah excuse me, I was just confused
 
@Mr.Xcoder I'm not sure I understand. Is this what you mean by 4D?
 
@user202729 true
 
3:21 PM
tio's down?
 
No.
 
@totallyhuman Nope.
 
D: did my school block tio
 
One of the servers is currently being rebooted by DO. Didn't take it offline in time.
 
oh thank goodness no
oh i just realized matlab's not on tio ;-;
 
3:24 PM
... because it is not free?
 
yeah
but i think a cop's in matlab... but matlab's not legal on tplq
 
Unless they offer me a free license, that's not going to change.
 
0
A: The Programming Language Quiz, Mark II - Cops

iczero???, 43 bytes a:=[];for(n:=1;n<101;n:=n+1)a:=append(a,n); I hope this isn't too easy

 
Tell them that languages must be free.
 
0
A: Sandbox for Proposed Challenges

AdmBorkBorkFormerly Composite Numbers code-golf sequence primes Construct a sequence of positive integers a(n) as follows: Each new successive term must be the smallest number that 1) is itself composite, 2) is larger than the previous term, and 3) when you add the new term to each of the previous terms p...

 
3:26 PM
(even languages which can only be run on Windows may be considered not free, there is a AHK submission)
 
@Dennis May it will sway them if they are made aware that Dyalog and Wolfram have granted you permission to put APL and Mathematica on TIO for free?
 
Some people just think that Windows is free. (is it? I think the non-registered version only has the annoying watermark)
@Adám If they somehow get to know about it.
19 hours ago, by Pavel
@PhiNotPi Wolfram Research reached out to Dennis. To date, we're not sure how Wolfram Research found out about TIO.
 
I honestly dislike the idea of paying for a programming language. For Mathematica or MATLAB, it's understandable, because they're DSLs made for a specific task. APL seems a little out of place there.
 
@user202729 Right, and Dyalog also reached out to Dennis.
 
DSL? Domain specific language?
 
3:29 PM
Yea
Mathematica and MATLAB are DSLs intended for mathematics and computational research (or whatever the term is)
 
@moonheart08 And APL?
 
APL is more of a general purpose language in my opinion.
 
or maybe it's not matlab
confusing docs o0
 
@moonheart08 I'm happy to hear.
@totallyhuman Maybe what isn't MATLAB?
 
0
A: The Programming Language Quiz, Mark II - Cops

iczero???, 43 bytes a:=[];for(n:=1;n<101;n:=n+1)a:=append(a,n); I hope this isn't too easy

 
3:32 PM
The submission.
 
might be mupad
 
I tried computer brute force all programs with length < 5 and consists of only characters:
('ṡ', '€', 'Z', 'Ẏ', '⁸', '⁹', '⁹Ƥ', '⁺'). No solution.
 
iczero's submission. I think he did a good job (I know what it is, but i know because he told me, so i'm entitled not to tell :P)
 
Apart from Dennis' answer it also found ṡ€Z⁹Ƥ as a 4-element.
 
And now it's been deleted. I wonder if the OP is going to sandbox it, or just abandon it.
 
3:42 PM
(it = NMP)
 
Yes, sorry, I could've been more clear on that.
VtC my statement as unclear.
 
After 506 seconds I get all the possible results of 6 or 7 bytes: (5 of the
('ṡ', '€', 'Z', 'Ẏ', '⁸', '⁹', '⁹Ƥ', '⁺')):
code: ṡ€Zṡ€
code: ṡ€Z⁹⁹Ƥ
code: ṡ€Z⁹ƤZ
code: ṡ€Z⁹Ƥ⁹Ƥ
code: ṡ€⁹Z⁹Ƥ
code: ZZ⁹Ƥṡ€
code: Z⁹⁹Ƥ⁺€
code: Z⁹Ƥ€Z⁹Ƥ
code: Z⁹ƤZ⁹Ƥ€
code: Z⁹Ƥ⁺€Z
code: Z⁹Ƥ⁺⁹Ƥ€
code: Z⁺⁹Ƥṡ€
code: Ẏ⁹Ƥ€Z⁹Ƥ
code: ⁸Z⁹Ƥ⁺€
code: ⁸⁹Ƥ€Z⁹Ƥ
code: ⁹⁹Ƥ€Z⁹Ƥ
code: ⁺ṡ€Z⁹Ƥ
code: ⁺Z⁹Ƥ⁺€
(which passes one, not all, test case)
Some of them looks very weird, I wonder why they don't error out.
CMC: Given Mathematica matrix format of second argument of Flatten output a string of Jelly code of Z, , with the same behavior.
 
can i ask a geometry question here, we've been discussing it with some classmates for almost half an hour
 
Sure, I like geometry.
I'm sure I'm not alone.
 
1 sec
i.stack.imgur.com/GVexH.png how many chords that pass through P have an integer length
 
Anonymous
3:50 PM
@betseg The radius is 5
 
@Mego :O
 
Well, the longest chord is straight through the diameter with length 10, right?
 
probably
 
No, it is, you can't get a longer chord than through the center.
 
ye
 
3:55 PM
The shortest chord would be perpendicular to your line, passing through P.
Is that an integer length chord?
 
i think it's 8 units
3-4-5 triangle
 
Anonymous
@betseg The chord's length must be in [8, 10]. 10 is the diameter which passes through P (the extension of the radius given in the image), so that's one. Using trigonometry, we can see that the shortest chord has length 8.
 
Right
 
Anonymous
So the question is, is there a chord of length 9 that passes through P? Since sin and cos are continuous, the answer must be yes. So, there are exactly 3 chords with integer length that pass through P.
 
Four chords
 
3:59 PM
2 9s
 
Anonymous
Oh right, I was counting distinct lengths :P
 
ty
 
The hidden thing behind Mego's statement is the Intermediate Value Theorem
 
Anonymous
@AdmBorkBork Yep. I handwaved over it because it's so trivial and intuitive :P
 
lol
 
4:02 PM
I didn't know it even had a name
 
Anonymous
It comes up a lot in calculus
 
Anonymous
And it's also proven using calculus
 
I love the intermediate value theorem
It helped while proving that my brother was 5 years old at some point in his life
 
Anonymous
I love that it's so intuitive, but it still requires calculus (in the sense that an epsilon-delta proof is calculus) to formally prove :P
 
gotta say though... nothing in math comes close to the pigeonhole principle
that bad boy is a work of art
 
4:08 PM
Just posted my 4th challenge in < 48 hours. Get hype!
 
One minute you're having some nice discussions about discrete math
The next you're talking about birds
 
Should probably do something with best-of
Now that voting has closed, and all
 
#PhiPhlood2018 (pronounced "flood" not "flued")
 
Anonymous
@Poke The fact that it has such a silly name makes me happy
 
@PhiNotPi Killing your progress toward Socratic
 
4:11 PM
@Mego I loved listening to my professor describe it in school
it made me laugh
 
@AdmBorkBork Yeah maybe I should space them out more.
 
"Suppose we have n pigeonholes and and n+1 pigeons"
 
@PhiNotPi Especially if you're also going to beat DJ like I am ;-)
 
@Poke If you talk with a Russian mathematician, he'll call it Dirichlet's Principle, as if something so simple needs to be named after someone.
 
Anonymous
There are hundreds of better options for formal-sounding names for the PP (including the Schubfach Principle, the Tiroir Principle, Dirichlet's Inclusion Principle), but yet everyone still calls it the Pigeonhole Principle
 
4:13 PM
Man, I spelled Dirichlet way wrong
 
Anonymous
Yep :P
 
i think discrete math and linear algebra were my favorite math classes in college
they were a ton of work, though
haha
 
Anonymous
Also Dirichlet's Principle is something quite different: en.wikipedia.org/wiki/Dirichlet%27s_principle
 
Can someone ELI5 the point of linear algebra? Whenever I think of "linear" I think of y=mx+b but something tells me it's more complicated than that.
 
@Poke I felt like dying the first week of college with Discrete Maths
 
4:16 PM
@Pavel linear algebra = matrices
 
@Pavel If you want to do anything in higher mathematics, you need Linear.
 
but then again, my professor was Italian, didn't speak a word of Portuguese and assumed everyone in the class (of freshmen!) had 4 PhDs like him.
 
Anonymous
@Pavel Linear algebra is the branch of math concerning linear equations and systems of linear equations. A linear equation has the form a_1 * x_1 + ... + a_n * x_n = b
 
Anonymous
(a linear combination of unknowns)
 
There we go, I knew it had to be harder than Algebra I :P
 
4:18 PM
that's more than 5 year old english
 
Anonymous
y = m*x + b is a linear function of one variable. It's still technically linear algebra, but it's the second-simplest example of a linear equation.
 
"linear algebra makes you know many things, if you only know one thing"
@Mego third simplest I think
y = x, but y = c is techinically one too isn't it
 
Although we never covered matrices in Algebra I. We were supposed to, but, "You'll cover this in Algebra II, so we're skipping it." In Algebra II, "You covered this last year, so we're skipping it."
So I still don't know how matrices work properly.
 
lol
 
Anonymous
@Riker y = x is still a univariate linear function. The only simpler kind is a constant function.
 
4:19 PM
it's not like they cover much about matrices tho
 
lol
 
@Mego ah ok
@Pavel tl;dr; 2d rect arrays in pretty much every way
 
I haven't needed them since, so I'm just going to assume I would have forgotten all about them by the time I got into linear algebra anyway.
 
3
Q: Verify Cyclic Difference Sets

PhiNotPiA cyclic difference set is a set of positive integers with a unique property: Let n be the largest integer in the set. Let r be any integer (not necessarily in the set) greater than 0 but less than or equal to n/2. Let k be the number of solutions to (b - a) % n = r where a and b are any member...

 
@Riker *2D rectangular arrays
 
4:20 PM
ftfy
 
Anonymous
@Pavel Matrices are 2D rectangular collections of values. They're mostly used to represent systems of linear equations, and by Adám to golf his APL code.
 
Anonymous
You can also generalize a lot of algebra and calculus to matrices, but it's usually not worth the effort.
 
I can't even generalize multiplaction to matrices
 
Anonymous
For example, a lot of functions that are injective over reals are not injective when extended to matrices
 
Anonymous
@Pavel Let A be a n x m matrix, and B be a m x p matrix. AxB is the n x p matrix where each value is equal to the product of the corresponding row in A and the corresponding column in B (which itself is equal to the dot product of r and c_T, where r is the row from A, c is the column from B, and c_T denotes the transpose of c).
 
4:27 PM
This is generally explained with an illustration isn't it
 
Anonymous
Yes
 
I'll just look it up
 
Anonymous
[[a, b], [c, d]] x [[w, x], [y, z]] = [[a*w + b*y, a*x + b*z], [c*w + d*y, c*x + c*z]]
 
Anonymous
Multiply each element in the row in A by the corresponding element in the column in B, and sum the products. That's your element in AxB.
 
Anonymous
Matrix multiplication is not commutative, which throws off a lot of beginners
 
4:31 PM
It also has restrictions on the sizes.
 
CMC: given a list of integers, return 3 distinct values depending on whether the list is Strictly Increasing, Strictly decreasing, or neither.
 
Anonymous
@AdmBorkBork Yep, which I provided in the definition I gave
 
Yeah, just reiterating.
 
Anonymous
@DJMcMayhem Actually, 7 bytes: ;S;R2ǡ
 
Anonymous
Oh wait that doesn't satisfy the strictly requirement
 
4:36 PM
@Dennis what chef interpreter does TIO use? the python or perl one?
 
Yeah, I was going to dupe-hammer it as this one, but the strictly part makes it slightly different.
 
Anonymous
@DJMcMayhem Actually, 12 bytes: ;;S;R2╟íu@═*
 
@AdmBorkBork and the lack of monotone
 
@DJMcMayhem APL, 19 bytes: {(⊃t)×∧/2=/t←×2-/⍵}
 
Thanks @randomupvoter
@AdmBorkBork How do you dupehammer in chat?
 
4:39 PM
Doesn't monotone here just mean it's "always" strictly increasing/decreasing, which is implied in your CMC?
 
@Riker The Perl one. Clicking on the language name on TIO links to it.
 
oh, thanks
 
@AdmBorkBork Oooh, I thought it meant increasing or decreasing by one
 
4:43 PM
Hi.
 
@Adám doesn't that only work with 3-element arrays?
 
@DJMcMayhem Bold italics screamed in CAPITAL LETTERS
 
> Method found by DrMcMoylex.
 
@Dennis Who's that guy? What a weird name, geez
 
4:47 PM
Pyt, 7 bytes: ₋±Đ≡*0⦋
Returns 1 if strictly increasing, -1 if strictly decreasing, and 0 otherwise
 
Anonymous
Jelly question because I'm dense: suppose I have a dyad a with arguments x (left) and y (right). I want to call xay where ay is mapped over the elements of x. I thought it would just be xa"y, but that doesn't seem to work. What am I doing wrong?
 
xay$€ or xa€y
 
" zips. You want (each).
 
Anonymous
@cairdcoinheringaahing I thought I had tried that before, but apparently not. xa€y worked.
 
Got it right the first time :P
 
Anonymous
4:56 PM
@Dennis Ah, I was confused by vectorize in the docs.
 
If a vectorizes, you don't need the .
 
Anonymous
It does not
 
Anonymous
Ok, got that part working but I am limited by my lack of Jelly skills, the distracting pain in my shoulder, and my inability to focus caused by meds I took for said shoulder pain, so I'm going to stop trying :P
 
What are you trying to do?
 
Anonymous
Solve that CMC
 
5:09 PM
watches Dennis get a 5 byte answer
 
Lucky guess.
 
Wait, for real? You got a 5 byte answer? :D
 
@DJMcMayhem IṠf/Ḣ
If we can return arrays ([1], [-1], or []), I don't need the .
 
Okay I've never seen f/ before
 
does anyone have any idea how I could do comments with modgrammar? the main problem is that they'd get in the way of the parse tree
 
5:15 PM
Oooh, you're using modgrammar for Proton 2?
 
@Mr.Xcoder I think it gets the value in an array where all values are the same, otherwise it returns an empty array?
 
@cairdcoinheringaahing pretty sure it's just intersection of all of the sets
(sets/lists, same thing)
 
It's a 1D list.
 
5:16 PM
f promotes integers to singleton lists.
 
then caird's explanation is right
 
Yeah I figured that out
 
Yay, I understand some Jelly :P
 
Wait, you understand Jelly? I would never have figured that out! :P
 
@HyperNeutrino Only some Jelly :P
 
5:18 PM
lol
 
> 4 8 15 16 23 42
:D
 
Huh? What's special about those numbers?
 
They keep the world from exploding.
 
Now I'm even more confused
 
CMC: Shortest ambiguous sentence (by words) (i.e. there are two distinct grammatically correct interpretations with different meanings)
 
5:21 PM
@cairdcoinheringaahing oeis.org/A104101
 
I find it interesting how people here instantly ask questions and don't bother searching at all :p
 
@cairdcoinheringaahing I think you're just as lost as the numbers are :P
 
@dzaima I googled them, but the results just showed a blank Google Maps :/
 
@HyperNeutrino Latex, 5 bytes: A_2_2.
 
lol
I meant in English :P that's not really a sentence by most people's definition of a sentence
 
5:23 PM
@cairdcoinheringaahing Those numbers are very important
 
@cairdcoinheringaahing to me, if I want to know what a number sequence is, I instantly search OEIS. Though I was ninja'd by Dennis :p
 
I've been using them in my test cases for years
 
@HyperNeutrino English, 4 bytes: Fuck
 
@HyperNeutrino I can come up with "You there"
 
This community never stops surprising me...
 
Anonymous
5:24 PM
@cairdcoinheringaahing The numbers, caird, what do they mean?!?
 
hm I'm wondering if either of those are technically grammatically correct in any interpretation
 
the shortest I can come up with is 3 words
 
@Mego You shouldn't have used the numbers!!
 
@DJMcMayhem Empty :(
 
5:25 PM
i am thoroughly confuzzled
 
Anonymous
@HyperNeutrino It could be interpreted as either an imperative or an exclamatory sentence
 
They are common occurrences in Lost.
 
@DJMcMayhem user:me doesn't work rip? lol
 
@DJMcMayhem I get one result for me
 
@Mr.Xcoder Whoops
That's what I meant
 
5:25 PM
God, I loath Lost.
 
@Mego hm ok makes sense. lol that as an imperative though... xD
 
Note to self: Use those numbers in my next challenge :P
 
next challenge is a string challenge
Note to self: make a 104101 byte long OEIS-chaining submission
 
ಠ_ಠ I accidentally pressed esc and cleared the CMC I was writing. Goddamn SE chat
 
Note to self: make a 4815162342 bytes long program :)
And you cannot just undo with CTRL/CMD+Z :(
 
5:28 PM
sometimes I type a thing in chat and then try to Esc-R it
 
29
Q: Are you lost yet?

DennisYour task is to implement integer sequence A130826: an is the smallest positive integer such that an - n is an entire multiple of 3 and twice the number of divisors of (an - n) / 3 gives the nth term in the first differences of the sequence produced by the Flavius Josephus sieve. Lost yet? ...

 
@Dennis That's amazing. How have I not seen that before?
 
@Dennis 0/10 You don't give any kind of reference to the inspiration source :P
 
CMC: Given a positive integer n, output len(code) % n. However, adding no-ops to the end of your program should change the result for a constant value of n. You may not read your source file. Example: if your code is abcde and n = 3, you should output 2, but if you add 2 no-ops to the end to produce abcdeff, you should output 1
 
how are you meant to detect nops if you can't read your file
because nops don't do anything [by definition] lol
 
5:33 PM
¯\_(ツ)_/¯ Magic :P
 
Anonymous
Also good luck defining what a NOP is in a consistent, objective manner that doesn't involve non-observable requirements
 
jelly 0 bytes :D :P
 
I am pretty sure it is impossible.
 
^^^
 
oh wait but nops
ಠ_ಠ VTC as impossible and unclear and too broad
 
5:33 PM
@Mego A command that doesn't do anything, no matter what argument(s) it's given
 
@HyperNeutrino does jelly have noops?
 
@dzaima yeah, kinda. (Sometimes) Spaces
 
The identity function
 
there are some unused characters
 
5:34 PM
@HyperNeutrino They aren't no-ops, those are ub
 
@cairdcoinheringaahing that's not a nop, that takes in an argument and returns that argument
@cairdcoinheringaahing ok close enough
 
@HyperNeutrino ... Which is a no-op.
 
it doesn't do nothing. it still does something (BTW i'm just trying to demonstrate why it's hard to define a NOP really clearly)
 
But I agree that the identity function isn't a no-op.
 
@cairdcoinheringaahing This reminds me of something I've been thinking about recently... What would you (the community in general, not just caird) think about a tag? (Also inspired by my last challenge)
 
5:36 PM
For example: ¹Ƥ.
 
@Mego Good point :/
 
Do we really need a tag for it?
 
IMO covers that
 
Not necessarily, but there are a good number of challenges with that theme
@Mr.Xcoder I would disagree with that
 
5:37 PM
Canvas, 5 bytes: 5╴%PA - Canvas's only noop is but it isn't a noop after an ASCII character. Any unimplemented character pushes itself as a string, and there isn't anything like an identity function.
 
@DJMcMayhem then?
But quines disallow reading source code :/
 
@AdmBorkBork Ugh fat fingres
 
is fingres intentionally not fixed or just didn't notice
 
@Mr.Xcoder Quine is certainly much closer, but it doesn't cover it exactly. I'm not saying we need a tag to cover that exactly, it's just a thought at this point
@HyperNeutrino yes :P
 
5:39 PM
... and I've created a monstrosity. 358-byte one-line piece of code to recursively produce a list of mailboxes based on certain criteria.
 
... I've just created something even more monstrous: A language that transpiles to Python
 
Been there, done that :P
 
@HyperNeutrino That's awfully close to the flavour text of an Mtg card >.>
 
At least it's not a golfing language.
 
@J.Sallé [confused]
 
5:42 PM
@J.Sallé You're not wrong.
 
Magic: The Gathering?
 
:o didn't even realise it was J. Sallé. Nice new profile picture
 
Can a mod please unfreeze Proton Chat Room? Thanks
 
5:43 PM
lol :P I see
 
@Mr.Xcoder Thanks. It's a Fehu rune.
 
I've been searching that room for ages, but for some reason it didn't show up in the search results. Perhaps frozen rooms cannot be searched?
 
@J.Sallé Is your Avatar a dwarvish 'G'?
 
@cairdcoinheringaahing yes
 
Ninja'd
 
5:44 PM
@Mr.Xcoder You have to click "show frozen/deleted rooms"
 
Oh lol forgot to
 
BTW he have to use anti-freezers for Neutrino now...
 
@DJMcMayhem close enough. I think it might be a G in dwarvish, but the original rune sounds like an f
 
Can mods post messages in frozen rooms?
 
5:45 PM
@Mr.Xcoder I believe so
 
Riker seems to have done so in the Proton room, that made me curious
 
I'm considering starting a Core War hill for PPCG. All the other hills are dead and/or dying, and PPCG will probably be interested :P
Plus, i want to compete as well
 
@moonheart08 You keep saying that. Can you briefly explain core war?
 
The Wikipedia Page will do a better job than me.
 
> noted some similarities between Dwarves and Jews
 
5:47 PM
Issue i just thought of: Does pMARs even work anymore? I dunno if it's maintained. Core War is a mostly dead community (sadly)
 
@DJMcMayhem yup, that whole alphabet is based on Elder Futhark
 
@cairdcoinheringaahing I missed that
Is that bad?
 
I'm not sure :/
 
@DJMcMayhem it sounds like a badly-worded analogy.
 
5:51 PM
@Dennis would you mind unfreezing this? thanks
 
I don't think there's anything wrong with comparing a fictional race to a real ethnicity. Unless you're doing that to highlight a negative feature or stereotype, which it doesn't seem like Tolkien is doing
 
I will admit, the REDCODE documentation isn't really that good.
Hrm
 
looks so much like a jelly program :|
 
mislink?
 
CMP: Should Proton comments be nestable (/* /* stuff */ */) or not (/* /* stuff */)?
 
5:55 PM
Heh
gl;hf
 
@HyperNeutrino Nestable
 
I know what it is, but again, iovoid told me, so i can't say what :P
 
@moonheart08 me? no
 
Are there any production languages that do nestable comments?
 
@DJMcMayhem indeed. That's why I said it's a badly-worded analogy. Whoever wrote the article could've been more clear imo.
 
5:56 PM
@DJMcMayhem Mathematica IIRC
 
@DJMcMayhem Rust does.
\* \* this is a valid rust \* comment *\ *\ *\
 
if rust comments are * then how do you multiply
oic markdown issues :P
 
markdown </3
 
just give up :P
 
5:57 PM
> Tolkien noted some similarities between Dwarves and Jews: both were "at once natives and aliens in their habitations, speaking the languages of the country, but with an accent due to their own private tongue" (Letters, 176).
Doesn't seem badly worded to me
 
@DJMcMayhem Haskell
 
@DJMcMayhem Swift.
 
@DJMcMayhem Python, kinda (code # comment # nested)
 
that's not
no :P
nestable only makes sense if the syntax has an ending delimiter
 

« first day (2568 days earlier)      last day (2275 days later) »