# Let's create some new types of challenges!

Our site needs unique content. The more different and new a question is, the more interesting it will probably be. Therefore, let's propose new genres of challenges!

What exactly is a challenge genre? It's one of these. The most commonly used ones are , , and . Let's create some new ones! Here are some guidelines to follow in these challenge genres:

• Make it non-opinion-based. is nice, but it's kind of stretching it. Given a list of all of the submissions, you should be able to objectively choose which answer is the winner.
• Don't be boring. This should go without saying, but a genre would not be unique and interesting enough.
• Try to attract quality over quantity. One of the main reasons that I'm against is that it naturally attracts many mediocre answers, not a few high-quality ones.

To propose a genre, ask a question here on meta with the tag. Once a genre has reasonable support, it's time to post a question using that genre in the sandbox. Then, once that question is posted on the main site, the newly created tag can be used on a regular basis!

• What is with the [code-golf] questions that have bonuses? Should we make a genre for those? – Justin Mar 18 '14 at 0:08
• @Quincunx You could post that here, and see what the community thinks. – Doorknob Mar 18 '14 at 0:28
• How about [code-putt-putt]? :p – Geobits Mar 18 '14 at 1:14
• Yall, you do know that you should do [tag:whatever] in stead of [whatever] – TheDoctor Mar 18 '14 at 2:14
• @TheDoctor The styling of tags in comments is terrible though, so most of us just use brackets when commenting. – Doorknob Mar 18 '14 at 2:47
• @Geobits I'd prefer [code-mini-golf]. putt-putt is "putt putt saves the zoo" (Google search suggestions for putt putt). (No I did not search them before on this computer) – Justin Mar 18 '14 at 4:03
• @Quincunx Well that's certainly... interesting. – Geobits Mar 18 '14 at 4:11
• great to see this high voted proposal & think new-genre is a great tag demonstrating/positively affirming the newness/openness of this site. recently proposed some ideas along the lines of research or research-program or series. the idea is to build a competition based on real science where there is a continual evolution of challenges/answers where new ones build on prior ones and respondents share code open-source style for the next challenge in the series. am not gonna propose it on meta yet though because am just a newbie around here & still getting a feeling for group conventions. – vzn Mar 25 '14 at 1:37

# Code reuse

What about a type of challenge where you have two tasks, but your goal is to reuse for your second task as much code from the first task as possible? To avoid just blowing up with pointless code, the total length of the two programs should be taken into account as well. A possible (though probably not the best) metric could be the length of the first program plus the length of the unique part of the second program.

• There have been one or two questions like this. There was a complicated one about RPN conversion which demonstrates the importance of taking into account the length of both programs; and I did a two-parter which offered a saving for code reuse. – Peter Taylor Apr 6 '14 at 22:20

# Fragile Keywords

Everything is falling apart! When you use a keyword or function, it breaks and you can't use it again.

Additional rule to make it more difficult to work around:

• Aliasing something counts as using it. Built-in aliases are fine, such as PHP's count() and sizeof(), but if you say #define v void, you can't use #define, v or void again.

This will make simple tasks slightly more challenging (for most standard languages):

• No more than 2 or 3 loops in your code: for and while, foreach if available
• No more than one function or class

## Hard Mode

This could be a separate tag (fragile-keywords-hard) or just optional rules for the original tag to make it more challenging, such as:

• Types are fragile too; string, int, double, void etc.
• Numerical operators are fragile; +, *, -, / etc.
• Variables are fragile

Combining them is probably not recommended.

