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

5:06 AM
be careful not to use commands that are already ruled out. For example, if you can recreate command A as BCD, and B as ACD, you can only get rid of either A or B
 
5:46 AM
CMC: Create two functions that output the same single integer, yet neither function may use any characters of the other. That includes function definition characters.
 
a=>-1
function(){return~0}
@ATaco javascript ^
 
@ATaco Basically impossible in Clojure :P
 
I was gonna do 1 and 4/4
It's probably not possible in most languages.
 
@ATaco out-golfed :')
 
#1«22/» RProgN2
RProgN2 has many ways to make a function...
 
5:52 AM
What if there's a challenge where you have to make n programs, P_1, P_2... P_n, each of which outputs the program number, but none of the programs may share characters?
 
Scored by Highest n tiebreaker Codegolf?
 
@Qwerp-Derp scoring?
 
#1{2}«3» RProgN2 swoops in for an early lead!
 
Most programs wins, tiebreaker is codegolf
 
Programs or functions?
 
5:53 AM
#Ruby:
->{~-1}
def f;0;end
 
What should the tiebreaker be then?
 
You can ask it on main lol
 
If it's functions, then it's either unique ways to generate a function, or Jelly.
 
Just programs
I think I allowed snippets for my other one
 
1 or 0 indexed?
 
5:55 AM
I'm not sure if I should allow snippets on here, because basically everyone can get 9 programs off the bat
1-indexed
 
The first nine are definitely 1 - 9
 
Actually I think it should be 10-indexed
So the first program outputs 10
 
Still, some languages have a b c d e f
 
Yeah this seems like a bad challenge
What about if the challenge forces you to make different programs with the largest numbers?
But none of the programs can share characters
 
@ATaco can I write a full program if my language doesn't have functions?
 
5:57 AM
@Qwerp-Derp scoring?
 
I will allow it, but that kind of defeats the purpose.
 
@LeakyNun sum_of_numbers^programs
I'm not sure if this is a good scoring scheme, but eh
 
@Qwerp-Derp so I can make one program that outputs Graham's number and win everyone else
 
@LeakyNun Hmmm, good point
At least 2 programs?
 
@Qwerp-Derp the second program will output 0
 
6:01 AM
But if someone manages to write two programs that output Graham's number then they still beat you right
I think this is a bad scoring scheme already
 
@Qwerp-Derp then my first program will output Graham's number to the power of itself
 
I don't know how to fix this :P
 
there is no largest number
 
CMC: score 2
 
@betseg which scoring?
 
6:09 AM
@ATaco V, 2 and 3 bytes: i1 and é0<C-a
 
@LeakyNun ATaco's scoring (^^^^) before the edit
 
heh, can't.
 
6:21 AM
@betseg Straight up Math.JS f(x)=sum(map(range(1,x),j(y)=1/y)) Try it
 
6:49 AM
@ATaco has to be functions?
 
Yes
 
7:18 AM
6 messages moved to Sandbox
 
7:56 AM
Morning folks
 
ok anyone here good at ><>?
 
0
Q: Visualize the Euclidean algorithm again

Leaky NunTask Given two positive integers: Draw the rectangle with dimensions specified by the two integers. Repeat Step 3 until there is no more space. Draw and fill the largest square touching three sides of the (remaining) rectangle. Output the resulting rectangle. Example For example, our input ...

 
8:13 AM
0
Q: What my dog really hears

Ewan DelanoyMy dog is called Rex. Every time I scold him, he seems not very impressed and the only times I see him react is when I pronounce his name. If I say Rex, I told you not to do this! You're making me angry Rex! all he hears is Rex, * **** *** *** ** ** ****! ***'** ****** ** ***** Rex! The cha...

 
Who salt-voted my challenge ;_;
 
Anyone on with the privileges to view deleted posts? Looking for someone to throw an eye over a question that was very quickly dupe-hammered and then deleted last night (GMT).
 
surprising amount of esolangs don't have a wait or sleep function. Shame, cos I doubt looping to wait is very reliable
 
