Skip to main content

Questions tagged [underhanded]

This tag exists for historical reasons. New challenges of the type previously posted under this tag are not welcome.

Filter by
Sorted by
Tagged with
14 votes
13 answers
5k views

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 ...
user avatar
4 votes
4 answers
3k views

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 ...
vikarjramun's user avatar
8 votes
1 answer
4k views

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 snippets ...
vrwim's user avatar
  • 2,519
2 votes
5 answers
3k views

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 ...
Christopher Wirt's user avatar
19 votes
8 answers
3k views

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 ...
user155698's user avatar
52 votes
3 answers
7k views

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 ...
Sanchises's user avatar
  • 9,536
7 votes
3 answers
2k views

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 ...
Zgarb's user avatar
  • 43.2k
21 votes
7 answers
4k views

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 ...
Ypnypn's user avatar
  • 10.9k
8 votes
0 answers
2k views

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; ...
Vi.'s user avatar
  • 2,727
34 votes
9 answers
3k views

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 ...
vsz's user avatar
  • 8,141
16 votes
1 answer
2k views

"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 ...
absinthe's user avatar
  • 8,649
13 votes
2 answers
1k views

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 ...
Markuz's user avatar
  • 1,884
78 votes
7 answers
10k views

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....
laurencevs's user avatar
  • 1,587
3 votes
2 answers
928 views

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 on ...
Claudia's user avatar
  • 1,708
2 votes
7 answers
1k views

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. ...
Ypnypn's user avatar
  • 10.9k

15 30 50 per page