• What about keywords/operators with multiple meanings? Like while { } and do { } while, or * as multiplication and * as dereferencing in C? Also, I tried something similar to this a few weeks ago, and it was a nightmare to specify without loopholes - and a considerable amount of people still had more fun trying to find and exploit more loopholes than just sticking to the intention of the challenge: codegolf.stackexchange.com/questions/28238/… (most of those are deleted now) – Martin Ender Jul 2 '14 at 8:01
• @m.buettner If while is used you can't have do/while too. As for *, I'm not really sure, I'd just leave that up to whoever was writing the challenge. – MrLore Jul 2 '14 at 14:28
• What about having the asker set a limit (by default it's 1)? – ASCIIThenANSI Apr 27 '15 at 21:22
• In addition, the title could be disappearing-code or cheshire-code (a reference to the Cheshire Cat from Alice in Wonderland.) – ASCIIThenANSI Apr 28 '15 at 16:24

# Take over the program!

I'm not sure how this would be implemented on a StackExchange site, but here's my idea:

• The asker provides a snippet of code.
• The asker provides two or more programs which could start with this snippet. That is to say, they give multiple tasks of similar difficulty.
• To compete, you post a snippet of code under a certain length limit.
• Upon receiving a vote score of +2, this snippet is added to the main program.
• Your mission is to ensure that the program fulfils the task that you have chosen. Competitors who select a different task will try to hijack the program to make it do their task.
• The winner is the person who puts in a code snippet that completes the program to match one of the possible tasks.

The question is carried out in a single language. (Though we could have multi-language variants - for example, a program in C++ could do something different from the same source code in Brainfuck. But that's just a random idea.)

# Restrictions

• No comments in source code. (Otherwise, you could comment out an opponent's code)
• Two supporters of the same task cannot post consecutive answers. The second answer can be ignored.
• The program needn't fulfil that task only. The winner is the person to post an answer the addition of which makes the whole program valid code which carries out one of the tasks.
• No two snippets may be identical.
• Additional restrictions will probably be needed
• In your second bullet point, did you "two or more tasks"? The idea sounds quite fun, but not practical on SE. a) I'd be really annoyed if I worked on a snippet, but someone else's got added, such that mine would now be invalid. b) If the OP isn't online 24/7 it's impossible for him to determine, whose answer got the 2 votes first. c) This would be similar to the Twitch Plays Pokemon experiment, and that only worked because there were over a million players and an automated system. – Martin Ender Jun 3 '14 at 17:42
• That's more suited for a chat room than for a question and answers because it depends on the temporal ordering of the answers. – Peter Taylor Jun 3 '14 at 19:12
• It's a shame it can't work. (MAKE A REBEL PROGRAMMING PUZZLE SITE WITH THIS ;) ) – user16402 Jun 3 '14 at 19:18

## Feature Creep

This is a proposed better way to implement multi-feature challenges that often have a ridiculously intricate set of minus-bytes bonuses that, in the end, just end up favoring the terser languages anyway.

Instead, the premise of the tag is simply:

Whoever implements the most features enumerated in the spec is the winner

I am thinking of doing my Human Genome challenge as a test case for this, to see how it goes.

My thinking is to have shortest code as the tiebreaker for these challenges, but also that ideally they should clearly define enough features that ties will be unlikely.

• I'm not sure that this is suited for the format. To have enough features that ties will be unlikely while also specifying them all well is the stuff of multi-page spec documents. To implement them is the stuff of long programs which, even if they fit in the limited space allowed for an answer, won't be much fun to read before upvoting in order to check that they do what they say. – Peter Taylor Mar 18 '14 at 16:00
• I'm not 100% sure, either, but it feels like more of a genuine contest than the bonus-laden approach oft taken at present. Also, it strikes me as something that could have been applied successfully to something like Emulate an Intel 8086 CPU. Which does directly support your argument about long programs that aren't fun to read, but it's also a very popular question that a) is not at all trivial and b) is really cool. – Jonathan Van Matre Mar 18 '14 at 16:06
• With the edit, you should now post this as a new meta post with the new-genre tag. Sorry for all the repeated edits :-P – Doorknob Mar 18 '14 at 22:26
• I think this might be more interesting if these challenges still come with a constraint. Otherwise, I too think this just results in people implementing all features and creating long and complex programs that no one wants to read on codegolf. If there is some constraint that makes it really hard to include all features or necessitates setting priorities for some subset of the features, that would probably make it more interesting. Including points/weights for the features (as is currently done in codegolf challenges) might help with that as well. – Martin Ender Mar 23 '14 at 17:49

