« first day (2285 days earlier)      last day (2566 days later) » 

12:02 AM
It's just an empty lambda
 
darn right it is :D
 
12:13 AM
Oh god, another way to be scared by C++
What did they do to the poor lambdas
 
what's wrong with them?
(on a side note I can probably make you fear any language, or at least my use of that language)
 
They're weird
@ConorO'Brien Some langs, like PHP and JS, are just bad. C++ isn't, but it is terrifying.
 
PHP and JS each have their own purpose. They're hardly worth calling "bad"
 
Yeah, they have a purpose, but they could have been implemented to fulfill that purpose in a far better way.
 
Just because a language can be better, doesn't mean its bad. All languages can be made better. Perhaps some more so than others. Each language excels in certain areas, enough to make it a good language. Where PHP lacks in consistency in function naming, e.g., it makes up for this lack with an intuitive programming style. Where JavaScript lacks a decent type system, it makes up for it with (e.g.) asynchronous functions
There are few truly bad languages. Those are the ones for which the creator cared little about the language itself and had no vision for it. I have yet to find a language that is "bad". Some languages are worse than others, but beyond this there is no objective "worst" language.
 
12:27 AM
To be fair JS's flavor of asynchronicity is very narrowly focused which is why some people don't like it
 
1
Q: Decompose a number into triangles

DoorknobGiven an integer n, decompose it into a sum of maximal triangular numbers (where Tm represents the mth triangular number, or the sum of the integers from 1 to m) as follows: while n > 0, find the largest possible triangular number Tm such that Tm ≤ n. append m to the triangular-decomposition ...

 
I can see that. it's a nice thing to have in a browser tho, even if narrow
 
> Recompose a triangle into numbers
 
12:40 AM
@Doorknob Maybe that shouldn't say the sum of maximal triangles since you're doing a weird concat instead :/
 
@Geobits Well, outputting the sum itself would just reduce the challenge to writing a cat program.
 
Yeah... but it's still a really weird way to say you're doing some symbol-based strings.
Or base-36 if you like that better
But it's definitely not a sum
 
It does represent a sum, though.
 
Well so does 35. It's the sum of 17 and 18. I don't generally call it that though :P
 
35 also represents a product!
 
12:51 AM
No no, it's clearly a quotient.
 
I prefer to think of it as a root
 
35 is a very interesting number.
3
 
I just think it would read better like this:
> Given an integer n, decompose it into a sum of maximal triangular numbers (where Tm represents the mth triangular number, or the sum of the integers from 1 to m) as follows:
 
35 is part of 34413 OEIS sequances.
 
CMC: find any N that is part of N OEIS sequences.
 
12:55 AM
Is there not a sequence for that? :P
 
one moment
It'll take a while but just started a script
Think I'm getting ratelimited
Probably should increase the sleep
 
Why does this output 2?
 
Because 05AB1E likes 05ab1e too?
 
7
A: The RATS sequence

Adnan05AB1E, 6 bytes Code: $FDR+{ Explanation: $ # Push 1 and input F # For N in range(0, input) D # Duplicate top of the stack R # Reverse top of the stack + # Add top two items { # Sort top of the stack # Implicitly print top of the stack This also ...

> This also works with a 0 byte program
 
@Geobits That would be a narcissist (sorry, it's in CJam)
 
1:18 AM
I went to load codegolf.stackexchange.com and got "It was not possible to perform this tag search at this time due to an unexpected error." Did anyone else get that?
Reloading fixed it though
 
@ETHproductions It was loading weird for me a bit ago
 
1:36 AM
@ConorO'Brien Working my way through the 400s so far
Judging by the data I'm seeing so far the answer is probably around the 1000-3000s
 
By the way, what is Dennis's m?
 
@quartata you're doing this manually?
 
No script
but OEIS is very heavily rate limited
I'm sleeping for 2 seconds before every search
 
Wow. It takes me a lot longer than 2 seconds to fall asleep.
 
I wish I could sleep for 2 seconds.
 
1:45 AM
*no, it's a script
*the script is sleeping
 
1:56 AM
@Doorknob it takes me about a half hour on a good night
 
6 hours ago, by DJMcMayhem
Chat Mini Challenge: Print this: Try it online! (the output not the code obviously)
a CMC that got ignored
 
Looks like it was done when posed :P
 
just 2 submissions
 
No I mean he did it himself, so nobody else needed to
 
oh heh
I thought CMC's are to be answered in many languages
 
2:19 AM
CMC: given an input consisting of printable characters, print a quine containing that input.
@DJMcMayhem have you ever done quines in V?
 
@LeakyNun i.e. payload capable quine (or whatever it's called)
also, a quine in the same language?
 
@MistahFiggins sure
 
@LeakyNun Lua, 84 Bytes. Try it online!
 
@ATaco surely you can use print instead of io.write (I know, trailing newline, but meh)
 
are there any restrictions on what the input can be? i..e. can we assume no null bytes and/or quotes?
 
2:28 AM
I can, but I prefer to be accurate.
 
@MistahFiggins read the question again
 
@MistahFiggins Only Printable Characters.
 
ah
can we read from the source code?
 
I assume the quine needs to be a valid quine.
 
2:31 AM
well, if it does, then befunge is dead: It can't read from the source code so it has to use quotes, which can be circumvented by quotes in the input
 
17
Q: What counts as a proper quine?

AJMansfieldThe basic definition of a quine is a program that, when run, produces its own source code as output. There are a number of techniques and a number of way to implement those techniques across a number of different languages. However, not all quine programs are equal. Clearly, any quine in HQ9+ or...

 
@ATaco alright.
 
@LeakyNun containing the characters, or the string in order?
 
@ConorO'Brien the string in order
 
hm ok
@LeakyNun doesn't work if there's a " in the input
 
2:36 AM
alright, the input will match the regex /^[a-z]+$/. @MistahFiggins @ConorO'Brien
 
oh ok
 
1
A: Golf you a quine for great good!

DJMcMayhemV, 4 bytes (Non-competing) 2i2i Try it online! Marked as non-competing because this language postdates the challenge by several years. Explanation: 2 " Two times: i " Insert the following: 2i " The string '2i' This is pretty straightforward. In fact, this almost works in ...

 
@DJMcMayhem oh heh
 
Which reminds me that RProgN2's q function is the most strange one I could think of.
 
Stacked, 23 bytes (works for any input) '@repr:!out'\repr+:!out
 
@ConorO'Brien "input"
 
36 bytes, befunge-98
 
@ConorO'Brien why?
 
why what?
 
2:44 AM
why is that valid?
@MistahFiggins that's nice
 
... why wouldn't it be?
 
@ConorO'Brien your supposed input is in your header
 
yes
that's allowed by default
 
by whom?
 
"programs may take input and leave output on the stack"
by ppcg
 
2:45 AM
ok
 
I forgot about the output part so that makes 17 bytes
 
If we were allowed invalid quines, RProgN2, 7 Bytes. "q%q["F
 
@ATaco why is that invalid?
 
The quine that output takes the form of, what is essentially q
Which is a function that returns the currently running program as a function.
Which RProgN then formats to look conveniently exactly like the input.
(I say conveniently, because it did actually construct that string from the compiled input, it doesn't technically have true knowledge of it's own code)
Alternatively, "{']C'.%q[}]C"F is valid, for 15 bytes.
@ConorO'Brien Your move, Stacked.
 
does that support all strings?
or just a-z
 
2:59 AM
It supports all strings that don't contain a "
^[^"]*$
 
how many bytes to support strings that have "?
 
To perfectly match the challenge, impossible. Because then the string would have to either be escaped, or broken up some other way.
Although, at least your Stacked answer fails on strings containing a ' literal. So I don't feel like I'm falling behind.
I really hope that wasn't stared because of TeamSpirit
 
wait, it is possible to do befunge-98 with all strings (bar those tricky newlines)
 
Is {} a valid quine in GolfScript?
 
Nope, Single Literal.
Nor is {nop}
{"_~"}_~ is fine however.
 
3:14 AM
~_~
 
user165474
@LeakyNun I think I finally figured out how you got your username (I'm slow, I know :P)
 
@HyperNeutrino how? (how did i get my username and how did you figure it out?)
 
user165474
Kenny Lau -> Leaky Nun (anagrams)
 
where did you see Kenny Lau?
 
i.gyazo.com/9d9217d3ad9d0d294f056a189ab1bb4c.png When you're on windows, but your Fedora Autolocks.
 
user165474
3:16 AM
You edited the Jelly Wiki and it showed "Kenny Lau edited ... hours ago`
 
user165474
:D
 
@HyperNeutrino oh lol
 
user165474
:P
 
user165474
And I remember someone calling you Kenny once so I figured that it couldn't be a coincidence.
 
user165474
:P
 
3:17 AM
lol
 
user165474
And then there's the one time someone figured out my name by going into my profile and going to my github profile :P
 
oh wait
 
I've not been subtle about my name for some time now.
 
@HyperNeutrino where on earth are you from? Your timezone seems USA but then your surname
@ATaco what on earth is your surname?
 
Lemon, Like the Fruit.
 
3:20 AM
how?
 
user165474
I am Chinese by ethnicity, but my parents immigrated to the US a while ago, and I was born in NY state. I live in Southwestern Ontario, and I've been living in this same place for 11-some years.
 
Do you speak Chinese?
 
user165474
Yes. But I don't read/write it because I never learned.
 
which dialect?
 
user165474
Well I think it's just standard Mandarin, kind of a bit between Beijing and Nanjing (where my parents are from).
 
3:22 AM
well pinyin is easy
 
user165474
True.
 
can you read/write pinyin then?
 
user165474
I can kind of write with the help of Google Translate using pinyin :P
 
user165474
Yes.
 
hao3
 
user165474
3:23 AM
wo3 tong1 chang2 bu2 yong4 shu4 zi dan4 shi4 zai4 zhe4 li3 da3 zi4 mei2 you3 gen4 hao3 de ban4 fa3 :P
 
user165474
I hope I did that correctly.
 
geng4 not gen4
 
@LeakyNun Well, it derives from the name "Leemon", and these things happen.
 
user165474
Oh, I see. Thanks.
 
@ATaco I see
 
user165474
3:25 AM
So you're the original Lemon?
 
Welp, my native language is Cantonese not Mandarin, so...
but I can speak Mandarin as well
 
user165474
Oh I see. I can't understand/speak any Cantonese at all :P
 
user165474
Where are you from?
 
HK
 
user165474
I see.
 
3:25 AM
Even though I'm a Lemon, I'll always be a taco.
 
user165474
Lemon Tacos :D
 
 
user165474
So wait you're 12 hours ahead of me? (2327 for me)
 
@HyperNeutrino yes
 
user165474
I see.
 
3:28 AM
I'm 14 hours ahead right now.
 
user165474
I see.
 
user165474
So you're somewhere in Japan/Singapore/Australia/wherever?
 
Australia, Melbourne.
 
user165474
I see.
 
user165474
Yay decent guess :D
 
3:29 AM
@ATaco heh, I thought we got another Asian here
@ATaco do you golfscript?
 
I do not, sorry.
 
;_;
 
3:44 AM
k-meansified
 
user165474
What is k-meansifying
 
Posterizing it based on how close in color each pixel is to one of k=5 randomly chosen pixels (en.wikipedia.org/wiki/K-means_clustering)
 
user165474
Ah. I see. Interesting.
 
4:28 AM
Hey guys I'm implementing a new esolang and I need a memory model. Any suggestions?
I'm looking for something simple but not overdone
 
@WheatWizard A value may be passed through the program but not stored for later use.
 
@Phoenix Could you elaborate I'm not seeing it.
 
Tacit, like Jelly.
 
@Phoenix is "tacit" a memory model?
 
By itself, no, but the 'Like jelly' part qualifies it.
 
4:32 AM
I haven't programmed in Jelly for much longer than an hour so I don't remember how Jelly does memory management
 
@WheatWizard You don't store values, each command returns a value immediatly consumed by the next one.
 
Actually I think you can store a single value in a register, but that's not important.
 
Unfortunately I am designing a 2D language
 
Ah
BF-Like memory tape, but the tape is 2D
?
 
4:35 AM
Eh, takes too many commands to do anything
I just want to try to keep it simple, the language is already going to be extremely difficult to program in
 
You have a single array. You can append elements to it and access any element by index.
 
user165474
Question about Jelly: How do I map a dyad over a matrix? I have a matrix of pairs and I want to map every pair to its sum. For example, [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] gives [[3, 7], [11, 15]] @Dennis
 
@HyperNeutrino No clue; ask Dennis
 
user165474
Alright, edited him in with a ping
 
4:42 AM
@HyperNeutrino sum
"abc"[0][0][0][0][0] == "a"
 
user165474
Hm.
 
3 Colour pallet simplification
 
0
Q: Print a quine that contains the input

Leaky NunTask You will be given a string in the input consisting only of the characters from a to z, i.e. the input will match the regex /^[a-z]*$/. Your output should be a complete program in the same language, whose source code contains the input, and is a proper quine. Example Your program would re...

 
5:12 AM
That's a valid Quine, TMK.
 
Somehow it didn't work from my phone. Nvm. It was borked.
 
user165474
CMC: Write a program in Language A which takes in a string and determines if it's a valid program in Language A
 
@HyperNeutrino Actually: 1 Byte. 1
By Design, all strings are valid Actually programs.
 
user165474
lol
 
user165474
:P
 
5:22 AM
Define "Valid"
 
Actually doesn't throw errors.
 
user165474
...
 
"All strings are valid programs. There is no such thing as a syntax error, and anything that appears to be a runtime error is actually a no-op (NOP)."
 
user165474
Haha. When you don't want to deal with errors.
 
user165474
tfw you have this one user that was last seen a few seconds ago and last talked 122 days ago :P
 
5:25 AM
what if the program does not halt?
 
user165474
Um. Good point. Let's say that you may assume that running it would cause it to halt in finite time, either because it stops normally, errors, or just isn't valid and causes compiler errors
 
my code still wouldn't work because the program may print stuff lol
my idea is try:eval(x);print(1)except:print(0)
 
user165474
lol true
 
user165474
Anyway, I'm off to bed now before I die from death. Bye everyone!
 
"die from death"
 
user165474
5:31 AM
Mhm.
 
user165474
Because, you know, that is very descriptive.
 
Potentially, but a runtime error wouldn't be caught.
The trick is to be picky about your IO.
Note that pcall is localized to avoid the program pcall=3 (or similar) having any effect, and it's a function, so only it can control it's IO. Implementation may cause issues, but that doesn't effect the challenge.
 
trivia: in TIO, the current file is .code.tio
 
5:52 AM
CMC: given two coprime integers x and y, output two integers a and b such that ax+by=1
 
Anonymous
@HyperNeutrino It was less out of laziness and more out of versatility for golfing
 
Anonymous
 
Anonymous
RIP :(
 
@Mego that happens
 
Anonymous
Just because I downvoted one answer :P
 
Anonymous
5:59 AM
My inner Geobits has its downsides
 
clarification: x and y are positive
Jelly, 14 bytes:
×S=1
Nrp`çÐf,Ḣ
 
6:15 AM
 
@Dennis oh, dot product.
CMC: output the n-th iteration of the "reverse-and-add" operation on 196.
196 -> 887 -> 1675 -> 7436 -> ...
 
@LeakyNun 12 bytes
 
6:30 AM
def f(n,x):
 y=str(x)
 if n:
  return f(n-1,int(y[::-1])+int("1"*len(y)))
 else:
 return x
 
Anonymous
@LeakyNun Also 12 bytes
 
How do you do ternary in Python?
Is it and, or?
 
Anonymous
Normal way is true_output if condition else false_output
 
Anonymous
Golfy way is condition and true_output or false_output
 
Even better is [false_output,true_output][condition]
 
Anonymous
6:34 AM
And by "golfy" I mean it usually only saves one byte
 
but sometimes the golfy way doesn't work (brcause python is not lua)
 
Anonymous
@ATaco Downside: both statements are evaluated before the condition, so you can have unwanted consequences
 
Such is life.
 
Anonymous
With numerics you can usually do some clever tricks for even shorter
 
@wizzwizz4 surely you can do better than that
 
Anonymous
6:36 AM
Like true_output*condition or false_output
 
@LeakyNun Yes, I can. I golfed most of the logic though.
 
I don't understand what the 1*len(y) is for
 
Lua 5.3 recently allowed true_output*number_literalor false_output
 
Anonymous
For Python (2) I'd do f=lambda a,b=196:a and f(a-1,b+int(`b`[::-1]))or b
 
Anonymous
Fails for longs though
 
6:38 AM
that is better
 
def f(n,x=196):
 y=str(x)
 return n and f(n-1,int(y[::-1])+int("1"*len(y)))or x
 
@Mego oh heh
 
@LeakyNun It's not 1*len(y); it's int("1"*len(y)), i.e. 1111 for y="1234".
 
Anonymous
Even shorter: f=lambda a,b=196:(a>0)*f(a-1,b+int(`b`[::-1]))or b
 
Anonymous
Wait no that's the same length
 
6:40 AM
`b` is golfy str(b)?
 
Anonymous
`b` is repr(b), which is mostly the same as str(b)
 
Anonymous
But for a few specific cases (strs, longs), it's not
 
@wizzwizz4 I know, but why?
@Mego 0*expr is short circuit?
 
Anonymous
@LeakyNun Oh right, it needs to short-circuit
 
Anonymous
So that other way won't work
 
6:43 AM
hi guys. I put some hints on my puzzling.se post
 
Anonymous
f=lambda a,b=196:a and f(a-1,b+int(`b`[::-1]))or b is the shortest for 2 with only ints, f=lambda a,b=196:a and f(a-1,b+int(str(b)[::-1]))or b works in both 2 and 3 with abitrarily-large integers
 
what about pure arithmetic?
well, java would benefit from pure arithmetic
 
5
Q: What does it want?

Destructible LemonSo, I found this image. I feel like it wants something You might wanna go ahead and download the image, because it will be useful to be able to scribble around on the image for counting and stuff. It won't mind What does this image want? Hint plus one more hint P.S. The puzzle is all i...

 
6:58 AM
CMC: square a positive integer
 
Anonymous
@LeakyNun ²
 
Javascript: x=>x*x
 
try to do it in a language where this isn't obvious
 
... drat
 
Anonymous
Nah
 
Anonymous
6:59 AM
Closed as off-topic because underhanded
 
try to do it in Brain-flak
 
Snails (unary input, decimal output): A\nt
\n is a newline.
 
Haskell: q x=sum[x|_<-1..x]
 
That's just the first thing that comes to mind, I'm sure it could be shorter
Wait, this is way neater: (({})<>)({<({}[()])><>({})}{})
 
@JanDvorak How does that work, it sounds like it would equal x(x+1)/2.
 
7:05 AM
It sums x for _ in 1 .. x
I think I'm missing square brackets though
 
Exactl my point.
 
@JanDvorak You need brackets around the range: [1..x]
 
@DJMcMayhem try summing the odd numbers
 
@LeakyNun Last entry: ({({})({}[()])}{})
 
@feersum _ goes from 1 to x, not x.
 
Anonymous
7:06 AM
Oh
 
Anonymous
I'm an idiot
 
Okay
 
Anonymous
It's sum(x for _ in range(1,x+1)), not sum(range(1,x+1)). I completely misread that.
 
Strange ways to loop in your language: RProgN2, 1q;
 
@LeakyNun I thought we were meant to add one to each digit.
 
7:10 AM
@wizzwizz4 why?
cmc: do my 196 challenge in UGL
 
47 mins ago, by Leaky Nun
196 -> 887 -> 1675 -> 7436 -> ...
 
196 + 691 = 887
887 + 788 = 1675
 
@LeakyNun Now I understand.
 
problem?
 
Anonymous
Now I don't feel so bad for messing up the math
 
7:12 AM
I guess nobody here even knows what UGL is
btw where is mars ultor gone?
 
Anonymous
Lots of name changes, I forget what their name is now
 
I think it is somebody1234 now
 
@KritixiLithos oh hi
 
Anonymous
This is why frequent username changes are annoying
 
I might occasionally for a joke; but I usually stay Taco, and I will always be Taco.
 
7:17 AM
@KritixiLithos aka ASCII-only
 
@Adnan would you do my CMC above?
I think oasis can't do it
 
Side note: Blue team doesn't appear as competitive as Red Team, curious.
Not that it matters with Mego's stickied 25 stars.
 
@LeakyNun 05AB1E, 7 bytes: 196IFÂ+
 
Anonymous
Well once there's enough time passed for people to have an opportunity to give feedback on the new Chatiquette, it'll be fairer
 
@LeakyNun nope, oasis doesn't have reverse
 
7:22 AM
@Adnan it isn't even turing complete
 
8:02 AM
0
A: Sandbox for Proposed Challenges

SisyphusEscape the REPL Jail cops-and-robbersrestricted-source In this game of cops-and-robbers, each cop will write a program which will exectute and lock down the language environment before dropping into a REPL. However, the cop must secretly allow a way to read a flag file from the locked down en...

 
8:54 AM
I swear I've seen a stackoverflow chatroom for Python but I just can't find it now
 
Anonymous
There's several of them iirc
 
Anonymous

 Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
 
last message 12 minutes ago? why didn't that show up when i typed "python" into the search, or filtered by stackoverflow.com?!
 
Anonymous
Probably because you were looking on chat.stackexchange.com and not chat.stackoverflow.com
 
Anonymous
There are two different chat servers with different rooms and mods. It's extremely confusing
3
 
8:57 AM
oh you're kidding me
agreed, that is confusing
I thought chat.stackexchange was the "hub" where you could filter by individual site
 
Anonymous
Yep, it is. Except for SO rooms, which are on their own server.
 
ah
thanks
 

« first day (2285 days earlier)      last day (2566 days later) »