« first day (1638 days earlier)      last day (3219 days later) » 

12:29 AM
Hm, I think there's a way to get the same bytes with the approach where I move the spaces to the front (which feels more elegant). I'll try that tomorrow.
 
 
3 hours later…
3:19 AM
0
Q: FizzBuzz Reverse Solver

Pyrrha Synopsis: Given the output of a generalised FizzBuzz program, return the list of factors and words used for the program. Challenge Description Imagine a generalised FizzBuzz program that takes in as input a list of factors and words to use and the number to start from. For instance, if the ...

 
4:04 AM
damn
there's a massive flaw in my challenge I just realised
you just have to count backwards
...
 
4:31 AM
No answers yet. Easily fixed?
I'm guessing you mean because it always terminates at 100?
If so, maybe make it 100 lines each time instead, so 3-102 for the first example.
 
4:44 AM
Thinking of posting a physics challenge...
are physics challenges well-accepted on PPCG?
I would of expected more...
 
@Geobits: It's a bit strange that your avatar almost matches the favicon of the company I work with
 
@grovesNL apparently Google thinks your company is an orange :/
 
It made me do a double take at least...
@vihan1086: Very close :-)
 
It's no coincidence. I'm pretty much a stalker. I did the whole thing with a twist. Down is opposite up, blue is opposite orange, little triangle instead of big (relative to circle).
 
Apparently. I like it even despite the fact that it made me do a double take.
 
4:57 AM
It also happens to match the 'downvoted' arrow on beta SE sites. That is purely coincidental.
 
@vihan1086 If it's a specifically physics-based programming challenge, we'd be happy to have it :D I don't think we get much of them.
 
@Geobits: That's interesting, perhaps my company's favicon was inspired by the upvote arrow...
 
@vihan1086 The base topic of the challenge only matters so much. Physics, ascii art, math, pokemon... what matters far more is 1) clarity 2) level of interestingness 3) framing.
 
I would be interested in some physics-based (dynamic) challenges. Especially motion animations (although that may limit the number of responses you get)
 
@grovesNL I like that idea. "Hey, that's a cool logo we should steal." "Won't they be upset?" "Nah, we'll make it orange".
 
5:02 AM
@Geobits: Yeah... I'm just going to pretend I didn't notice this.
 
Well it's not like it would be the first time something like that happened :P
 
True, there are only so many ways to combine primitive shapes
 
Honestly, even if it was straight up stolen and colored, I don't think it would matter. It's not like SE is widely known by their beta upvote arrow or anything. I'm not sure they'd have a case in the "it causes consumer confusion" area at all.
If it was the main logo, that'd be a different story for sure.
 
Someone should make their company logo a square and see how long it takes for them to get sued
 
@Sp3000 They'd probably get sued by Square
 
Ouch - sometimes I wonder how simplistic a name needs to be before it's deemed "too obvious to copyright" (or whether such a rule even exists)
 
@Geobits: I missed the obvious
 
@Sp3000 I'd look that up in the copyright record but the website is way too slow. I've been waiting over a minute for the query to load
aand timeout
nvm, turns out Square has been copyrighted many times
 
5:38 AM
... things can be copyrighted multiple times?
 
apparently ...
 
0
Q: Find the reference angle

MaltysenThis is a fairly simple question. According to this random website I found, a reference angle is the acute angle formed by the terminal side of the given angle and the x-axis. You have to write a program to find these. I don't remember anything from algebra 2, what does this mean? Angles are us...

 
6:02 AM
0
A: Sandbox for Proposed Challenges

vihan1086Make Earth (or any planet) a Ring code-golf physics Introduction Saturn has a spectacular ring system that was first observed by Galileo in the 1600s. Unfortunately earth doesn't have one... yet. Saturn's ring's origin has two main theories but this challenge going to focus on Édouard Rouche'...

 
@NewSandboxedPosts I need help with the title for sure
seems a bit simple too
 
@Geobits tbh I don't see a problem with you posting it - with a golf this simple it's not surprising that people will come up with the same method
 
I'm not worried about it. I've seen it happen before (and been part of it), where a bunch of people post the same simple thing in multiple languages. Trying to avoid it lately, no big deal.
 
6:34 AM
Java and C# are both brutal for code golf. I've written tons of solutions in C# and didn't bother to post them
 