# Data Golf

Instead of explicitly providing code, the winner of a Data Golf contest is the participant that can express the data specified in the puzzle using the least amount of space. Because data compression/storage size is often relative to the contents of the data itself, scores would be in the form of best case/average case/worst case bytes per example input, and the asker can choose which case (or combination) is to be used for ranking.

If the asker includes specific input data examples, it would be advisable (or can be required by the asker) for the participant to use their storage algorithm to on the examples and post the formatted data and length for each. Simply running data through an off-the-shelf compressor (gzip, bzip2, DEFLATE, et cetera) would be implicitly disallowed in all questions.

Participants can choose to include sample code along with the algorithm, but that would be optional unless the asker expressly requires it in the question.

An example of a popular question that fits into this format is GeekWithALife's Smallest chess board compression puzzle.

• So couldn't someone just build gzip or some other compression algorithm in their favorite language and then submit it to every single one of these challenges? – Doorknob Apr 6 '14 at 21:41
• @Doorknob I'm no expert on general-purpose compression algorithms, but doesn't it seem intuitive that a good algorithm that's custom-built for a specific task will outperform a general-purpose algorithm most of the time? – Adam Maras Apr 6 '14 at 21:49
• @Doorknob also, the terms pretty much disallow the existing compression algorithms. It doesn't matter whether you borrow libbz2 or rewrite it yourself. – Adam Maras Apr 6 '14 at 21:53
• In that case, what if someone writes some code without realizing it's the same as an already used one, like LZMA? And if the algorithm is better than commonly used ones, it will probably become commonly used as well, invalidating the answer. – Doorknob Apr 6 '14 at 21:55
• @Doorknob except the algorithms that are likely to win are going to be heavily suited to the task at hand. Nobody's going to start using Adam Speight's chessboard compressor to compress cat photos or database backup. – Adam Maras Apr 6 '14 at 22:00
• Sure, but then there wouldn't be very many interesting things to compress. Could you give an example of this kind of challenge? – Doorknob Apr 6 '14 at 22:03
• @Doorknob The challenge that I'm working on building (that I mentioned in another meta question) has to do with controlling an RGB LED strip (like this) over a serial/network connection using an efficient protocol to allow for a higher frame rate. – Adam Maras Apr 6 '14 at 22:09
• "Data golf" sounds to me more like the kind of question we call kolmogorov-complexity. If this suggestion takes off, I propose entropy-approximation as a name. I'm in two minds about this: the chess one was fun, but it did end up being more a combinatorics question than a programming one, and might have been better suited for math.stackexchange.com. – Peter Taylor Apr 6 '14 at 22:24
• @PeterTaylor fair. What do you think about the problem domain in my above comment? – Adam Maras Apr 6 '14 at 22:37

Inspired by

I'm still waiting for someone to say, "I just started working at this company and took over work on this existing application, and it's really cleanly coded, easy to understand, and a breeze to make changes to." I don't think such a thing exists. – Scott Whitlock Jun 12 '12 at 12:15

Programming Puzzles and Code Golf is notorious for having challenges with ugly (for real uses) code. Why not create a challenge that's the opposite?

# Clean Code

The asker provides a problem to solve, such as writing an interpreter for some language, and a style guide. The winner is the answer which best fits the style guide.

Problems:

• Requires a previously written style guide, or elaborate writing on part of the asker.
• How can we judge between two answers that both completely fit the style guide?
• How can we judge how well an answer fits the style guide?
• Additional problem: it's perfectly possible to write unmaintainable code which fully complies with some style guides. – Peter Taylor Jul 9 '14 at 9:40
• I also don't think that there's really a challenge in following some style guide unless that style guide is very complicated and possibly contradictory. – Martin Ender Jul 9 '14 at 10:11
• This could possibly work as "shortest code that still fits the style guide" to encourage technically correct abuse of the guide – trichoplax May 6 '15 at 8:49
• Ideally the "style guide" would be automated (possibly a stack snippet?) – trichoplax May 6 '15 at 8:50
• The drawback is questions would be necessarily language specific, but that hasn't been a problem for those Stack Snippet based questions that require JavaScript answers. – trichoplax May 6 '15 at 8:51

