« first day (3785 days earlier)      last day (481 days later) » 

12:19 AM
@RedwolfPrograms pi, probably tau as well
I'd say just one or the other
A: Sandbox for Proposed Challenges

MakonedeInterpret Unreadable code-golf interpreter Introduction Unreadable is a programming language designed to be – as the name states – unreadable (in most fonts, anyway). Instructions are ' followed by a run of "s. So while in a code block, '""'""'""" looks just fine, it looks like '""'""'""" outsid...

@RedwolfPrograms I'd suggest e, but...
although I feel like they don't come up that often in the kinds of challenges we end up having so you could get away with just making them two bytes
12:25 AM
@Bubbler Love the fix2 one, doesn't look like it needs much more
1:25 AM
@OldSandboxPosts mmm yes , the best challenge name ever
@cairdcoinheringaahing ?
It seems to have used the tags at the bottom of the post instead of the title at the top
It was bold rather than a heading at the time that was posted, but bold titles aren't too uncommon
really blame markdown for having two different ways to create headers
That's not the issue here
The # vs == is totally unrelated
And so is # vs ## vs ### vs ...
It was just **Title**
1:29 AM
but the tags were detected as the title because
Oh, huh
still, that probably wouldn't have been a problem if the author had known markdown :/
I'd still expect it to not get detected as the post's title since it's at the bottom of the post though shrug
1:44 AM
It just finds the first <h1> or <h2> tag, so that may be a bug. I'll check when it isn't 3am
1:56 AM
A: Sandbox for Proposed Challenges

aeh5040Convert permutations to integers and back again. Convert a permutation of 0,...,n-1 to a number in the range 0,...,n!-1, and convert back again. Task Write a program containing two functions (or two programs). The first function should accept a permutation (i.e. an ordering) of the numbers 0,1,2,...

2:08 AM
Got my second COVID vaccine today :D
2:31 AM
Q: New First-Time Asker Dialog

hyper-neutrinoIf you open a new private/incognito window, navigate to CGCC (https://codegolf.stackexchange.com), and click "Ask Question", you should encounter a dialogue that looks like this: This fits our site quite poorly and being one of the last intrusive reminds of what our scope is, I believe it would ...

1 hour later…
3:42 AM
@RedwolfPrograms laughs in can't even get the first
Q: Is it acceptable to use an external API doc in a challenge?

AJFaradaySo, I'm working on an environment for an upcoming challenge, and I've written a fairly extensive API document for entries to interact with the game. I'm thinking at this stage that the API doc itself is longer than most posts, and it might make the challenge more approachable to describe the chal...

Any opinions on that question? External resources in a challenge?
@AJFaraday Seems fine to me
Fair enough. I wasn't sure if it was something that would be frowned on here.
4:31 AM
Announcing: Try in browser! At least the UI is complete feature-wise. Language requests and UI improvement suggestions are welcome.
@Bubbler language suggestion (obviously): Vyxal
JS, Python, and Jelly are the "obvious" requests but would definitely be useful
@lyxal Frick
The major limitation is that every language should be implemented from scratch in Rust, in a single-stepping style
That makes things a bit more complicated then
which makes JS/Python/<insert whatever general-purpose language you can think of> a no-go
4:38 AM
I guess you could make a really, really tiny version of a linux distro with just enough to run those
It'd be ridiculously slow though, and way too much work to be worth it
I guess BF (both flak and fuck) would be cool
BFs are definitely good candidates
(It is theoretically possible to run the interpreter inside a webworker to free up the "single-stepping" requirement, but it would take another lot of effort)
4:41 AM
could also put BeFunge in with the other BFs
Kinda :P
Instead of single stepping, why not do it in blocks of a few thousand steps? There'd be no noticable "grainyness" but it'd be way faster.
there's probably an existing prolog flavor that wouldn't be too hard to rewrite in single-stepping rust
@RedwolfPrograms The interpreter defines single steps, and the UI tries to run as many steps as possible at once, until it drops the framerate (i.e. responsiveness)
this might be helpful
this should also allow you to theoretically import like half of the languages on TIO since a lot of them seem to be coded in python
4:45 AM
Wow, it has a wasm-based online demo
Unfortunately there's almost certainly not a rust based JS interpreter :/
Are you joking?
@Ausername no
he's redwolf
*Slaps face
4:48 AM
ha got'em
Considering trying to set up a TIO-like site that allows language developers to upload and update their implementations themselves
I would recommend whitelisting for that TBH
even with sandboxing just for safety
I'd probably have some sort of process languages would have to go through to get approved, probably just some sort of voting. That'd keep blatant malware out, not that it'd be able to do much harm anyway.
the main issue with TIO ended up being that all the pressure and dependence was put on one single person which ends up being way too much. Even if you just whitelist a few trusted users here that should be enough for everyone to make requests and have them go through / get approved without stressing anyone far too much.
That's true
Maybe even tie it to something like CGCC rep or moderator-ness
4:51 AM
@hyper-neutrino Poor Dennis :(
@RedwolfPrograms Possibly. I mean whether you whitelist on your own trust or just use rep is totally up to you of course, that's just my suggestion to restrict it by whitelist to make it a bit safer maybe or smth
unsafe is my middle name, because the compiler complains otherwise
Now Duolingo's sheep are trying to sing in French.
5:05 AM
@RedwolfPrograms No, it's Matthew :p
shhhh :p
CMQ: Useful feature for string division? (string ÷ string)
@lyxal Split on?
I'd recommend trying to find useful functions then fitting them in where possible, rather than trying to find places to put them then finding fitting functions :p
context: Vyxal experimental branch rewrite. In other words, I already have a list of functions, but I'm re-evaluating some of the overloads
String division is currently split on, but I was wondering if there were other options
5:10 AM
@lyxal "Split by" and "occurrence count" come to my mind
Maybe the latter would fit better with intdiv (if you have one)
Occurrence count already has a built-in dedicated to that one functionality
Also, there are multiple "split by"s based on how you interpret the rhs: split by substring occurrence, or split by any char appearing
oooh that "split by any char appearing" sounds good
an we have a 'split on first occurence builtin?
(Rust stdlib supports both with a single function by accepting a string for the former and a vec of chars for the latter)
5:16 AM
@Ausername that sounds better
I don't know if Vyxal can handle the two differently, just an idea
Regex split would be nice as well :p
Can python do that?
@Ausername do you not read the docs?
Python has re.split, so why not
Oh ;p
5:17 AM
I'd love to add regex to one of my upcoming languages, but I'd have to write the engine myself and I do not feel like doing that lol
laughs in regex library
Exactly one golflang I know of has a built-in regex type
Is it a JS based one?
Knew it :p
5:18 AM
You don't need a regex type, just compile them on the fly.
though it doesn't do a lot of things with it
JS having a type and literal syntax for regexes is so cursed
Java is worse - Pattern + Matcher nonsense
Well, a typical design pattern bloat
Someone remind me tomorrow morning to start up my websocket logging, I want to see what the event for an event starting looks like
5:29 AM
@lyxal I believe there's a ruby extension that implements division as split, to complement multiplication being join
CMQ: what process do you go through when writing an answer to a Codegolf challenge?
@ophact Are you writing a code golfing bot?
No, just curious
@ophact denial, anger, bargaining, depression and finally, acceptance
Hmm, how does that usually look like
5:33 AM
we usually don't do the final stage on this site though
So no acceptance but a lot of depression. Sounds interesting, I want in!
6:02 AM
on a serious note i usually start with a test harness unless i already know exactly what i'm going to write
6:17 AM
Interesting. I start with the implementation, then I add tests.
6:32 AM
I just incrementally build things step-by-step, running with some inputs to see the code is doing things as intended
I guess it often goes like minimal code -> minimal test -> more code -> more test -> ...
until it becomes a full solution and I golf the code and format the tests properly
I also do it bit-by-bit, but try to golf it as much as possible while going. Like for this monster, I first figured out how to render the ones, then the fives, then both together, then the 0 edge case and finally how to convert the number to base20 and iterate over its digits.
i think it depends too much on both the question and the language used
6:52 AM
hello everyone
@ophact a long time ago, I would have said: a) start to attempt the challenge, b) realise that my language didn't have the right commands or that there was a bug, c) add a new feature/bug fix to my language, d) push to main, e) refresh the online interpreter for this language, f) complete writing the program, g) double check all the test cases so people can't say that my answer is invalid and finally, h) post the answer
But obviously I can't do that now ;p
Why not?
@ophact I start to play and somehow reach to the solution
And get outgolfed by very big margin later
@Ausername it'd be too obvious today
Put a new branch on Vyxal, called real, do all your commits on that (except a few) so no one knows.
"Updated a week ago"
6:57 AM
@Ausername that would be cheating :P
@Wasif that's the whole point ;p
A: Sandbox for Proposed Challenges

A usernameTrapezoidal Riemann Sum Given a list of coordinate pairs, output the Trapezoidal Riemann Sum of the values given between the first and last x-coordinates. You will be given a list of sorted coordinate pairs, like this: [ [1,2], [3,5], [5,11] ] My way to do this is (you might find a differe...

Noob bot, I managed to switch to this tab before you posted.
Aha Bots are very fast now
7:12 AM
Q: Decode USB packets

pxegerInspired by this video by Ben Eater. This challenge will form a pair with Encode USB packets, which is in the sandbox. The USB 2.0 protocol uses, at a low level, a line code called non-return-to-zero encoding (specifically, a variant called NRZI), in which a stream of bits is encoded into a strea...

A: Sandbox for Proposed Challenges

Wheat WizardLexographic Ordering Lexographic ordering is a way of ordering strings of characters. It works exactly the same as alphabetical ordering. When comparing two strings lexographically, you look at the first character of each string. If one of the strings is empty and has no first character that str...

Feedback? I'm going to post soon.
7:29 AM
maybe move the lexicographic ordering section lower down, after you've described the actual challenge? At the moment it looks like the challenge is going to be about lexicographic ordering
I feel like the challenge is about lexographic ordering.
Also could you rewrite the example in Python? Just Haskell is a bit confusing to read if you don't know the language.
The python example would be horrible.
The haskell basically looks like pseudo-code anyway.
@Ausername just use Python's builtin string comparison functions
@WheatWizard I think it looks like it might (if you read quickly) be about lexicographic ordering in the sense of "just implement lexicographic ordering", with the Haskell program being a reference implementation. In fact it's more complicated than that
7:33 AM
@pxeger I agree
@WheatWizard Agreed. I also thought "well, this will be easy" and then I got to the bijection… "oh."
@WheatWizard One thing: Can you prove this is possible?
I can yeah.
Ok, because I haven
't found a way to do it yet. Working on it
For arbitrary-size integers?
There are a couple ways. You can show the order type of both is omega to the omega. You can come up with injections both ways pretty easy. And you can just come up with a bijection.
@Ausername What do you mean?
7:38 AM
Works for any number no matter how big?
I don't know what you mean. The numbers here are strictly less than 3.
Theoretically it should be possible because it's basically a mapping between finite decimals inside [0,1) between base 2 and base 3, and between any two distinct number there are infinitely many numbers, which means the infinity-infinity bijection should be established between those intervals recursively
and all the infinities are countable if I'm thinking correctly
The first line is actually wrong because [1] < [1,0] but I think the argument still holds
Well, it doesn't hold 100% because there's nothing between [1] and [1,0], which means you should be careful with zeros (maybe just trailing zeros?)
The problem is, if you order all base-3 numbers lexographically, you get 1, 10, 100, 1000, 10000, etc... This means all numbers must be transliterated to 1 with some zeroes, so the other base-3 numbers never get a chance.
I think you meant [], [0], [0,0], [0,0,0], ...
You can't order the 3 strings (different from base-3 numbers) like you can natural numbers. They have a larger order type.
7:51 AM
@Bubbler Oh yes that's what I meant
Of course you can never reach [1] that way, but we can define [1] in binary maps to [1] in ternary, and map the infinitely many strings below binary [1] to infinitely many strings below ternary [1], and the same for above
What about ternary [2] though
Then I can bisect the range above binary [1] again, which gives [1,1], and I define that maps to ternary [2].
This is hurting my brain
@WheatWizard Is ^^ a valid strategy?
7:56 AM
Try to just make a monotonic injection from 3-strings to 2-strings. Forget about the bijection for a moment.
@Bubbler Maybe. I would have to think about it.
@Bubbler Actually I think this is exactly my solution.
There might be a slight problem. Your missing some details.
8:21 AM
@lyxal Flags for printing register/glob. arr at the end?
Also can you have a look at my Jo flags, they aren't working
8:34 AM
Q: Rewrite strings without changing their order

Wheat WizardLexicographic Ordering For this challenge we will be talking about the lexicographic ordering of strings. If you know how to put words in alphabetical order you already understand the basic idea of lexicographic ordering. Lexicographic ordering is a way of ordering strings of characters. When co...

Any shorter way to convert 0/1 to 1/0 in JS? I've got +!(...)
I thinkk that's shortest
@Bubbler I just bang an answer out
@pxeger Isn't 1-(...) simpler?
yes, and it has slightly more liberal operator precedence which is helpful
it turns out that because ... is in fact always one of 0^0 1^1 0^1 1^0, the parens aren't necessary when using 1-
9:06 AM
@ophact Unless it's especially complex, I start by choosing one specific example and figuring out what is done to that input to get the output. Then, I implement it, post it and start testing the other inputs
@WheatWizard Your typo will be immortalised.
Or especially simple, then I just copy paste as fast as I can to avoid HN ninja'ing me
@Ausername wdym?
33 mins ago, by New Posts
Q: Rewrite strings without changing their order

Wheat WizardLexicographic Ordering For this challenge we will be talking about the lexicographic ordering of strings. If you know how to put words in alphabetical order you already understand the basic idea of lexicographic ordering. Lexicographic ordering is a way of ordering strings of characters. When co...

9:08 AM
What typo?
Mods can't 11 that easily :P
Takes 2 mods to redact a revision, one to propose it and one to approve it
I know, but in chat?
Isn't it different then?
9:10 AM
Oh, I thought you mean the "lexographic" typo
I thought you mean the "your missing some details" typo
Yeah, mods can nuke any chat message they want IIRC
Or in this case edit.
It wasn't even an edit
Just refreshing the onebox
9:45 AM
I ask because there has been 0 activity
1 hour later…
11:07 AM
@Bubbler popular ones like brainfuck and underload maybe
shouldn't be hard to amke a rust impl if there isn't one already
also, add Flurry :)
11:53 AM
Any feedback? Should be posting later
@cairdcoinheringaahing One thing that seems a bit odd to me is the whole side arc about But, Is It Art?. The challenge is only tangentially related to But, Is It Art?
@Adám The concept of two canvases/matrices being equivalent based on the "blocks" in them, not the locations of those blocks definitely seems to be more or less unique to But, Is It Art?
I reduced it down from "given two But Is It Art? programs, output if they're the same", because binary matrices are easier to handle and make it more "pure" than having to deal with spaces/letters
@cairdcoinheringaahing But BIIA can have blocks orthogonally touching each other. The challenge here is simply whether two Binary "worlds" contain the same set of orthogonally connected 1-tiles.
@cairdcoinheringaahing Maybe put the test cases into a 2-column table to make it easier to copy each input separately?
@Adám Yeah, I had trouble deciding on a good format for the test cases. Not sure I can visualise what you mean tho?
@cairdcoinheringaahing Can I try editing it? You can of course roll back.
12:04 PM
@Adám Yeah, go ahead
@cairdcoinheringaahing Have a look at the first two now. Try selecting one input separately.
@Adám Ah, I get it now. I'll edit the rest, thanks!
@cairdcoinheringaahing Sure thing. Btw, interesting challenge would be to create that table from the old input.
Think I'm going to write a quick Jelly program to basically do that :P
12:21 PM
@Adám Here's a 49 byte Jelly program which converts one test case into the table format (inputs only, not output)
@Adám Good call
@cairdcoinheringaahing half a hundred Jelly bytes sounds like a worthy challenge.
CMC (easier version of ^ suggestion): Given a multiline string consisting of two binary matrices, each row of the matrices separated by a single space, output the first matrix, then the second, separated by a blank newline. An example might be clearer, sorry for taking up so much vertical space:
1111111110 1111111110
0111111101 0111111101
1000010000 1000010000
0010001110 0010001110
0110011011 0110011011
0100100010 0100100010
0100011001 0100011001



I have 10 bytes in Jelly
You can assume the matrices with always be the same size - they won't necessarily be square. The input format will always be like that. Each row is row_a space row_b and each row is joined by a single newline
12:40 PM
@cairdcoinheringaahing 10 in APL too: ↑⍤1∘⍉≠⊆⍤1⊢ Try it online!
@Adám How does that work? From my (limited) understanding of APL, it seems very different to my approach
@cairdcoinheringaahing ⊆⍤1 isolates runs in the argument according to runs of non-spaces. Then transpose and ↑⍤1 join each row into a matrix, forming a 2-by-n-by-m array, which by default prints with an empty line between the layers.
1:09 PM
Q: Remove All Smalltalk Comments for Code Golf

Wzl Take a line of input (function arguments or stdin, etc.). Remove comments in it, where a comment starts and ends with ". Do not remove comments in string literals, which start and end with '. String literals do not contain escapes, because smalltalk has nice, easily lexable syntax ;). Output thi...

1:28 PM
@RayButterworth I mainly included the bullets as more of a hopeful thing. The "meat" of the suggestion is the text above the "Before you post, ..." — caird coinheringaahing 1 min ago
(cc @hyper-neutrino)
I think the best way of going about it is just clarifying as much as possible before the bullet points, and maybe implementing A Username's suggestion too.
Just append "Ignore everything below this". — A username 8 hours ago
2:27 PM
@cairdcoinheringaahing Husk, 7
2:38 PM
huh TIL Jelly >= Javascript :P (this is a challenge >:)
I suspect there's a ~20-25 byte answer to the new challenge
A: Sandbox for Proposed Challenges

aeh5040Is there a left-right connection? grid path codegolf Task Given a square array of 0s and 1s, determine whether or not there exists a path of 1s connecting the leftmost and rightmost columns. A path can take steps of one unit up, down, left or right, but not diagonally. Every symbol on the path ...

2:56 PM
it's disappointing that new users who post bad challenges never use the sandbox, and new users who post in the sandbox very often post good challenges that don't really need much feedback from the sandbox

« first day (3785 days earlier)      last day (481 days later) »