Yea, I've got a collection of unposted stuff that either didn't work out or ended up too long. I just assumed most of us did :D
 
6:52 AM
Yeah I just decided to learn Pyth tonight so I can actually post again
 
One day I'll join you guys with Nim and we can all suffer
 
@Sp3000 You don't copyright names. You may be able to get trademark protection, but that's a very different branch of intellectual property law.
@vihan1086 No, there are many copyright-protected books, songs, etc. with "Square" in their name. That's completely different.
 
Oh? So copyright =/= trademark?
 
@Sp3000: Actually Nim may be ok for code golf
 
I dunno, from the one golf attempt I've done it was pretty bad IMO :P Maybe I was doing it wrong shrugs
 
7:04 AM
It's obviously at a disadvantage but I could see it destroying C#/Java
 
Really? What makes you think that?
 
Mostly the syntax, especially parentheses
Semi-colons, etc.
 
No. Copyright is for a fixed term (modulo the activities of the US Congress and then the US Administration's efforts to force its extensions worldwide by trade agreements) and grants exclusivity over reproduction and the creation of derivative works.
Trademark protection can be indefinite, although it can also be lost if there's evidence that the mark isn't associated with the company by the general public, and grants exclusivity over use of the mark as an identifier within specified areas of business.
 
Hm... I see...
 
7:25 AM
You know what is abhorrent for golfing, scheme. Missing so many features (R5RS). Maybe I should try with Racket instead
 
Yeah Lisp has some major issues with code golf
 
 
2 hours later…
9:06 AM
@xnor @Vioz- and other Python golfers - anyone tried this anarchy golf? I seem to be off by a few
 
@Sp3000 what's your progress on TIS?
 
Halfway along the second row I think
Up to interrupts?
 
ah okay
 
How about you?
 
I did the first stack-based one the other day, but I think I skipped peak detection and I stopped trying to solve each one optimally before moving on (except for minimum number of nodes)
 
9:13 AM
Ahaha k :P I tried the each-one-optimally think for Spacechem and look at me I'm not even past the first page
 
I don't remember how far I got in SpaceChem, but not very far :/
 
Tell me if there's any you want to work out optimal for together :) (though we might need a new chat again)
 
will do, but I'll try to solve all of them first ;)
 
:P k
 
10:03 AM
@Sp3000 started on the image module challenges now... this is fun :D
(still haven't finished the peak detector though...)
 
10:52 AM
what is this challenge/site you keep talking about?
 
Is this the serious stuff ?
 
really serious
 
are you serious?
 
is there some demo or you have to buy it?
(seems like there isn't a demo)
 
11:07 AM
no clue, I just bought it
it's really good though (as you'd expect from zachtronics)
 
11:43 AM
but what if I don't want to code in my games as well :|
 
then a) don't buy it and b) I'm not sure what you're doing here
 
time waste ?
 
12:23 PM
I've started doing a blog series called
A Practical Introduction to Pyth
 
on a blog called "sofa is cargo"
 
@Optimizer It's an anagram of my name
 
oh.
Why'd you change that "feel free to check it out" sentence to ping me ?
 
Accident
 
s happen
 
12:25 PM
I forget that down doesn't undo up
 
lol
 
 
1 hour later…
1:48 PM
@RetoKoradi There are many languages that call it modulo operator and yield negative results for some arguments. I agree that it would be more useful if it were positive though. This is how GolfScript implements %.
 
The problem is that most languages do integer division with rounding toward zero - which I hypothesise was a design decision made by a PDP engineer and then grandfathered into languages first implemented on the PDP - and for consistency they must handle modulo differently for negative inputs.
@Dennis, out of interest, what was the comment on my answer to which you replied? I've only seen your comment because the other one was deleted. Was it asking why I use d instead of i?
 
@PeterTaylor It was a suggestion to use , and = instead of %, which always yields non-negative results.
 
Modulo functions get even wonkier when you supply a negative input.
 
2:24 PM
*Modulus
 
I'd rather have an Illudium Q-36 Explosive Space Modulator.
 
0
A: Sandbox for Proposed Challenges

PyrrhaMexican Wave code-golf kolmogorov-complexity In as few bytes as possible, write a program or function that prints the following to STDOUT. Abcdefghijklmnopqrstuvwxyz aBcdefghijklmnopqrstuvwxyz abCdefghijklmnopqrstuvwxyz abcDefghijklmnopqrstuvwxyz abcdEfghijklmnopqrstuvwxyz abcdeFghijklmnopqrst...

 
2:39 PM
@Geobits a Geobits on a Saturday... What happened to you?
 
At the family's place, but everyone's split off doing different things. So I'm hanging out with the dog at the moment, not sure what's in store for later :D
 
Ah, I see. :) Say hi to the dog!
 
