All Questions

Filter by
Sorted by
Tagged with
393
votes
156answers
237k views

Write a program that makes 2 + 2 = 5 [closed]

Write a program that seemingly adds the numbers 2 and 2 and outputs 5. This is an underhanded contest. Your program cannot output any errors. Watch out for memory holes! Input is optional. ...
95
votes
73answers
18k views

Why isn't it ending? [closed]

Your task: To write a program that should obviously terminate, but it never (to the extent of a computer crash) does. Make it look like it should perform a simple task: adding numbers, printing ...
39
votes
86answers
9k views

Challenge: Write a piece of code that quits itself [closed]

I'm searching (am I?) for a piece of code that quits immediately - in an absolutely unconventional way. This does not mean: System.exit((int) 'A'); (Java). It ...
184
votes
50answers
35k views

Trolling the troll [closed]

A troll has captured you and is forcing you to write malware (defined as a program that damages the computer that runs it). The troll can read and understand code, but is not so good at spotting bugs. ...
197
votes
81answers
24k views

What? No error? [closed]

Your task is simple. Write a program that should obviously produce an error on first glance either when compiled or run, but either doesn't or produces some other unrelated error. This is a popularity ...
42
votes
47answers
7k views

Produce an unexpected word [closed]

The goal is to write program that will produce a word unexpectedly (program doesn't look like it is going to produce a word). Example (JavaScript): ...
28
votes
2answers
2k views

Underhanded code contest: Not-so-quick sort [closed]

The Task Write a program, in the language of your choice, that reads lines of input from standard input until EOF, and then writes them to standard output in ASCIIbetical order, similar to the ...
24
votes
32answers
7k views

Obfuscation Challenge [closed]

You are to write a program that does one of the following. Only displays "Hello World" does nothing else Quits and nothing else (no output, no errors.) Takes one line of input, parses it as an ...
33
votes
8answers
3k views

It's not who votes that counts; it's who counts the votes [closed]

The scenario You live in a country that is having a presidential election. Each voter gets one vote, and therefore there is a firmly-entrenched two-party system. (Third parties exist, but get ...
38
votes
32answers
10k views

Deletion of a blank line in source code which causes unexpected functionality [closed]

Write a script that works fine when a blank line is present in the flow of program logic, but breaks or causes unexpected behaviour when that line is removed. Avoid standard loopholes and stupid ...
27
votes
8answers
8k views

Pi is still wrong [closed]

Pi is Wrong A common method of computing pi is by throwing "darts" into a 1x1 box and seeing which land in the unit circle compared to the total thrown: ...
12
votes
6answers
2k views

Write a sorting program that looks erroneous but it is actually correct [closed]

Write a program that sorts a vector of numbers (or any type of element) that looks like having one or more bugs, but it is actually ok. The code must be clear. Someone looking over the code must ...
29
votes
7answers
4k views

Underhanded contest: The OS war [closed]

We all know how the discussion about which is the best operating system caused a lot of flame-wars. Your goal is now, to provide decisive "proof" that your favorite operating system is better... ah, ...
26
votes
17answers
4k views

Write a line in program that looks useless [closed]

Write some program (the size doesn't matter), and put a line that looks useless, but it's actually not - if it would be removed, the program would crash, or do something wrong. Feel free to mark the ...
6
votes
8answers
743 views

Loophole for other challenge [closed]

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