« first day (1516 days earlier)      last day (3328 days later) » 

12:06 AM
There should be an "explanation auto-formatting" tool.
Look here: codegolf.stackexchange.com/a/48145/2867 to see what I'm talking about.
It takes too much effort to format everything so that there are no line breaks and the code lines up perfectly.
 
I think someone actually did write a tool for that.
 
12:21 AM
That was my first PPCG answer in almost a month.
 
@PhiNotPi Btw, you're sort of assuming that there will be no punctuation or stuff in the input. The OP hasn't clarified that yet.
 
I am, but I'm basing it off of "a string of Swedish letters," and punctuation marks aren't considered letters.
 
yeah that's true, but neither are spaces ;)
 
I could probably change /s to /W
 
possibly
 
12:30 AM
what about Åå Ää Öö?
 
but we don't know about digits either :P
oh right, that doesn't work anyway
 
Oh.... hmmmm.
I assume that's something I need to fix.
 
(Hmm considering how close Python is to CJam in triangles maybe I should try CJam...)
Programming on a phone is hard :(
 
who does that...
wow, that was bad... I guess I need some sleep.
 
Well I just did :P (posted)
 
12:39 AM
RIP Martin
 
@Sp3000 nice :) ... I have no clue why I treated the beginning of the strings specially to be honest :D
 
Damnit permalink
Ahaha actually that makes perfect sense
It was the first thing I thought too, because it's like the 2n+1 for how many matches are needed to make the shape
 
@MartinBüttner That was a zero-char fix.
\s to \W
 
1:36 AM
how would you guys solve a sliding block puzzle (where bricks of different shapes are in a fixed area, and you have to move a specified block to a specific position)?
(optimizing for efficiency)
 
2:26 AM
brute force :P
 
3:19 AM
@xnor You're right - it's shorter by a byte
... so many parens
 
3:39 AM
Woop, two more bytes from our favourite 1% trick
 
3:51 AM
Oh n-~n+n%2, not sure why I thought that wouldn't work before
 
yeah, changing 2*n to n+n gives a place for the -~ to latch onto
 
Somehow my mind thought it would become (n-~n+n)%2 instead of n-~n+(n%2) :P
(Operator precedence is tricky business)
 
probably because &1 works like that
 
Ah maybe
Urgh, if precedence worked differently I could probably do " %s\n"%(n/2*4*"_")
 
4:11 AM
oh, what goes wrong there?
 
Because % and * are the same precedence, with 1%n*" %s\n"%(n/2*4*"_") when n is 1 we try to format an empty string and get a TypeError and with " %s\n"%(n/2*4*"_")*1%n we modulo a string by an int
 
ah
 
If % had higher precedence I could probably even drop the parens around (n/2*4*"_") :P
 
 
6 hours later…
10:09 AM
hm, do function submissions have to be reusable?
 
10:38 AM
I'd assume so... but do we have a meta post on that?
 
i've seen submissions that weren't and nobody complained
though personally i'd favor such a rule
 
I try to point it out if I see one, but I don't always try to decipher peoples' code...
 
here's one though where the poster followed this rule at the cost of a character: codegolf.stackexchange.com/a/36572/20260
 
posted on meta
 
i think there's slightly different versions of the questions that might help to clarify
 
10:47 AM
0
Q: Do function submissions have to be reusable?

Martin BüttnerSimple question: if I answer a code golf with a function (for a task which is supposed to terminate), does the function actually have to be reusable? Or could it, say, modify some globals which break the function when called again?

 
does the following have to work: l=[1,2,3];print f(l);print f(l)?
 
You might want to clarify reusable = same results after use
Unless you mean something else?
 
@xnor I think that's a different matter
@Sp3000 good point
 
@MartinBüttner I think it's worth clarifying that; I wouldn't have been clear from the meta post
 
Also related is whether functions can change their arguments, but I guess that could be a discussion for another day
 
10:49 AM
yes, that's what I was asking about
 
Oh, right
 
by the way, did we ever rule on functions that output by modifying their arguments?
 
no, but I know the place to add it
0
A: Default for Code Golf: Input/Output methods

Martin BüttnerFunctions may output by modifying their arguments or writing to out arguments

heh... I've been waiting for a downvote on the Retina answers since yesterday... now I got a downvote... on my Mathematica SUDSI answer o.O ... that's surprising.
@Sp3000 I clarified "reusable" by the way
 
I saw :)
 
I'll also add an answer for the stricter definition
 
10:53 AM
I like that better
 
@xnor I don't understand your edit
 
i was trying to give a reason to favor not requiring reuse
if a function can break after one input, it would require theoretically testing sequences of test cases
 
but how does that make testing easier? it seems to make testing harder if I have to restart the program between test cases
 
i remember i had a bad case where only certain sequences of test cases caused a failure
maybe that's too obscure a reason
can you think of a better devil's advocate?
i was trying to balance out the answers :-P
 
I think the only advantage is that people can shave off some more bytes with it
but usability-wise I don't see how it could have any benefit
 
10:59 AM
usability-wise, we shouldn't be golfing code :-)
 
Depends on the usability model. Golfing code is definitely the right way to approach coding on a mobile phone with a small screen and a soft keyboard.
 