3:06 PM
@MartinBüttner the balancing group snake solutions doesn't seem to work for me, or is it extremly slow?
 
3:17 PM
@Dennis Yes, and I think it's wrong in all of them. ;) Seriously: I do think it's unfortunate that it's defined that way in a lot of languages. Like @PeterTaylor, I suspect that it was done that way at some point because the underlying assembly instructions on the machines they were using were defined that way. I certainly wouldn't define it this way in a newer language, particularly if the implementation is not targeting the generation of high performance code.
 
3:52 PM
@randomra it can get fairly slow for larger inputs (and larger numbers of spaces)
try the 107 byte version, that was a bit quicker
 
@MartinBüttner even this doesn't finish (with empty input):
^
<|:)~  ~(:||>
\S+( )+.+$(?<=(?(1)!)^([^|/]+(\|+|(/.)*(?<-1>(?<=(.*))\|(?=(.*)))*))+[^|]+)
_$5/\$6
)`_(.+)
$1
I have a feeling this will be my mistake, but can't see how
 
hm
oh
well if you prepend something to the code, you'll need to add (` to the long regex
otherwise you'll add the input to the string in each loop iteration
 
right, my mistake...
have you said that you have a same length solution with the spaces brought ahead? if yes, have you shorten the space-swapper line-pairs (they can be 1-1 byte shorten than what you first posted)?
 