This is sure to conflict with some of the veteran users here, but I need to say this, and it wouldn't fit in a comment.

# Problem 1

The introduction of tags is something that has already been standardized across Stack Exchange. It is a privilege granted to users with sufficient reputation. This proposed sandbox flies in the face of such a privilege. The reasoning behind such a feature being implemented is due to an elitist attitude of "we are different than other sites".

We are different, but it doesn't apply to everything.

This proposed sandbox will allow brand new users to suggest new tags and discourage high rep users from creating new tags.

# Problem 2

Someone now has to maintain not one, but TWO sandboxes. If the site becomes popular, both sandboxes will potentially break due to having too many answers per sandbox and not enough people willing to actually review all of them. This breaks Stack Exchange's "crowd-source" style of moderation. Questions are moderated at the time of being posted, and errors are fixed. Users here have an elitist attitude that questions must be near-perfect at post-time or be closed immediately.

You might ask - Why do I think there will not be enough users to review all of the sandbox posts on a high-usage site? We have no problem with it now! The answer is simple. No reputation is gained from perusing sandbox posts. It only works now because a select few religiously check it, some subscribe to it, and others clamor for attention in the chat. Also, we currently only have to create a new sandbox every few days (or weeks). That will change on a high-usage site.

The overhead of posting near-perfect questions is not worth the benefits gained. Crowd-sourced moderation breaks unless everyone begins reviewing the sandbox. We have no way to reward users for reviewing the sandbox, and so it will break. In fact, I have already seen questions go multiple sandboxes without very little attention. It's already breaking!

# Conclusion

Lose the "We are different in every way" attitude. We are different because we ask questions about topics that we may not have actually faced, and we use scoring mechanisms that we created. In all other areas, apply the "We are different" or "This doesn't apply to us" labels with caution.