11:20 AM
ri_K*,:)\{1$>2<_:+(\:-z(t}/0= if cjam had array swap
or maybe et
J/APL has array swap ?
 
11:46 AM
Is there a guideline on how different 2 answers should be?
I have a 45 byte solution in Pyth for the SUDSI sequence. But it's more or less a golfed version of Pietu1998's 51 byte solution. Well I save 5 bytes using golfing tricks, and 1 byte by using a simple observation regarding the sequence.
Any meta-post about this?
 
i think the consensus is that its upto you and good faith
 
@Jakube I don't think so. It's really up to your best judgement whether you wanna be a sportsman and give him those 6 bytes or post them yourself.
 
ninja'd
 
indeed
 
funny that the meaning is almost exactly same, though the line length is more than double :D
 
11:51 AM
I'm not surprised :P
 
so. about the bytes from yesterday.
 
O.k. Thanks. Normally I comment stuff, but I think this time I'm gonna post it myself.
 
should be create a new meta post about flags ?
 
no
if you disagree, post another answer to the old post
(I actually made a new meta post recently, because I wasn't aware of the old one, and it was rightly closed as a dupe)
 
12:28 PM
I hope whoever nabbed that review rejected it :p
 
@MartinBüttner from my experience, it is bound to get down votes
how is Pyth same size as CJam ? :O
 
12:46 PM
Pyth same size as CJam = one of you two is doing it wrong :P
2
 
being badass smart is wrong ? :P
 
@Optimizer Just found a 41 Pyth solution :-)
 
nooooooo
 
@Optimizer it's meta though so who cares?
 
@MartinBüttner we need up votes to actually make that as the consensus
 
12:55 PM
you're not gonna get upvotes by reposting the question though :P
 
my point was - you do it :P
 
1:13 PM
gosh 41 in cjam too
 
@Optimizer Great
 
40 actually
 
Damn
 
39
 
Stop
 
1:26 PM
We Can't Stop
We Won't Stop
 
1:38 PM
pretty sure that user23013 or isaacg will come up with something shorter though
 
IE is being discontinued... how did I miss those news for more than a week? o.O
@Optimizer might do later
 
It's not discontinued, it's just being de-emphasized
 
well it's replaced by a new browser and IE isn't gonna get the new engine
I'm pretty sure they're not gonna drag along two browsers forever
 
obv when the dev teams is not focusing on new browser, they will halt development of previous one
its just a rebranding , nothing else
think of it as a very modern IE, with a different name as IE has a very bad rep
 
is the new one backwards-compatible?
 
1:53 PM
what does that mean ?
 
@Ypnypn as far as I'm aware it's not, which is the point
 
2:06 PM
2
Q: Byte counter snippet

orlpSome people have been linking to off-site resources for counting the length of an answer (mostly https://mothereff.in/byte-counter). Some people also pointed out that it only counts in UTF-8. Well, I was bored so I created a snippet. It counts in UTF-8 if you paste in code, and counts in pure bi...

 
2:20 PM
@Peter the quality of coal :D ... thanks for the edit
I actually even knew it's 8859 but I have no idea how I managed to mistype it twice
 
@Optimizer 40
 
ATB
 
3:08 PM
sup
 
3:48 PM
I just placed my first bounty ever, then checked my profile, and freaked out: "who has downvoted me for 150 points!?"
Short memory.
 
75 questions
somebody reaaallly hates you
 
It makes the rep history graph ugly. "green green green green... wtf?"
 
2 mins ago, by Geobits
It makes the rep history graph ugly. "green green green green... wtf?"
 
1 min ago, by Optimizer
2 mins ago, by Geobits
It makes the rep history graph ugly. "green green green green... wtf?"
 
0
A: Sandbox for Proposed Challenges

MigueChildren Sum Game code-golf When I was a kid I liked to play a sum game with my cousin (I don't know if there's a name for the game). The first player choose a number between 1 to 9, then by turns players go summing a number between 1 to 9 to the result until one is able to reach 100. So, the...

 
3:57 PM
@trichoplax you were wrong!
 
 
1 hour later…
5:08 PM
@Jakube how recently are we talking ;)
 
Just wanted to tell you.
The golf was actually quite obvious.
 
how do I run it ?
oh, does not work online .. forgot
 
5:24 PM
would people care to up or downvote this new proposal for a default output method?
0
A: Default for Code Golf: Input/Output methods

Martin BüttnerFunctions may output by modifying their arguments or writing to out arguments

 
Since I explicitly asked you about this on a challenge, I guess I should upvote it ;)
 
 
1 hour later…
6:35 PM
@MartinBüttner How do you know that serial voting was reversed on that meta post?
 
6:52 PM
Be prepared, Martin. I have unleashed main meta upon you XD
 
dupe of a dupe'
 
I commented about that
 
7:18 PM
@Rainbolt ummm... we discussed this at length in here at the time... not sure I can be bothered to sift through the transcript right now :D
 
7:31 PM
actually, looks like there was less discussion than I remember (chat.stackexchange.com/transcript/message/18467032#18467032) ... but I remember that I noticed that after a day all vote counts were reduced by 2 or 3, so that was suspicious ;)
 
 
1 hour later…
8:36 PM
@MartinBüttner If that default method of output goes through, I can drop a lot of bytes off of that duodyadic tiles challenge :P
 
9:32 PM
@MartinBüttner Eh. Doesn't matter now. I already got closed as a dupe and as a dupe of a dupe.
Oh gawd. I thought I had made it out of the newbie hole, and then I asked a question on DBA and got that dreaded question.
 
10:21 PM
0
A: Sandbox for Proposed Challenges

ReticalityHelp the President! Tags: code-golf There is an anonymous president of a country who needs your help! He wants to retain absolute control, but needs to have elections to prevent uprisings. They ask you to create a program to help them gerrymander. These are the specifications: Input (You wil...

 
 
2 hours later…
11:53 PM
@BrainSteel I can live with that. ;)
 

« first day (1516 days earlier)      last day (3328 days later) »