There is a code golf challenge on a foreign (not related to Stack Exchange) site with which I have a problem. The challenge is designed for Python 3 and has a length limit of 150 characters.

I thought to post the challenge here and even open it up for other languages because there are posts on Meta that discourage language restrictions. I also added the original source as reference to the question, because the "How to ask?" help page said to do this. But nevertheless it got closed and strongly downvoted.

I already searched the Metas of Stack Overflow and Code Review as well, but both of them state that code golf and minimizing code length is off topic there.

So therefore I'm now asking here whether it's okay to ask this type (help with an already existing challenge from a foreign source designed for one language) of question here at all and how I should have worded it differently than I did to receive positive feedback.

  • \$\begingroup\$ Related (see also the questions in the sidebar of that question under "Linked") \$\endgroup\$ Apr 11, 2016 at 9:42

2 Answers 2



First and foremost, I have no idea why one of the comments suggested editing the attribution out. If a challenge is taken from elsewhere (with minor modifications), full attribution is required.


Taking a challenge from elsewhere and posting it here with nearly identical rules will rarely go well.

Close votes

I'm rather surprised by the close votes. There's only one concern about the question's clarity in the comments, and it has been posted after the challenge was closed.

I'd add to Peter's question about rounding that you should specify whether we have to worry about floating point errors. For example, if you decide on rounding towards the nearest multiple of 0.01, rounding halves up, an unrounded result of 0.13499999999999998 representing an exact value of 0.135 would get rounded down to 0.13, but should get rounded up to 0.14.

If this is addressed and the tuple situation is clarified, I don't see any further issues with the question's clarity.

Getting help

Since your intention was to get help with a particular code golf problem, all changes to the original problem will take you farther away from your objective. Furthermore, you're not at all guaranteed to get a Python submission to your challenge (although you probably will). Reshaping your challenge into a question, as suggested by Dr Green Eggs and Ham DJ, might be a better idea.

It looks like Empire of Code is a game and not a contest, so unless I'm mistaken and answers to your question could be used to gain advantage over others or to win a prize, that question should be perfectly on topic here.

One final concern may be a prohibition by Empire of Code to re-use their challenge ideas or receive outside help. Their terms of service currently give me a 403, so I can't check...

  • \$\begingroup\$ Empire Of code is a game where you can get minor improvements to your buildings by solving small coding challenges. And (probably) all of their challenges are taken from checkio.org and also available on GitHub for example. But Thank you very much for your detailed explanation. I think I will convert it into a tip question if you dont mind, because that would make your Jelly answer not fitting any more. \$\endgroup\$ Apr 12, 2016 at 6:09

Do you want help with an already existing challenge, or do you want to post the already existing challenge as your own? If you want help on golfing it, I would say it's definitely on topic. We have plenty of questions like this, and they're all fairly well received:

Now, none of these are about an external challenge from another site, but I see no reason you couldn't ask that. Make it clear in your post, and you'll be fine.

The reason your question was not well received was because you posted it as a challenge, not as a "How can I shorten this code I wrote?" As a challenge, here are the problems with your question:

  • You didn't describe what formula could be used to calculate the correct output. This makes it harder for people unfamiliar with this knowledge to participate. This is what the sandbox is for.

  • You didn't come up with the challenge yourself. This is the bigger problem. This is discouraged by community consensus

If you want help golfing the code, I would phrase the question like this:

There is a challenge on [link to the challenge] where I need to take the height and width of an oblate or prolate, and return the surface area and volume. The formula to calculate this is:

volume = foobar()
area = baaz_quux()

Here is my attempt to golf it in python:

#Code here

The challenge requires my code to be under 150 characters, but I can't make it any shorter. Do you have any tips on how I could golf this down further?

And then tag it with and and you'll be good to go.

  • \$\begingroup\$ I'm not familiar with the site in question, but in some cases it is probably cheating to receive outside help.This question is sort of worded to be general, so I think it might be worth saying that we won't answer questions that help the asker cheat. Just to clarify again, I'm not saying that directly applies here, but just in case someone else reads this post asking about something else or when we need to link to it to say why a post was closed, etc. \$\endgroup\$ Apr 11, 2016 at 14:15
  • \$\begingroup\$ @FryAmTheEggman I hadn't thought about that. That's a great point. Maybe that should be a separate meta post. If we require linking to the original challenge, that will help, since we can see how that particular site views outside help. \$\endgroup\$
    – DJMcMayhem
    Apr 11, 2016 at 14:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .