# On-topic to ask for help with an pre-existing code golf challenge from another site?

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.

• Related (see also the questions in the sidebar of that question under "Linked") – Peter Taylor Apr 11 '16 at 9:42

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.

• You're scoring by length in characters rather than bytes. That's prone to abuse.

• Requiring a specific kind of submission (program, function, etc.) overrides our Default for Code Golf: Program, Function or Snippet?.

While a challenge author can override this default and absolutely should if there's a good reason to do so, the community came to expect this liberty and will most likely frown a upon a challenge that overrides it arbitrarily.

• The current revision allows full programs now, but it still requires to return a tuple.

I'm not sure how to interpret that for full programs, and most languages do not have a tuple type. Some language do not have any iterable type at all.

• In general it is advisable to stick to our Default for Code Golf: Input/Output methods, and give as much liberty as possible when it comes to I/O.

Also, rounding to two decimal places seems unnecessary. This will make the task considerably more difficult for languages that do not have a built-in for rounding to x decimal places.

• Removing all of the above restrictions makes the problem rather straightforward.

Calculating the volume of a spheroid is nothing more than a simple formula. Calculating the surface area is just as easy if the language can deal with complex numbers.

Note that easy challenges may be received very well or very poorly. This is an unfortunate situation for challenge authors, but I'm not quite sure what to do about it...

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...

• 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. – Byte Commander Apr 12 '16 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.

• 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. – FryAmTheEggman Apr 11 '16 at 14:15
• @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. – James Apr 11 '16 at 14:54