Even people who can see deleted posts can't see them in the question list, so unless you have a link to the question they won't be able to see it. If you want to refer high rep users to it you could reply to the NewMainPosts message from the time, which will link to the question.
 
8:28 AM
It was gone to quickly for me to grab the URL, @trichoplax; I'll have a look above, see if I can find it.
This was it: codegolf.stackexchange.com/questions/119673/… I was in the process of comparing it to its dupe when it was deleted but, from the brief comparison I did get to do, it looked like the 2 questions differed enough to be considered related but not duplicates.
 
It looks close to me. I would describe the second task as a subset of the first. The list of bases doesn't need to be wrapped, but other than that it seems the same (just worded differently)
It's much more difficult to have this discussion when the author has deleted the post. I'd recommend to anyone who has a post closed (whether as a duplicate or for any other reason) that they leave the post undeleted to allow discussion of whether to reopen.
A subset is not necessarily a duplicate, as answers to the first may not be the most competitive answers to the second, but it can easily lead to being closed as a duplicate if it isn't obvious that the subset can be solved in a shorter way
 
8:44 AM
Yeah, that's why I brought the discussion here, as the question was deleted before I could start it there. Personally, I felt that it was different enough to stand but, if both you & DT say that it's not, that's good enough for me. Shame, as I had written up nice answer for it before the dupe-hammer was swung!
I'll just have to see if I can adapt it for the other question.
 
I'm specifically not saying it's a duplicate. Just saying it's a shame it isn't open to allow more people to join this discussion
 
Agreed.
 
I don't think the internet understands the concept of shipping. Someone commented on a YouTube video "xxx is already married/has a girlfriend/boyfriend, don't ship them", and I just cringe, because they clearly don't understand shipping - current relationships don't matter, nothing matters.
</rant>
 
The appropriate place for such rants is in YouTube comments
3
 
And Twitter, if the rant is brief enough
 
8:57 AM
Sure
 
9:15 AM
33 messages moved to Cross-Code
1 message moved to Cross-Code
 
9:40 AM
Hmm, HEX's docs are confusing
it implies that semicolons are needed after commands, but also implies that the interpreter will just ignore any unnecessary characters after the command.
the former implies that GBL; is valid, but GBL is not, however the latter explicitly states that GBLhjur is valid
Ambiguous docs, I guess I'll just take the JS/Python route, where Semicolon and newline are inter-changeable
 
9:56 AM
Hmm, given lists in Python3 are passed by reference (or by value of reference), if I did bugs = stack = []; would bugs and stack both reference the same list?
or would it just initialize both as separate empty lists?
 
Pretty sure they would both reference the same list
 
You can try it yourself to be sure ;)
 
Hmm, time to test
yup they both reference the same list
bugs, stack = [], [] works fine though
 
That's referencing two separate lists.
 
Some thoughts for maybe some future Java shortenings: Double Brace Initialization of Arbitrary Lists.
 
10:05 AM
Uh oh. Are they turning Java into a real language?
 
It's been there for some time. It's not usually useful when golfing (and ugly in real code), just because you don't often initialize that way, adding things manually.
 
@Geobits It also doesn't get picked up by GC. ;)
 
oh, they're just documenting this *cough*hack*cough*, not making it official.
 
@JanDvorak Yeah pretty much. It's just inner class instantiation.
 
hmm.. regex. How would one match a string surrounded by '' or "", but only when the same symbol is used on both sides? I was gunna do ['|"].+['|"] but that would match, for example 'test"
I'm not good at regex ;-;
 
10:07 AM
@Geobits Not to mention: Arrays.asList(T ...) is a thing.
 
Yeah. It's hard to find a good excuse to actually use it except being "clever", which often gets you punched :P
 
@Mayube ('|").+\1 should work
 
@Geobits Shame. Maybe use in sorting? Or in non-standard lists, but that's outside of the realm of golfing.
 
is my challenge really that hard?
 
10:10 AM
What challenge?
 
2
Q: Visualize the Euclidean algorithm again

Leaky NunTask Given two positive integers: Draw the rectangle with dimensions specified by the two integers. Repeat Step 3 until there is no more space. Draw and fill the largest square touching three sides of the (remaining) rectangle. Output the resulting rectangle. Example For example, our input ...

 
Did someone claim it was difficult?
 
@KritixiLithos Oh wow that's perfect, had to tweak it a tiny but but works like a charm. I really need to learn how to properly utilize capturing groups. Thanks!
 
@trichoplax Not getting answers for 2 hours usually implies that...
 
but a lot of people are asleep at this time
 
10:12 AM
That seems only one possible inference - there are lots of other potential reasons
 
Also, I'm awake when others (especially living in the US) are asleep.
 
Maybe not many people are at work at this time so don't have spare time for golfing
 
> not many people are at work
> don't have spare time for golfing
contradiction?
 
Hmm.. is python drunk? According to Regex101.com this works in python's regex, but actually running it in regex returns None re.search("^Bug\((('|\")(.+)\2,\s*('|\")(.+)\4)\)$", 'Bug(\'test\', "testval")');
 
@ZacharyT Do you watch RVB?
 
10:15 AM
ooh I bet it's cos of the escape chars on the single quotes
 
I was failing at python last night... I was trying to call a function like this:
oneArg[a](b)
 
hmm nope still not working
Maybe I should break it up into multiple, simpler regex checks
 
@EriktheOutgolfer No, a subtle joke...
 
Oh I can guess what "work" means. Other than that, it was a typo.
 
@Mayube in ('|\" should the ' also be escaped?
I don't regex so just wondering
 
10:20 AM
More general tip: you should really be using r'...' for regexes.
 
@EriktheOutgolfer what's the difference?
 
@Mayube Oh ignore me it doesn't need to be
 
@Mayube Less need to escape chars and have an obnoxious mess when you finish.
 
@EriktheOutgolfer Literal meaning of work (being at the office), joke being that many people spend more time on PPCG and TNB from work more than they do from home.
 
Although you still need to escape \' (same as ' anyways), \\ and chars you would normally escape on regex level.
@trichoplax Oh right, I totally get it.
 
10:26 AM
0
A: Sandbox for Proposed Challenges

OkxMap Zooming code-golf string Your task is to, given a map as input, zoom it out or in, depending on the scale. For example, given the following (badly made) map: ..____.... ../OOO\... ..\OO/\... .......... And a scale factor of 2, you should first separate it into 2x2 sections: .. | __ | __...

 
CMC: convert prefix notation to postfix notation, where the operators and atoms are all one-byte long
(this is really a joke challenge)
 
I think I've seen some stack languages that will dump the stack in the reverse order from how you entered the input...
 
Braingolf does if you insert the chars one at a time
like #H#e#l#l#o&@ will output olleH
but "Hello"&@ outputs Hello
 
That's not actually input though.
 
Braingolf's input's kinda derpy :P
if you pass string input as commandline args it'll break the whole interpreter
but if you pass string input through STDIN and use { to read it, it works like a string literal
but that's just cos I'm bad at making languages :P
 
10:40 AM
Numeric input comes from command-line args though.
 
@Christopher, I don't even know what RVB is.
 
Red Violet Blue :P
 
I looked it up, I don't watch Red v. Blue. I'm not really much of a television kind of guy. I am mainly into mathematics, computer science, physics, and linguistics. So, sorry if I don't get your references to anything
 
2^3 is actually 1
 
LOL, xor.
 
10:51 AM
I may post a challenge where the above CMC isn't a joke challenge (namely, the order of the arguments must be preserved)
 
Hi, you must be looking at your console wondering what the heck this message means. It means you should be happy that this message is being logged otherwise something very wrong happened
That just showed in my console.
 
Heh, 1337*pi/100 = 42
 
HEX's error for invalid arguments is +++ Melon melon melon +++
it's error for invalid start of program is +++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++
 
Why would any language have such error messages?
 
Because esolangs?
 
11:01 AM
Is it a golfing language, or just an esolang?
 
@TuxCopter Nah, actually 43.25973083993145...
 
irb(main):001:0> 1337 * Math::PI / 100
=> 42.00309377849553
@EriktheOutgolfer ^
 
Jelly's π must be a bit different then...
1377×ØP÷³ returns 43.25973083993145
No command-line arguments.
 
Looks like its 1337 is different too.
 
Welp, I'm going to assume the HEX language is not a golfing language, and I'm out.
 
11:04 AM
3.141592653589793 for Jelly and 3.141592653589793 for Ruby
No difference
 
Whoops I actually typed 1377, I was seeing 1337 at first...
 
oh
 
See, this is why golfing languages are bad, it's impossible to read them.
 
And yeah your stuff isn't actually just 42 anyways.
> golfing languages are bad, it's impossible to read them.
We are golfers, we don't care for readability.
 
@ZacharyT yeah it's not a golfing language, just an esolang
 
11:09 AM
golfing language: A programming language made with the intent to compete in code-golfing contests.
--Erik the Outgolfer
 
well this is as golfy as you can get a hello world program in HEX GBL;Bug("1","Hello, World!");Scuttle("1");Write;
 
11
Q: Print an ascii spiral in O(log n) memory

durron597You may write a program or function that receives an odd, positive integer n, where n >= 3, as either a function argument, command line arguments, or on STDIN (or equivalent for your system), and prints to STDOUT (or system equivalent) an ASCII spiral that spins inward clockwise where the top edg...

looks like a good challenge
 
@Mayube O.o that doesn't even look like an esolang
 
@ASCII-only it's only mildly esoteric
it's inspired by discworld
 
@LeakyNun I'd remove "in O(log n) memory".
 
11:14 AM
@EriktheOutgolfer hmm...
 
Bug("1","Hello, World!") creates a "bug" (variable) called 1, with the value Hello, World!. Scuttle("1") pushes the given bug to the stack, or pops it from the stack if it's already there. Write writes the values of the bugs in the stack
and GBL starts the program
 
Can't you use "" instead of "1"?
 
@EriktheOutgolfer hmm, I have no idea, let's find out
No
python doesn't support empty keys in dictionaries
 
I seem to be able to make a dict like {'': 1, 'a': 2}.
 
@Mayube It does
 
11:21 AM
ninja'd
 
oh right yeah my parsing regex is expecting at least one char, 1 sec
 
Oh you've made a partially working parsing regex?
 
GBL;Bug("","Hello World!");Scuttle("");Write There we go, works
@EriktheOutgolfer just had to change a + to a *
 
1 hour ago, by Erik the Outgolfer
s/\+/\*
 
s/s/s
 
11:26 AM
Anyone here good at golfing ><>?
 
C(not so)MC: come up with a language that is simple enough to make a mainsite challenge for. preferably very simple (simpler than brainflak)
(also there should be a brainflak interpreting challenge)
 
@DestructibleLemon Brainf**k, Home row, Brain-Flak, any Brainf**k substitution language
 
(not list, I mean create)
 
CMC: make a Brainfuck interpreter run Doom
 
11:37 AM
not really possible
 
IIRC there's a derivative of BF that adds pixel plotting
 
you would need a variation at least
actually you would mainly just need key inputs
 
@DestructibleLemon It's not hard
 
no, the way input/output canonically works makes it impossible
 
All you would need to do is give the interpreter a pointer to the main function of Doom :P
 
11:38 AM
-_-
 
In a way that makes the interpreter run it of course
 
@DestructibleLemon oh well in that case, Braingolf is pretty simple-ish :P
hmm probably not simple enough for a mainsite challenge though
kinda hard to come up with a language that simple that isn't just brainf**k
@DestructibleLemon does it have to satisfy PPCG's criteria for being a programming language?
 
@Mayube HQ9+ :P
 
does HQ9+ satisfy PPCG's language criteria though?
 
Can any mod check if this is a serial saltvote?
I swear I hit the repcap 5 hours ago... a quarter of a day...
0
Q: Prefix Notation to Postfix Notation

Leaky NunDisclaimer: No, this is not a joke challenge to reverse a string. Task There is only one operation to support: subtraction (-). You also only have two atoms to support: zero (0) and one (1). Here, the prefix notation -AB is equivalent to the postfix notation AB-, where A and B are expressions...

 
11:52 AM
I'LL BE BACK
 
@JASONSAMUELT ok wat how do you manage to have 1 rep on every one of your accounts O.o
 
He can't talk here, he only has 5 rep.
Also, it's pretty common to have 1 rep on many accounts empirically.
 
Let's say I have a user u. It got 21 upvoted answers and a downvoted answer. Will it get 198 rep or 200 rep?
 
isn't 1 upvote 10 when a downvote is 2?
so it'd be 208?
oh wait repcap
it'd be 200
@LeakyNun mentioned yesterday that if you've hit the repcap, negative rep from downvotes is taken out of the overflow first
 
12:07 PM
Ah thx
 
CMC: Return 45 given 43, and 43 given 45. Output for all other inputs is undefined (i.e. can be anything).
 
@ASCII-only Braingolf 13 bytes .59*1--?2-:2+
 
Jelly, 6 bytes: 44_+44 (high potential for more golfing)
 
subtracts 44 from input. If result is positive, prints input -2, else prints input +2
 
Yeah, you have to fix the sign builtin.
rn it works like a != 0, that's because a negative int is truthy in Python.
 
12:17 PM
the sign builtin? s?
 
Yes, it returns 1 for negative ints.
 
43 = 101011
45 = 101101
 
Jelly, 3 bytes: 88_
 
conclusion: x=>x^6
 
oh wait negative ints are truthy in python? huh, TIL
 
12:19 PM
@EriktheOutgolfer x6
 
@ASCII-only f(n){n=88-n;}
 
@LeakyNun What?
 
@EriktheOutgolfer ugh ninja'd
 
@EriktheOutgolfer xor with 6
@betseg f(n){n^=6}
 
Jelly, 2 bytes (thanks @LeakyNun): ^6
 
Anonymous
12:20 PM
 
@betseg Wow so obvious how could I miss it thanks
 
Anonymous
@Mayube Only 0 (and False, since they're the same thing) and empty iterables are falsey
 
@Mego Not anymore.
 
@ASCII-only @Erik did it before me tho
And ninja'd me
 
@Mego yeah, I modified the sign builtin to fix that
 
12:22 PM
Let me know when you'll pull the change, so that I can redownload.
 
kk
 
Anonymous
@ASCII-only Actually, 8 bytes: ;pY0Dⁿτ+
 
3 mins ago, by Leaky Nun
@EriktheOutgolfer xor with 6
 
Anonymous
And I just saw that
 
@Mego Technically, there are empty iterables that are truthy (even without hacks): iterators that won't yield any more elements
 
Anonymous
12:23 PM
So 6^ for 2
 
Also, 88 - x is a still golfier trivial approach.
 
Anonymous
@L3viathan There's a difference between an exhausted iterator and an empty iterable
 
@EriktheOutgolfer push'd
 
@Mego Any iterator is an iterable
 
can't for the life of me thing why I didn't properly test s when i added it
 
12:25 PM
@Mayube downloaded
 
Here's an easy one for y'all
CMC: Given a string, replace all instances of more than 2 concurrent newlines with 2 newlines, then output the result
 
Anonymous
@L3viathan But not all iterables are iterators
 
atomic-code-golf: XOR with only addition, subtraction, multiplication, dividion, modulo, assignment, and loops (8-bit integers only)
 
don't all iterables have iterators? Or is that enumerables in C# :P
 
@Mego Yes, didn't claim that. But you said "empty iterables are falsey", which isn't true for exhausted iterators, which are iterables
 
Anonymous
12:26 PM
@Mayube All iterables have an __iter__ method that returns an iterator.
 
Anonymous
@L3viathan Yes, but an exhausted iterator is not an empty iterator
 
but an empty iterable?
I think it's clearer to say in general that 0 (and False), and empty containers are falsy
 
oh yeah strings are iterable
gotcha
@EriktheOutgolfer To be fair the Braingolf interpreter is far from perfect, but I'm pretty pleased with it, given I've only been using Python for like 1 month :P
 
Anonymous
@L3viathan The catch is that there's no such thing as an empty iterator, so iterators are never falsey
 
@Mego How would you define an empty iterable then?
 
12:29 PM
[]
 
Anonymous
@L3viathan len(x) == 0
 
^
any iterable object with no content
 
Anonymous
Some common forms are {}, [], (,), {,}
 
CMC: generate a context-free grammar for natural numbers divisible by 7 expressed in base-ten.
(cc @JanDvorak)
 
Anonymous
(empty set, empty list, empty tuple, empty dict)
 
12:30 PM
empty tuple = ()
empty dict = {}
 
Anonymous
@EriktheOutgolfer Wrong
 
you can initialize an object with dict = {} and it can then be treated as a dict
 
Anonymous
@EriktheOutgolfer Only in Python < 3.1, < 2.7
 
@Mayube sed, 13 bytes: s/\n\n+/\n+/g
 
what python version does TIO use?
 
12:31 PM
@Mego It works for me in 3.5.2, yours are syntax errors.
 
@LeakyNun seven non-terminals, 71 rules. Should I write them down?
 
But then you're using a property of an object (length) that isn't defined for all objects of this kind (iterable)
 
@JanDvorak how on earth did you... have you... what...???
 
I guess it works. But I find it inelegant
 
@LeakyNun FSM
 
12:32 PM
@JanDvorak oh... I see how there are seven non-terminals. One for each remainder.
 
Anonymous
@EriktheOutgolfer Oh wait you're right about the empty dict, I mixed up the syntax between empty dicts and empty sets
 
@JanDvorak I mean, how did you do it so quickly
 
I believe you have answered yourself
 
oh alright
@JanDvorak do you have any CFG CMCs?
 
Anonymous
Also I distinctly remember having to use (,) for empty tuples at some point, but that may have been pre-2.7
 
12:33 PM
I'll let you know when I do
 
@LeakyNun Hmm, how's that work?
 
@Mayube a direct implementation of your request
 
@Mego Also, an empty set is set(), {,} is a syntax error (maybe not in >=3.6?)
 
(Also in >=3.6)
 
@Mayube wait
 
12:34 PM
@LeakyNun TIO says otherwise
unless I'm missing something about sed
 
@Mayube nvm it doesn't work
sed has no regex?
 
@LeakyNun It does (well, a subset IIRC)
 
@ASCII-only how to make it work?
 
@LeakyNun Just how do you expect it to replace with \n+
 
@ASCII-only my brain was borked
 
Anonymous
12:36 PM
@EriktheOutgolfer Nope, it's still set(). Python could use an empty set literal.
 
@Mayube import re,sys;print(re.sub("\n\n[\n]+","\n\n",sys.argv[1])) Very poorly golfed python 3 solution :P 59 bytes
 
5
Q: Visualize the Euclidean algorithm again

Leaky NunTask Given two positive integers: Draw the rectangle with dimensions specified by the two integers. Repeat Step 3 until there is no more space. Draw and fill the largest square touching three sides of the (remaining) rectangle. Output the resulting rectangle. Example For example, our input ...

It this really that hard?
@Mayube what does [\n] do?
 
@LeakyNun horribly ungolfy, look it up on SO if you want to know (basically never use sed for multiline replacements)
 
@ASCII-only alright
 
@LeakyNun Same as \n :P
@Mayube lambda s:__import__("re").sub("\n\n+","\n\n",s))
 
12:50 PM
touche
I did say it was very poorly golfed
oooh now there's a neat trick
 
JavaScript (ES6), 24 bytes:
s=>s.replace(/\n\n+/,`

`)
 
Hah. Apparently you can get the announcer badge if someone else edits your post to include a link.
 
1:08 PM
Would you consider outputting non printable control characters in a string-related challenge ok?
 
1:24 PM
@betseg depends on the challenge
@LeakyNun Any permissible input/output format is permissible You understand the pointlessness of that statement, right?
 
@ASCII-only You'd need the global flag, wouldn't you?
 

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