• Re problem 1: is that really a problem? Victor, now a veteran user, created [code-trolling] as a 1-rep user, which arguably helped our site by attracting more users. If a new user has a good idea, why not let them post it? Posting here doesn't mean it's guaranteed to be created, anyway. Problem 2: Well, I was intending for this to be a one-time thing, not a repeating sandbox like the main one. This is more of a problem with sandboxes in general. – Doorknob Mar 18 '14 at 20:57
• @Doorknob Re Problem 1: I never said that low rep users were incompetent. Your original post implies that we require some unique tag creation mechanism that no other site needs. I disagree, and I think that tag creation should remain standardized across stack sites (which is exactly what I said in my answer). If they have a new idea, but not enough rep, they can post on meta. – Rainbolt Mar 18 '14 at 21:21
• @Doorknob Re problem 2: I understand the "clean" organization and structure you are after, but Stack doesn't work like that. If you don't have the rep to create a tag, or you are unsure about creating one, post on meta. There is simply no need to collect all such posts into a single thread. It will only confuse folks who are familiar with other stack sites, but have migrated here. – Rainbolt Mar 18 '14 at 21:22
• Not a unique tag creation mechanism, just a way to propose new ideas. There's no need to run a tag like [pie-chart] or [png] or something through a sandbox; just create it. But completely different types of questions should most definitely be discussed on meta, and here's just a place to do that. – Doorknob Mar 18 '14 at 21:26
• This post was intended to be a temporary call to action, not a permanent sandbox mechanism. Nobody was doing this, so I decided to do something about it. – Doorknob Mar 18 '14 at 21:28
• @Doorknob It looks like you edited your proposal so as to almost completely invalidate this answer (usually considered rude). Previously, you were proposing a sandbox, but now, it looks like this IS the sandbox. Simultaneously, you introduced the much more brilliant "new-genre" tag. The new tag should encourage all users to post new genres if it becomes popular. With that new tag, I don't see the need for a sandbox. – Rainbolt Mar 18 '14 at 21:43
• Actually, previously this was the sandbox as well; all I really changed was the title and added a new paragraph. Hmm, do you think I should make this post a promotion of the tag, rather than a place to post new ideas? – Doorknob Mar 18 '14 at 21:47
• @Doorknob A tag will die if it has zero questions over a six month period. A tag will live if people use it. I suggest promoting it for a short while, and then letting it live or die on its own. If you promote the tag forever, then you may be keeping a poor tag alive. – Rainbolt Mar 18 '14 at 21:53
• I agree with Rusher that we shouldn't need or encourage a formal sandbox for tags, but I also appreciate the effort by @Doorknob to encourage brainstorming about ways to broaden the offerings of the site. If there were as much brainstorming about the site as there is complaining about it, we'd be marching swiftly in the general direction of Shangri-La. – Jonathan Van Matre Mar 18 '14 at 22:06
• @Jonathan Alright, edited question. \@Rusher Does the question look better now? Sorry for all the repeated edits :-P – Doorknob Mar 18 '14 at 22:25
• You use the word elitist as though it were pejorative. You also seem to complain in your answer about closing questions which need fixing, while in the comments attached to it you complain about the question being significantly changed after you posted your answer: there's at the very least a tension there. – Peter Taylor Mar 18 '14 at 23:36
• @PeterTaylor I did not complain about closing questions that "need fixing". I complained about expecting question to be near-perfect at post time or closed. The difference is subtle, so I understand if I have to explain it to you. Questions that "need fixing" will be crowd-moderated (fixed, closed, or voted on). On the other hand, an "expectation of near-perfect questions at post-time" leads to the creation of more sandboxes, which detracts from the ability of the crowd to moderate. That expectation is elitist, and I do use the word pejoratively. – Rainbolt Mar 19 '14 at 13:22
• There is a difference, but only if you admit the existence of a set of questions which are far from perfect but don't need fixing. Closure isn't permanent: that's why the wording has been changed to initially say that a question is "On hold". If a question can't be fixed then it should be closed and remain closed, but if it can be fixed then it should be closed until fixed and then reopened. That reduces the number of answers which constrain the ways in which it can be fixed. – Peter Taylor Mar 19 '14 at 19:09

## Unspoiled Puzzles

For challenges in understanding obscure code as exhibited by the classic C Puzzle Book, what about a modification of the framework which conceals other answers until you submit an answer (or a correct answer). This might require further deviations of the site format, since voting wouldn't really make sense; it should be replaced by multiple accepted answers.

The draw for answerers would be: if you solve the puzzle, you get +15 without any need to pander for votes.

