Questions tagged [underhanded]
This tag exists for historical reasons. New challenges of the type previously posted under this tag are not welcome.
50
questions
12
votes
13
answers
5k
views
Reversed language name [closed]
You should code a piece of code that looks like it outputs the language name but actually outputs the name reversed.
E.g. a Python program should look like it outputs ...
4
votes
4
answers
3k
views
April Fools Day! [closed]
Your challenge is simple: write a program or function which appears to print the first ten numbers of any integer sequence (on OEIS, the answerer may choose which sequence), but instead prints the ...
8
votes
1
answer
4k
views
You call this optimized? [closed]
The task is simple, post 2 code snippets that perform the same task, where one seems very optimized at first glance, but actually is significantly slower than the other.
Only one rule:
Both ...
2
votes
5
answers
3k
views
Like a quine, but not [closed]
Very simple, write a program that at first glance appears to be a quine, but is not. Upon running, the program actually prints the source to a real quine, obviously distinct from the original program ...
18
votes
8
answers
3k
views
Classic Proof Fallacy [closed]
The Background
So, we all know the classic proof that goes like this:
a = b
a² = ab
a² - b² = ab - b²
(a-b)(a+b) = b(a-b)
(a+b) = b
b+b = b
2b = b
2 = 1 (Ha ha!)
Of course, the mistake is that ...
52
votes
3
answers
6k
views
Quiche Lorraine [closed]
Since it was Pi day recently, I have noticed a number of challenges that ask you to calculate pi.
Of course, a quiche lorraine is not quite a pie (you can claim a Bonus Score¹ of +1 if you guessed ...
7
votes
3
answers
2k
views
Recognize Twin Primes by Crashing [closed]
Background Story
Bob was handed the following assignment for his programming class. Please note: this is not the actual challenge.
Homework assignment 11: Twin primes
Input: an integer ...
21
votes
7
answers
3k
views
Confuse the Dakotas [closed]
You have been hired by the government of North Dakota to encrypt the state's communications. Write two programs, one to encrypt a message and one to decrypt that message.
The government is not really ...
8
votes
0
answers
2k
views
Break Stack Exchange [closed]
Trick the user that StackExchange is broken:
It can be done in several ways:
Your program starts a browser in some certain way (with a proxy server, for example);
Your program shows static picture;
...
36
votes
9
answers
3k
views
Sabotage the coding standards [closed]
There are various coding standards enforced at software companies which have the goal of increasing code reliability, portability, and, most importantly, readability in code written jointly by ...
16
votes
1
answer
2k
views
Sabotage a Train to Make It Run Late [closed]
"I want to go to the Araby bazaar to buy a present for the one I have fallen in love with. However, if I arrive too late all the stores will be closed and I won't be able to buy anything. Can you help ...
13
votes
2
answers
1k
views
Underhanded Bank Account [closed]
You are working as a programmer for a bank.
Your task is to write a program that handles the transactions from one bank account to another.
The program should do the following:
Run in an infinite ...
78
votes
7
answers
9k
views
Start a revolution in Oceania
Winners (decided 14/09/14)
Winning answer by Markuz (Python) - 63 votes
Runner up by kuroi neko (PHP) - 55 votes
Introduction
You are in the world of the book Nineteen Eighty-Four by George Orwell....
3
votes
2
answers
868
views
Print all multiples of 32 from 0 to `n`...imperfectly [closed]
Objective: Print all multiples of 32 from 0 to an arbitrary number n.
Rules:
One argument will be given: a single integer from 0 to 231 - 1. This will be n here ...
2
votes
7
answers
1k
views
Break out of a loop [duplicate]
Now that we have over a hundred ways to get stuck in a loop, the next challenge is to get out.
Specifically, write a piece of code with a (seemingly) infinite loop, but somehow manage to break out.
...