« first day (4328 days earlier)      last day (507 days later) » 

12:00 AM
0
Q: CGAC2022 Day 5: Preparing an advent calendar

BubblerPart of Code Golf Advent Calendar 2022 event. See the linked meta post for details. It's time to prepare an advent calendar, but I've only got a large sheet of rectangular paper, randomly colored red and green like this: GRRRGRRGRG GGRGGGRRGR GRRGRGRGRG GGRRGRGRGG GRGGRGRGGG RRGRGRGRRG RRRGRGRGG...

 
 
5 hours later…
5:15 AM
howdy
 
5:47 AM
huh this is weird
the color of the 8, 20, 21, 16, 21 is black
I feel smth is wrong
 
 
3 hours later…
8:27 AM
0
A: Sandbox for Proposed Challenges

BubblerWhere are zeros? Self-describing sequence code-golf base-conversion sequence Background A167519: Lexicographically earliest increasing sequence which lists the positions of the zero digits in the sequence. 3, 10, 11, 12, 11000, 11111, 11112, 11113, 11114, 11115, 11116, 11117, 11118, 11119, 1112...

 
9:05 AM
tap tap tap Anybody here?
 
You have been warned before: "Sometimes, there isn't anybody talking in chat. That's perfectly fine. Don't send messages just because the room is quiet."
 
Next time, it'll be moved to the bakery.
 
@mousetail what bakery?
 
A fate worse than death
It's the spam room spam messages get moved to
 
isn't that OTTNB
 
9:17 AM
No, that's for off topic conversations
OTTTNB is purgatory, TN🍞 is hell
 
huh all this time I was thinking the bakery is the same as OTTNB
 
@mousetail ...maybe we shouldn't have made TNB have the same acronym as TNB
 
@mousetail The Nineteenth Byte is hell?!
 
I propose the acronym for the bakery be TN🍞
 
how about TN**🍞**
damn markdown
 
9:20 AM
are you cursing the bread?
I can't tell
 
TN 🍞
 
markdown does deserve to be damned
 
i was trying to italicise it
 
Can you evan italicise emojis?
 
you can't italicise an emoji
🍞
oh you can
you used ** instead of *
bold doesn't work
 
9:21 AM
What would a bold emoji look like?
 
i thought one asterisk was bold in SE chat
 
no
@mousetail bold
 
Bold assumption, can you back that up?
 
backing up emoji..
 
@JoKing that's the one bit of consistency chat actually has with normal markdown
 
9:23 AM
At least it's better than whatsapp markdown
 
Do not speak to me about that
 
now I don't know which service had the italics/bold backwards >.<
 
Or that one that has *...* bold and _..._ italic
 
In MarkDown's pre-rendering days, did people actually intend ** to mean specifically bold and * specifically italic, or were they both just random attempts at emphasising?
 
How could you intend bold without rendering? Both probably just meant emphasis
 
9:50 AM
Will there be a best post of 2022 award?
 
There'll be the best of code golf 2022 awards
 
Cool
I'd like to nominate myself for all categories
 
Speaking of which, the bountying from last year's awards never got finished lol
 
10:25 AM
Oh yeah that
Someone owes us 250 rep each
(and aaron)
 
10:53 AM
@emanresuA DSO is down
 
0
A: Sandbox for Proposed Challenges

mousetailDenoise a image code-golf There are various de-noising algorithms available. This question focuses on a specific one that preserves sharp edges but is also very simple to implement. Take 2 parameters, r and k, and a grayscale image. For every pixel, draw a r by r square around it and select all p...

 
11:37 AM
Um excuse me? Just i want to learn about how user defined functions are implemented in a (golfing language) interpreter (not transpiler), does anyone have an example language with this feature? thanks
 
basically, make an AST object that groups multiple AST objects into a single AST and execute each AST in that group AST in sequence when the function is called
 
12:18 PM
hello every
 
12:30 PM
hello
 
@lyxal can i just re-parse the function definition string with additional arguments placed in the symbol table? i don't know whether this is efficient because of recursion
 
