2

There is a set of programming puzzle problems I faced recently, some of them I did very poorly, whereas others were just not possible.

For the poorly-solved ones, I suppose that Code Review is a good place for improving my solutions.

But, about the ones I couldn't solve - is there a right place in the SE network for getting assistance on how to approach these puzzles? As in, algorithm suggestions.

2

2 Answers 2

1

You should take a look at Code Golf. That's the (currently in Beta) Stack Exchange site for Programming Puzzles. Post your puzzles there and see who comes up with the best algorithm.

5
  • (for relatively lax definitions of "new" - that site was launched more than 2 years ago)
    – Mat
    Apr 23, 2013 at 20:03
  • You can find out when a beta site was launched from the site's Area 51 page (which is linked in the site's sidebar).
    – Mat
    Apr 23, 2013 at 20:05
  • Keep in mind code golf is generally about using the fewest number of characters, rather than code that performs the best, runs the quickest, is the easiest to understand, has the best written explanation (regardless of code), etc. That may or may not be what the OP actually wants.
    – Servy
    Apr 23, 2013 at 20:06
  • 1
    @Servy: The site's full name is "Programming Puzzles and Code Golf". Problems whose winning criteria are other than "least code" are on-topic.
    – jscs
    Apr 23, 2013 at 20:08
  • @JoshCaswell That assumes that he's only interested in a solution to the puzzle, and nothing else besides that block of code. It wouldn't be the proper site to go to to discuss algorithms for solving the problem at a higher level, for discussing why his existing solutions aren't working, for getting a detailed discussion about that answer or the important concept(s) the puzzle is designed to teach, etc. If he really just wants an answer key to his puzzles, then sure, code golf may be fine. His question implies otherwise though.
    – Servy
    Apr 23, 2013 at 20:16
1

If it's a good question it doesn't matter if it's a puzzle that you found out of an interesting book you're trying to solve for fun, or something you need to solve in your day job at Some Corporation. It's just a programming question. You're more than welcome to mention that it's just a puzzle you're solving for fun if you want, you don't need to, but you certain can.

That has no basis on the quality of the question though. As with any question it should be clear what the problem you need to solve is (that shouldn't be so hard in your case) you should demonstrate research attempts and effort spent trying to solve the problem yourself. For a lot of these puzzles they're very common and have easily discoverable solutions online. Make sure to look for them before posting about it here. Next you should be posting your attempt at solving the problem. Ideally it would involve code, but it could be as simple as a higher level description of how you are approaching the problem. (If your "algorithm is wrong that may be what you question is about, rather than a more narrow "why doesn't this compile" type of question.) You should be describing what aspect of what you have so far isn't working. Are you getting errors, does it not compile, is the output wrong (if so, how is it wrong and what should it be), etc.

If you're just copy-pasting the puzzle onto the site and asking for a solution then it's a very low quality question (on any site) and is likely to be closed for a lack of research effort.

If you have put in this time and effort, and demonstrate that you have done so in your question, then it would be on topic on Stack Overflow

You must log in to answer this question.

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