• Are these "What is the output of this program?" puzzles? – Peter Taylor Apr 5 '14 at 8:53
• Yes, and it may not be a good fit. If you can just run the program and report back... :( – luser droog Apr 5 '14 at 8:57
• I think you'll have a tough job convincing them to change the software in order to give an automatic 15 points to anyone who can use a C compiler ;) – Peter Taylor Apr 6 '14 at 22:22
• As controversial as [popularity-contest] is, in this case it may be a good candidate: the winner is determined by whatever the hive mind agrees is the best explanation of why the code produces the output it does. While this is not objective or whatever, it's already how most stack exchange sites tiebreak equally correct answers. If two people correctly answer a question on SO, the one with the best explanation tends to get the green checkmark or most votes. – LinearZoetrope Apr 11 '14 at 5:25

# Golfing/Bowling with Sandbags

After golfing to the max, one must then add extra operations to pad the count out to a specified factor, like 10. Say your count was 98. Rather than suffer a massive penalty, you must add -- somewhere to double-flip an integer, rounding out the count to 100, a multiple of 10. Adding space or comments wouldn't count.

Not quite sure how to apply this to bowling, but I have an (unconfirmed) intuition that it's possible.

• That's been proposed before. It doesn't really add anything interesting to golf. – Peter Taylor Mar 27 '14 at 9:51

# Multi-Language

Questions are posed like standard code-golf or popularity-contest questions, but the answers must be written in at least two (possibly more, if specified in the question) languages.

The answers must also be executed using multiple languages per-execution, but does not have to be contained in a single source file. Languages cannot be used only to execute other languages.

In code-golf, answers are scored by taking the average of the lengths of the two language sources and adding the average difference between the sources. (rounded up)

## Example:

Note that the second answer is disqualified, as Batch simply executes a python file

Question:

Print Hello, world. I am banana! with as low a score as possible, and using at least two languages.

Python(0) + Batch(61) = 92 (30.5+61)

Batch

echo print('Hello, world. I am banana^!')>>"x.py"
python x.py


Python(35) + Batch(11) = 47 (23+24)

Batch

python x.py


Python

print('Hello, world. I am banana!')


unexpected-golf

this tag is for questions asking to do a simple task in an unexpected, sophisticated and surprising way - so that if one would look at the code, he won't know what it does until he runs it. this tag already has lots of questions, but it doesn't has it's own tag, although it should have. vote for this in order for it to have a tag.

• Isn't this the same thing as underhanded? Also, why does it have "golf" in its name? – Doorknob Jul 6 '14 at 14:27
• it's a bit different, as the program doesn't need to look like it does anything else - it just has to be unexpected. but, I am new here, infact i never heard of the underhnded tag before. – proud haskeller Jul 6 '14 at 14:34
• @proudhaskeller it would still fall in that category. I don't really think we need another tag to distinguish that subtlety. – Martin Ender Jul 6 '14 at 15:48

## First Past The Post

To be used for challenges that are genuinely difficult, and/or require solving some kind of puzzle that only has one answer. The winner is simply the first person to post a correct solution.

• a) I don't think anyone would like to post a challenge which loses its appeal after the first answer. b) This gives those people an advantage who happen to be online when the challenge is posted. c) Especially, if it's a difficult problem, I'd be really annoyed if I was working on a solution and someone hit the "Post Answer" half a second before me. Time of posting can always be a valid tie-breaker, but I don't think it has any merit as the primary scoring criterion. – Martin Ender Jul 1 '14 at 15:02
• a) I would; QED. b) only if it's used for challenges that take less than a few days to complete. c) it's fair enough if you're not into that sort of thing. But IMHO part of the problem with this site is that it lacks many challenges of real substance. I want to see challenges where even completing it at all is an achievement. I don't care about golf or popularity, I care about "can you solve this problem at all?" For such challenges first-past-the-post seems a reasonable winning condition. But it was just a throwaway suggestion, I'm not too bothered if people don't go for it. – Nathaniel Jul 1 '14 at 15:36
• It's still immensely punishing to people who attempt the problem as well, but are a minute too slow after two days of work. Also, so far challenges that do require several days of work haven't been too popular, so I'm not sure that there is currently a sufficient audience for these kinds of challenges to work. You could think about giving a bonus depending on how fast someone solved it (or that is just decreasing with each new answer), but in such a way that the bonus can still be overcome by a much better solution. That would be less frustrating for your participants, I think. – Martin Ender Jul 1 '14 at 15:41
• They would be more popular if there were more of them, I feel, and part of the reason there are few of them is that there isn't a good challenge type that fits them. I think you're right that FPTP isn't a great idea though. It would be better just to say there can be multiple winners, and just set the bar for completing the challenge very high. Here is a post that I wrote where I think this would make more sense than popularity contest. (Neither of the current answers is an acceptable solution.) codegolf.stackexchange.com/questions/26561/… – Nathaniel Jul 1 '14 at 15:49
• If you want to say that there can be multiple winners, you need to find a site which isn't built on the StackExchange engine. Having one winner is a fundamental part of the system. – Peter Taylor Jul 7 '14 at 10:42
• @PeterTaylor there are lots of things that are fundamental parts of the SE system that do not apply on codegolf. – Nathaniel Jul 7 '14 at 11:00