For a golfing language, you probably don't need a symbol table
 
208
Q: Temporary policy: ChatGPT is banned

MakyenUse of ChatGPT generated text for posts on Stack Overflow is temporarily banned. This is a temporary policy intended to slow down the influx of answers created with ChatGPT. What the final policy will be regarding the use of this and other similar tools is something that will need to be discussed...

 
but this language (i'm trying to create) has variable definitions...
 
@SketchySketch those can just be stored in a hashmap stored in a context passed between every function
 
12:40 PM
I thought the idea is basically the same... I don't have much knowledge about this
anyway how is the efficiency using this "recursion" approach?
 
The parser only turns code tokens into AST objects. Sure, you can store all visited names in a data structure and make sure all names are valid, but in a golfing language, that typically isn't needed.
 
thanks
btw i think 05AB1E implements for-loops in basically the same way so efficiency would probably be fine
 
Is anyone here trying to output a googolplex?
 
print("a googolplex") (bad joke
 
nice try
I've finished a googol, now need to use it to make a googolplex
 
12:53 PM
See you in 10^100 milliseconds
 
see you in 10 milliseconds
base googolplex
 
Ok output (googleplex -1) in base googleplex
 
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
googol
what is the chars in base googolplex?
 
It's base googleplex so it should be just one digit
but what is the 10^100'th char
 
exactly what I'm asking
since you invented it you answer me
 
12:55 PM
That was the entire point of my question
 
digits don't have to be only a character
 
@mousetail I'm asking you
 
Ok they must be one digit at least
 
you can probably use the 10^100'th string available in UTF-8 in dict order
 
@UndoneStudios No, I asked you a trick question then you figured out what the question was
@SketchySketch How would you decide what part of a longer string is a "digit" or 2 digits?
 
12:57 PM
@mousetail No, I asked you a question that now you are trying to make me answer
 
0
A: Sandbox for Proposed Challenges

UndoneStudiosOutput a googol code-golfnumberkolmogorov-complexity Your challenge today is to output this exact number: 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 We call this a googol. A googol is 1 followed by a 100 zeroes, or basically just \$10^{1...

 
then reserve a character to separate digits)
 
This is my question
4 mins ago, by UndoneStudios
what is the chars in base googolplex?
 
My question was the same, just phrased differently to make the answer less obvious
 
1:00 PM
Why?
 
To make the answer less obvious
 
To make the answer less obvious
 
and mostly to prove that the base google system isn't actually very good
 
1:02 PM
> base google
 
@UndoneStudios Good challenges are hard to golf
 
@mousetail does that mean mine is good?
 
No
It's bad since it's already golfed.
 
besides it's just an example
 
why hello
why are you juicing avocadoes here
 
1:12 PM
Because why not
 
truly a beautiful response
 
@someoneinexistence because why not?
 
a master wordsmith
 
@UndoneStudios codegolf.stackexchange.com/q/252621/91213 this question was good
 
that was shit
I was wondering what to do abt built-ins
for a long time
 
1:14 PM
 
the winner won with… EXCEL?
NAAAAAANIIIIIIII?
 
that too is shit I had a non-observable requirement
@someoneinexistence no
 
Yea I'd remove the requirement
 
grettings
 
But answers where interesting at least
 
1:15 PM
@Ginger yes very
 
Better a unobservable requirement than a boring problem
 
well the most upvoted was excel
 
Why is that suprising?
Programing in excel is impressive IMHO
 
i’m scared
excel coders have dedication
 
It has a lot of random OP builtins
 
1:19 PM
but 05ab1e coders have more for having to walk through the entire unicode page just for one char
and, as far as i’ve seen, no op builtins
but i haven’t been coding in it for a while
 
@someoneinexistence never trust upvotes
 
I mean, we all know they cost 29 Kr nowadays…
 
Rule 23: A Scratch answer shalt always receive twice the upvotes than the Geometrical Mean of the other answers.
 
code question time
for 05ab1e people
I’m probably being stupid, but…
it makes it non-negative
despite the (
it’s probably something to do with the в command
 
2:17 PM
LDQ For slicing, is it better do do slice(start,end) or slice(start,length) for a golfing language
 
I think they'd probably be about equally useful, but start, end is going to be more familiar
 
exclusive end or inclusive end?
 
Exclusive ofc
 
I was told normal range should be inclusive
 
Ewww wtf
Exclusive makes things so much more convenient in so many places
With exclusive, if you want to do start, length, you can just do start, start + length. With inclusive, you need a - 1
Those little off-by-one inefficiencies literally appear all the time, and almost never in reverse
Plus with modular indixing (or just Python-style negative indices), you can do .slice(..., -1) to exclude the last element, whereas with inclusive it's -2 which is weird, and slicing to the last n elements you need to do -n - 1
 
2:29 PM
The idea was to avoid needing to do range(1,length+1) everywhere, since most challenges involving ranges start at 1
 
You should have that as a second range built-in
Ash had like six of them. That's overkill, but you can afford 2
 
arrays will probably be 1-indexed so I can reserve 0 for "not found" for indexing etc.
 
Oh then 1, inclusive makes sense yeah
 
2:49 PM
@someoneinexistence Well, just 0.023% of it :p
 
@someoneinexistence why does everyone refer to their maternal grandmother?!
 
3:11 PM
Morning yall
 
3:29 PM
CMQ: What features should Klein's git plugin have?
I don't really want to code a full-featured git GUI because I don't think that'd be a good use of my time, so I want to know what features you'd use the most so I can only add those
 
Make it a CLI that just prefixes git  to everything
 
ಠ_ಠ
 
oh wow adventofcode is fun
 
traitor
 
90% is text processing tho
 
3:37 PM
It gets harder later usually
 
3:55 PM
9 days till Winter Bash!
 
ayy
 
Hope they bring back the unicorn game
 
@RadvylfPrograms after further review of Complement's syntax, I have concluded that: I∈O is undefined behavior, I=O is probably an error, and I⇔O is a valid cat program
 
4:14 PM
Why is I=O an error
And what is
 
means either "if and only if" or "is equivalent to"
 
Not for sets though, right?
And why would = be different from
 
I=O is an error because in that context it's assignment; you'd be trying to assign stdout to stdin, which cannot be assigned to
 
Do sets have a distinction between "equals" and "is equivalent to"?
@Ginger Why is = assignment, why do you even have assignment
 
@RadvylfPrograms what kind of madman table was that
 
4:17 PM
@RadvylfPrograms because Complement programs are not limited to one expression
 
@parz It's 05AB1E's SBCS, listing the 256 characters it uses and how they map to bytes
 
you can assign the result of an expression to a variable and use it in later expressions
 
@Ginger Sure but how is that relevant
@Ginger Wouldn't = do that anyway?
 
@RadvylfPrograms that makes more sense
 
@RadvylfPrograms yes, that's what I'm saying
 
4:18 PM
You're thinking too imperatively
Assignment and equality are identical
I=O would not be an error
 
22
Q: CGAC2022 Day 1: Let's build a chocolate pyramid!

BubblerFollowing last year's event, we're doing Code Golf Advent Calendar 2022! On each day from today (Dec 1) until Christmas (Dec 25), a Christmas-themed challenge will be posted, just like an Advent calendar. It is a free-for-all and just-have-fun-by-participation event, no leaderboards and no prizes...

 
First CGAC!
 
first bountied CGAC
we're on day 5 :p
 
No, first CGAC was a few days ago, this is a bounty
 
i was on a cruise
it’s 1 december for me
 
4:20 PM
@parz ...in your office? :p
 
in my norwegian office
ues.
 
Your language isn't a set of statements to evaluate, it's a set of constraints on how some sets are related. Assignment is a statement, not a constraint.
 
yes
 
@mousetail fig has r, which is exclusive, and a, which is inclusive. both are very useful
 
@RadvylfPrograms so you're telling me that I do not understand the language I invented myself?
sounds about right :b
 
4:22 PM
@RadvylfPrograms yeahs thats how i understand it
 
You also don't need since it's identical to =. I=O would be the cat program
 
lets go to the room
 
4:45 PM
12
Q: Find the nth number where the digit sum equals the number of factors

The Thonnu(This is OEIS A057531.) Your task Given a positive integer, \$n\$, find the \$n\$th number where the digit sum equals the number of factors Explanation For example, let's take 22: Its factors are \$[1, 2, 11, 22]\$ (length: 4). Its digit sum is 4. This means that it is a number where the digit su...

 
0
Q: Solve using Strings in javascript

Haseebhttps://6793fdf6.widgets.sphere-engine.com/lp?hash=qEiqlbuLlB TREK You went on a trek with HEC(Himalayan Explorers' Club). The trek was to a very beautiful place known as Valley of Flowers'. For each step you took on the trek, you noted it down as U for Upward and D as Downward. ( Assume, these a...

 
@NewPosts doesnt look like spam, just a very poorly specified question
 
The link makes me think it's spam, though I can't tell where it leads
 
@RadvylfPrograms its a link to the source of the question, like where the problem came from
 
4:52 PM
dang didnt realize it was meta lmfao
just realized that
-_-
 
5:08 PM
lmaoooooooooooo
 
Didn't there use to be a seperate bot for new meta posts?
 
A separate feed yes, but for the bots, we've always had two, since three bots would be too much clutter
 
How does number of bots effect clutter?
 
They show up in the user list
 
Can't you make them join the room when they post then leave the room soon afterwards?
 
5:15 PM
Yes and no
But either way we decided that'd be just as dispruptive, if not worse
 
In fact, that's originally what they did
 
because they zoom in and out
 
I intentionally had to go in and make them stay permanently
 
wait until someone else leaves then leave at the same time so only one animation is played
 
5:38 PM
0
A: Sandbox for Proposed Challenges

JordanFind the representative submatrix code-golf matrix Note: This is a more limited version of a challenge from 2014 that only received one answer. That challenge required participants write two programs; this challenge is essentially one half of that. The text here is original, but credit for the i...

 
 
2 hours later…
7:10 PM
@lyxal Probably surge's fault, or someone's cdn going down. Appears to work now
 
someone pushed to production
 
7:34 PM
I have a... question? Maybe. I'm one of those people who still plays wordle and I am stuck... so I thought of what might be an interesting Code Golf but I thought I'd ask what y'all thought or if you'd seen something similar in the past. Essentially, it'd be a tool that takes the known "correct" letters and the remaining unguessed letters and spits out all of the possible iterations. To be less "cheat-y" it wouldn't have to remove the ones that aren't valid words, just list all strings.
 
IIRC we've had a few wordle-solver type challenges
 
So, the input would be two-fold, the known green letters and the unguessed letters. And the necessary output would be all possible permutations?
I looked at wordle questions but I only found four, that mention "wordle" specifically.
 
Yeah, you're right, there don't seem to be any that work like that
 
So it is the same as listing all permutations of a given set, only with the added, but unrelated, complication that they have to be merged into a template of already green letters?
 
Maybe? Not sure.
Is it better if I make it specific (solves only a particular example) or general (solves any example)?
 
7:38 PM
I can think of a few approaches you could take (generating all permutations then filtering based on the green letters, or filling in the green ones and finding permutations of the remaining spaces, etc.), could be an interesting challenge
 
@Catija I'd definitely go general, but make sure to use the sandbox.
 
And the fun part is that the green ones are technically still options - because you haven't necessarily eliminated them from be doubled.
 
@Catija General is typically better. If the challenge is for a specific instance of the problem, there's no good way to keep people from just finding the answer themselves then hardcoding it in some subtle way
 
7:50 PM
Me using regex to solve wordle:
 
0
A: Sandbox for Proposed Challenges

CatijaClutch Wordle Solver with known inputs Sometimes when you're playing Wordle, you get to your fifth guess and you can't figure out the word any more, so you start mentally running through the list of remaining iterations, both sensical and nonsensical trying to figure out what those last few lette...

 
Let me know if I made any obviously bad errors, omissions or whatever :D
Or if an example would be helpful? That might make it more clear.
 
"rejoin favorite rooms"
 
@Catija I think the alphabetical sorting doesn't really add much
 
It makes my brain happier.
 
8:13 PM
@Adám Would an example need to actually show the output or just the input and an explanation of what the output would look like?
 
The whole thing, maybe even, for one case, a walk-through of how the result is found.
 
... If I knew how to do that, I'd not be asking :P
I did update the draft with an example, which hopefully helps?
 
@Catija So this challenge is solely to help you cheat on Wordle? :P
 
I'm asking y'all to solve a problem I'm actually facing. I know that's not normal on CG&CC but it is sort of the usual reason people ask questions on SE. :D
Also, not cheat so much as... save me from writing it all out on my own.
 
Another possible input method is a list of words annotated in some way with the colors of their letters
You might want to allow that
 
8:28 PM
Ah, yeah. I guess that seems more complicated but maybe better for cases where there's a longer set of unguessed letters...
Me before I thought to ask about it here ^^^
Put it behind a link in case anyone here still actually plays the game.
 
Oh this is going to be way harder than I first imagined
 
Yeah? Whyso?
 
Partial solution (JS): (g,y,u)=>(c=a=>a+a?a[0].flatMap(b=>c(a.slice(1)).map(x=>[b,...x])):[[]])([0,1,2,3,4].map(i=>g[i]?[g[i]]:[..."abcdefghijklmnopqrstuvwxyz"].filter(a=>!y[i].includes(a))))
Problem is, it doesn't account for all 5 letters being individually guessed already
 
@Catija I've done that: I had an optimisation problem while solving a code golf, so I wrote a code-golf for that…
 
HAHAHAHA
That's very meta.
We should be able to math the number of results, though... if we know how many letters are known and how many possible letters remain and the positions for them, we should be able to verify that the answer set includes all possible solutions?
 
8:37 PM
@RadvylfPrograms Takes input as [null, "o", null, "e", "n"], [[], [], ["n"], [], []]
 
@Catija If that's correct, then this should have 132 possible outcomes for the specific example in the proposed question.
 
9:04 PM
I manually created a table with all of the possible outcomes in my example. :P
 
Hey uh
Does code golf have an advent of code leaderboard?
Does it work like that?
 
hyper-neutrino has one
I think there's a PPCG leaderboard too
Maybe try searching the AoC room for it, the code should be the same as last year
 
kay thanks
 
9:23 PM
yeah it's pinned right
in Advent of Code, Nov 28 at 19:03, by hyper-neutrino
CGCC leaderboard: 383923-1cc3bff3
 
10:10 PM
@Catija Interestingly enough, while it isn't the "norm", I've based multiple challenges here on actual problems I've had, and I know other users have done the same :P
 
@cairdcoinheringaahing Cool!
As to whether it's useful, after I created my table, I was able to go through the entire list and make the right guess, so it did actually do what I needed it to do... but it'd be nice if it wasn't such a manual process for me.
... So is my question good enough yet? :P
 
I'm leaving some feedback on the sandbox post right now, but overall, it looks pretty good, especially for a first challenge :P
 
YAY :D
 
It's implied, but just to be clear: all "words" in the output are exactly 5 letters, right?
 
Yes. It follows the standard Wordle rules.
I updated the standard rules section to note that.
 
10:24 PM
Honestly, my biggest point of feedback is the input/output rules. The challenge itself looks well-specified, but it has the same issue we get a lot when people adapt an actual issue into a challenge: the input format/method they want is restrictive for their task, but we heavily encourage loose formats
Tho, nice catch on the case insensitivity part, that's a classic trap for word/letter based challenges :P
 
@Catija It's also recommended to leave the challenge in the sandbox for a few days (and maybe ask again in TNB for final feedback before posting it)
 
Cool. I've made those changes. I'll check back in a few days :D
 
Do you mind if I do a little bit of editing?
 
Not at all. :)
I appreciate the help! :D It's fun to finally have something I can ask here :D
 
Well, it's always nice to see some CM engagement in our little corner, so that;s doubly good :P
 
10:29 PM
^
 
Is the Community-a-thon still going on btw, or has that ended?
 
It's over. This is just me posting. :D Though I was thinking about waiting until WB starts so I can maybe get credit for it. :P
 
@cairdcoinheringaahing Same here (though both of mine are esolang-related)
 
@Catija Shameless, and commendable, hat-posting :P
 
Grrrrr
 
10:32 PM
@Catija Oh, and not to self-promote, but I would give the Welcome! Asking answer a quick scan before posting, just to double check all that
 
It bugs me that tenor gifs don't work... and of course, giphy doesn't have the one I want.
@cairdcoinheringaahing Is Code Golf the best for this case or does fastest running make more sense, since it seems like getting an answer sooner might be better?
 
There you go
 
Thanks :D
I guess it's just the short links that don't work.
 
@Catija Code golf is the easiest scoring critieria for this. Stuff like are generally harder to write, as, to score them objectively, you have to run each submission under the same conditions, on the same device
 
Ah, that makes sense... and I'm guessing none of y'all use a mac. :P
 
10:36 PM
or similar could work, it's just a lot more effort for your first challenge
@Catija I did, but it broke, and I couldn't afford a new one :P
 
Nice thing about my work - they just give me one every three years.
 
yeah i think the issue with short tenor links is despite the .gif at the end they don't actually serve gifs directly
which is nice for applications that want to elect to serve the mp4 versions instead or whatever
 
@Catija I did a little bit of editing, feel free to change anything you dislike :)
 
but kinda unintuitive
 
So how do you get the actual link? ... oh, just right click and copy instead of using the copy link to clipboard.... That's... not what I would have expected.
 
10:41 PM
yeahhh
 
@Catija Ngl, when I reloaded meta and saw "modified by Catija" on the sandbox, my first thought was "Oh god, what's happened?" :P
 
@cairdcoinheringaahing I like it! :D You caught some of the things that were bugging me but I didn't know how to explain, like the "may appear in other locations" bit. :D
 
Fun fact: If you use txnor.com instead of tenor.com, you'll see a different image
 
@Catija Thanks. Not to brag, but I do spend an unhealthy amount of time on this site 😎
 
i totally forgot about that lmaoooooooo
i wonder how many people had never heard of discord having s/// built in until that went around
 
10:44 PM
Wait that exists?
So that's why I can't send a plain s/x/y
 
@UnrelatedString wait, discord has that?
 
goddamn, how did I not know about this sooner?
 
oddly enough it seems like a trailing slash just totally breaks it, marking the message as edited but changing nothing
 
@cairdcoinheringaahing More sites need more people like you. :P
 
10:49 PM
Thanks :P
Time to include that quote in my mod nomination
 
@UnrelatedString what?
 
It's a week late, and , but I figured people in here might wanna discuss/see it
 
11:14 PM
yeah it's a really interesting thing to think about
i think for cg&cc in particular, our not-exactly-q&a model could have some interesting implications one way or another for the one answer about more privileges translating between sites
 
11:26 PM
@UnrelatedString what is this s/// of which you speak
 
like the uhhh
i think perl does it
and at least one cli text editor
 
sed
 
11:46 PM
0
Q: Compute the far-difference representation a number

Peter KageyIn 2019, Hannah Alpert described a novel way of representing integers as sums and differences of Fibonacci numbers according to the following rules: every two terms of the same sign differ in index by at least 4, and every two terms with different signs differ in index by at least 3. Example ...

 

« first day (4328 days earlier)      last day (507 days later) »