@randomra I did say that but was mistaken. unfortunately <space>+\n$0$`$' did not quite work as I had hoped :D
but yeah I can actually shorten each swapper by two bytes
doesn't bring it below 100 though (even with shortening the main regex in that solution)
 
4:18 PM
I've got one more idea for how to do it in a single replacement... let's see...
 
4:38 PM
0
Q: Give me cookies! (Trig challenge)

DDPWNAGEThe scenario: Your high school trigonometry teacher, after hearing that you've been studying programming and computer science, wants to offer you a challenge. The challenge: For each of the following trig functions you are able to solve in code, you get one cookie: cos, sin, tan, arccos, arcs...

 
@MartinBüttner seems like you can leave out the $ as first the ( )+ is backtracked before the next .+ is backtracked
at least based on my tests I ran
and 0 spaces will always match
 
could you try <|||:)~ ~(:|||>? I feel like without the $ it could yield <|||:)~~(:/\/\|>
 
that works
 
hm, odd
 
do you now how the backtrack works?
 
4:46 PM
it should backtrack the later parts first
so discard one character from .+, then try the lookbehind again
 
I will investigate this...
 
I've got a 81 byte loopless solution, but it doesn't remove the spaces yet :/
\|(?=(.*)$(?<=(?=[^|]+((\|+|(?<-5>\|(?=\1())?)+)[^|]+)+$(?(5)!))^.+( )+\S+))\4
/\
should hopefully be doable in 14 bytes
 
Before I joined this site, I thought I were pretty good at regexes. :P
 
so did I before I saw jimmy use them :/
 
I started using regexes here, so I assume this is the standard usage :)
 
4:52 PM
The self-matching one?
@MartinBüttner
 
@Dennis that. and adding numbers. and I think there were some crazy submission for the cops and robbers challenge as well. (and Pyth-like Syntax Checker)
hm, getting rid of the spaces is trickier than I thought
currently costs me 22 bytes
 
Never paid attention to the addition challenge. Addition in regex with only two substitutions...
 
and the first is only for the necessary alphabet
there is no way to do it in 1 I think
 
hm, best I've got so far is 98:
.(?=(.+)$(?<=(?=[^|]+((\|+|(?<-5>\|(?=\1())?)+)[^|]+)+$(?(5)!))^.+( )+\S+))\4
/ \
+` (.*?~.*?)
$1
one more byte and I can at least replace it
although it's still annoying that I need this many bytes to get rid of the spaces
well, I guess I can omit the ^ the same way I could omit the $ in the current approach (although I still don't see why)
oh, I think it's because the [^|]+ ensures that I'm not starting within one of the parts
actually, I think I can shorten that to simply <
that's possible in either case though
haha: (?<=(?=<...)) legibility win
 
5:11 PM
@MartinBüttner Oh boy, there's image modules? (Just finished interrupt then fell asleep for 8 hours)
 
if \|+| wasn't confusing enough
 
@Sp3000 you still haven't read the manual apparently...
 
I'm the type that reads what I need as I need it :P
... I'll go read it :(
 
I hope you've at least started clicking the DEBUG buttons by now?
finally... found a byte (that only exists in the new regex) that I can remove... so the solutions are now the same length...
(92)
.(?=(.+)(?<=(?=<((\|+|(?<-5>\|(?=\1())?)+)[^|]+)+$(?(5)!)).+( )+\S+))\4
/ \
+` (.*~|~.*)
$1
 
Which buttons do you mean? I've used step and saw the bit on breakpoints (though I haven't used any yet), or did you mean something else?
 
5:17 PM
there's a big red DEBUG button on one of the "communication failure" nodes in each level
 
Oh... I see
 
yeah... now go back through all the levels in order ;)
 
Got a lot of reading to do
 
Immersion is overrated, right? :P
 
I came for the assembly, what plot? :P
 
5:36 PM
JavaScript is insane.
260
Q: Why does 2+ 40 equal 42?

GOTO 0I was baffled when a colleague showed me this line of JavaScript alerting 42. alert(2+ 40); It quickly turns out that what looks like a minus sign is actually an arcane Unicode character with clearly different semantics. This left me wondering why that character doesn't produce a syn...

 
6:13 PM
K0VT=K+Kc*^t0N^Q*2N.!*2N;K
 
@grovesNL I know that one. It took 2 PPCG users and 30 minutes until I understood why {}+{} and ({}+{}) give different results.
 
I'm curious if there's a shorter way to do Taylor series in Pyth
@Dennis: Yeah it's very fun debugging edge cases sometimes
 
@grovesNL well just looking at our code, Z autoinits to zero
 
Nice, I searched for a 0 autoinitializer but didn't see it in the reference when I glanced through
 
VT=Z+Zc*^t0N^QyN.!yN;Z
y is the same as *2
 
6:19 PM
Oh yeah I forgot about that one too
So 23 bytes? I guess that's 1 cookie...
 
more: =Z+Z is the same as =+Z
17 bytes using map smc*^_1d^Qyd.!ydT
 
I tried to do that with K but it kept failing. Maybe I had the operators backwards
 
possibly two cookies with cosecant
 
Ah that map is cool. I haven't tried working with maps in Pyth yet but it looks easy based on that example
 
yup, two: @,Ksmc*^_1d^Qyd.!ydTc1Kvz
 
6:26 PM
Nice, I think 2 cookies is the maximum anyone could have reasonably managed
 
yeah 25 bytes is way too small
 
6:59 PM
0
A: Sandbox for Proposed Challenges

DennisTMTOWTDIIC (CJam micro-golfing challenge) code-challenge cjam TMTOWTDI is true for most programming languages; CJam is no exception. When golfing CJam programs, it's quite common to completely rethink your approach, just to discover that the new one is neither shorter nor longer than the one yo...

 
What are the full forms ?
 
If you're asking me, I don't understand the question.
 
MTOWTDI
TMTOWTDIIC
 
There's more than one way to do it... in CJam.
 
wow
 
7:10 PM
@Dennis can you add problems 1by1 to your answer or do you have to post is as a whole? also can you modify your solutions?
if you can modify can someone else pick up your dropped code?
 
Good points. Yes to all three.
I'll forbid changing you approach to one of equal length though.
 
others using one's code+a noop for optimal+1 length is not a concern I guess as non-optimal length code has little value, right?
 
Well, it's better than having no answer at all for that problem. I disallow noops, it becomes even more FGITW than it already is...
Do we have a peak hour where most of our users are active?
 
Around this time or a few hours back
12 hours from now it's quiet :/
 
I think I'll add a time to the sandbox post when the contest will launch. Participating early will be quite an advantage.
 
7:22 PM
Something tells me I need to add to that tutorial too :P
 
Wow, this is really something (NSFW) youtube.com/watch?t=81&v=BFD2293oGvA
Also, a bit of spoiler alert.
 
8:04 PM
wow, someone downvoted my retina or trash answer. I thought we were past the golfing-language-hate era
 
Happens every once in a while.
 
@Dennis You should probably make an exception for cases where you discover that someone else has dibs on the solution you posted.
 
@PeterTaylor For the you must make it shorter rule? Yes, definitely.
 
I must say that if I were not a llama, I would have been a goat
goats don't care bout gravity http://t.co/adDLROreCE
 
Piet is such an interesting and painful language...
 
8:10 PM
I know the guy who proved it Turing-complete.
 
I applaud him...
It took me hours to code out my program...
 
@PeterTaylor Is it the same guy who proved MtG TC or do you collect acquaintances who like to prove the TC-ness of systems in their free time? ;)
 
No, it's not the same guy, although they did share a house when they were both students at Cambridge.
 
@DeadChex I'd say that's a lot of wasted codels, but knowing Piet I doubt you'd be bothered to do a rewrite any time soon :P
 
I went for pretty over compact, but rewriting is a no
 
8:22 PM
hmm, groups in lookbehind are numbered LTR, that seems counter intuitive at first
 
@Optimizer Gravity is overrated anyway.
@Winny I think I speak for a lot of the folks here when I say that this is our favorite Stack Exchange site too. :)
@Optimizer This is the first time I've heard of that movie but I'm sure not going to see it now.
 
Scott Pilgrim, but for assholes. Nice.
 
Haha
Well that was definitely the most negativity I've seen come out of a person since I read the C++ language handicap meta post.
 
8:43 PM
Is there a shorter way do create [-1, 1] than ,1t0 in Pyth?
 
8:53 PM
Not shorter, but maybe a little bit clearer: ,1_1
 
Yeah I noticed that one too
 
@Winny Hello!
 
Hi @AlexA. thanks!
 
9:09 PM
I'm glad you've joined us in the magical world of The Nineteenth Byte.
 
I am enjoying this wizardry
 
What initially got you interested in PPCG?
 
I think i saw one of its questions in the 'Hot questions' sidecolumn of the SO websites
 
Nice. That's how I got started too.
 
@grovesNL btw you might like this chatroom chat.stackexchange.com/rooms/24159/pyth
 
9:16 PM
@Winny: Yeah I should probably start hanging out there :P
 
9:41 PM
@randomra wow, I would hate for it to be the other way round
it's nice that you can count groups by just looking at the regex without knowing about RTL mode
(in fact, I don't think it's common knowledge that lookbehinds are matched RTL in .NET)
 
maybe because people don't use variable length as it is only dotnet, and with fixed length it doesn't matter
 
I was aware that it's variable width long before I knew that it's RTL (I just assumed it would attempt every possible length LTR)
and as far as I'm aware MSDN never mentions that it's matched RTL
 
This may sound entirely ignorant, but is the primary difference between JavaScript regexes and .NET regexes that JS doesn't support lookbehinds?
 
well .NET is a lot more powerful than most flavours and JS is a lot less powerful than most flavours
but that's an important difference yes
 
Hm. Are there any JS packages or whatever that give it .NET regex support?
 
9:54 PM
> Also note that the lookahead assertion (the (?=subexpression) language element) and the lookbehind assertion (the (?<=subexpression) language element) do not change direction.
Well this is misleading
 
@randomra whoa
@AlexA. not that I'm aware of
 
@MartinBüttner (it is from msdn) msdn.microsoft.com/en-us/library/yd1hzczs.aspx
@MartinBüttner also your current regex is quite complex with 4 lookaround + 1 balancing group nested
 
haha, yeah the nested lookarounds are fun :D
 
10:14 PM
I wish there was a way to switch off my PPCG addiction long enough to get things done.
5
 
 
1 hour later…
11:18 PM
You'd think, having posted that an hour ago, that I would have gotten something done by now. Well, you'd be incorrect.
 
@AlexA. when that (1) comes up in the title of that tab. . .
 
Ah yeah, I know. Pure torture.
 

« first day (1638 days earlier)      last day (3219 days later) »