Programming Puzzles & Code Golf Stack Exchange is a question and answer site for programming puzzle enthusiasts and code golfers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

You are to post an answer you posted that exploited a loophole in the challengers question. Bonus points if it caused them to rewrite the question.

For example, one challenge was to write a program that such that if a random character is removed, it still works, and your score is how many characters it fails on. Some one posted the empty program, since then it would fail on no characters (though the compiler would fail) and the question had to be changed. He was unrightly down-voted, so I hope he sees this challenge.

This is a popularity contest, so whoever gets the most votes wins!

share|improve this question

closed as too broad by SztupY, Timtech, Justin, grc, Hosch250 Feb 20 '14 at 5:07

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

You should say what is a valid answer. You didn't gave any indications. The only rule is that "You are to post an answer you posted". What are the rules for a valid answer? Can we post as many answers from as many questions as we want? Can we post answers from the same question? – Ismael Miguel Feb 20 '14 at 2:41
I agree. I think you should edit your post to add a rule that it has to be a different question. – Comintern Feb 20 '14 at 2:58

In my answer to Loophole for other challenge, I deliberately exploit the fact that the poster didn't specify that the answer had to be responding to another question. This made my answer recursive and self-referential.

I also golfed my answer (even though it was a popularity contest). 0 bytes of code.

share|improve this answer
It looks like I'm not the only one exploiting the rules. – Ismael Miguel Feb 20 '14 at 13:47
I do like recursion. Also, I was expecting and okay with someone exploiting this question. Therefore, exploiting this question is perfectly fine in my mind. Therefore, simply make a self-referential answer doesn't exploit anything. – PyRulez Feb 21 '14 at 20:53
I was going off of the word "other" in the title. ;-) – Comintern Feb 21 '14 at 22:16
So I guess technically he did an antiexploit. He broke the literal meaning of the question, but at the same time matched what I was thinking. – PyRulez Feb 23 '14 at 1:32

Render a version of the BBC Micro owl logo

I used curl to grab the challenge page and outputted an answer posted by someone else.

share|improve this answer

In Weirdest way to produce a stack overflow, i submitted an answer that opened a web browser and displayed

share|improve this answer
That is really a weird way, but a good one! – Ismael Miguel Feb 19 '14 at 23:55

In Shortest Program to Sort a List of numbers into Odd and Even Category, the question clearly states:

... The Size of the program is the size of the body of the function, i.e. excluding the size of the function signature.

I thought, "Why such a bizarre and specific rule?" And as I was trying to golf down my initial submission, it dawned on me--default parameter values! According to the language spec, they're definitively not part of the function body, so I went ahead and submitted my final solution: a function whose body is a single character. That must have been what the OP wanted!... right?...

Needless to say, it did not win. :/

After accepting another answer, the challenger did eventually add a footnote as to why the one-character solution wasn't considered. The rules of the challenge, however, still remain unchanged (as of the time of this post). So, in the strictest interpretation of the rules, who would you say actually won? ;]

share|improve this answer

In Write a hash function for Morse Code, the OP didn't specifically exclude negative or floating point values which are entirely usable as hashes. Using this loophole, I was able to get a better than "perfect" score of 236. There was much griping, but the OP never changed the question, despite promising to, and the loophole was subsequently exploited by almost every other poster!

share|improve this answer

In the question Output with 1 on stdout using a 0-byte source code, it states that it will give a bonus of -500 bytes if we output '1' to the console using a source-code file which is 0 bytes long.

My answer is this one and 'abuses' the null devices in windows and linux.

The question wasn't rewritten, but this answer gave me a pretty big hole to go to the gold (the -500 byte bonus). Why? Because the null devices have ALWAYS 0 bytes in size and are guaranteed to exist!

share|improve this answer

Quoting this question:

Your goal is to add two input numbers without using any of the following math operators: +,-,*,/.

Additionally, you can't use any built-in functions that are designed to replace those math operators.

I posted this answer, it was not very popular though. Quoting from my answer:

And, as suggested by @Ismael Miguel (althought he was not exactly suggesting this), by really abusing the rules underspecification, we can note that only +, -, * and / operators were forbidden, but += was not, so it is allowed (it is not a built-in function either, since it is not even a function). This way, we can express the instruction with just 4 characters (and it will always work with negatives and non-integers too for both values):

share|improve this answer
I'd say that the increment operator is designed to replace addition – TheDoctor Feb 19 '14 at 22:36
I said the same. He almost jumped my throat and shoved in my face the Javascript spec. – Ismael Miguel Feb 20 '14 at 0:04
@IsmaelMiguel :) – Victor Stafusa Feb 20 '14 at 0:11
Well, check out my answer to this post. The one talking about you. And this is how you "bend" the rules... – Ismael Miguel Feb 20 '14 at 0:20

In the same question that @Victor refered (Add without addition (or any of the 4 basic arithmetic operators)), i gave this asnwer.

Basicly it "ABUSES" the Javascript internal casting to integer of the boolean values.

And This question itself exploits a loophole: there is NOTHING saying we can't refer to the same question in the answers. Or the number of answers. Or the number of answers from the same question.

share|improve this answer
+1 For citing me, for abusing the same question, and for getting a downvote that is probably from the same person that downvoted me (but I can't be sure about this). – Victor Stafusa Feb 20 '14 at 2:26
What matters is that I exploited a loophole in a question about loopholes. The irony is quite huge! – Ismael Miguel Feb 20 '14 at 2:30
Yeah, the meta-loophole. – Victor Stafusa Feb 20 '14 at 2:33
Still, it's a valid exploitable hole. – Ismael Miguel Feb 20 '14 at 2:34
I don't get it. What is the loophole? – PyRulez Feb 21 '14 at 20:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.