Questions tagged [popularity-contest]

A popularity-contest is a competition where the answer with the highest vote tally (upvotes minus downvotes) wins. As these are frequently closed, read the tag info and post your challenge to the sandbox first.

Filter by
Sorted by
Tagged with
-4
votes
5answers
440 views

What time is it? [closed]

I really hate looking up to the top right of the screen to look at the time on OS X's clock widget; I'd much rather keep my eyes at least somewhere near my workspace to check the time. I also hate ...
33
votes
8answers
4k 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 ...
106
votes
65answers
20k views

Random script that isn't actually random

As a little joke in the office someone wanted a script that randomly picks a name, and said person will make a round of drinks. Let's call the people John, Jeff, Emma, Steve and Julie. I thought it ...
4
votes
7answers
2k views

Not-endless Recursion without a base case [closed]

Write a recursive function/program, to calculate either the Factorial or the Fibonacci number of a given non-negative integer, without explicitly implementing the base case(s). Your program/function ...
13
votes
5answers
1k views

Program that encodes a message into its own text

Write a program that encodes given text into its own text, provided as input, without disrupting its logic. The program must also work as a decoder, restoring the original message from its text. It ...
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 ...
-2
votes
4answers
2k views

Fibonacci Sequenze without using loops! [closed]

Here is one more "Challenge"! Today i had a meeting with a friend, and mostly we are a little bit crazy.. He bets, that it is not possible to create a Fibonacci Sequence without using loops. No ...
42
votes
15answers
9k views

99 Bottles of beer, 99 languages

The goal is to write a simple "99 Bottles of Beer" program .. that is valid in at least 2 distinct languages (e.g. not Python 2 and Python 3). It must be a complete file that will run or compile. ...
3
votes
21answers
5k views

Print 123454321 without if statements and using only 2 variables [closed]

The challenge: Write a function, that delivers following output: "1 2 3 4 5 4 3 2 1". Kids stuff? Of course. But here's the point: You only can use: 1 for loop, 2 int variables. You must not use: IF ...
7
votes
1answer
744 views

Approximate square root from algorithm time complexity

There have been a few square root challenges lately, but I think this one is different. Challenge Find an algorithm such that the worst case time complexity is proportional to ...
278
votes
33answers
78k views

Make it look like I'm working

Often, I find myself running a script or query that will take a significant amount of time to run. I can leave that script open and enjoy some guilt-free procrastination. Now, what if I could write ...
31
votes
22answers
3k views

Create an object whose state changes on assignment

I find it deeply weird that this is possible in Ruby (I won't immediately say how): ...
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 ...
25
votes
44answers
11k views

Write a piece of code to output the line number of the print / output statement itself (in the form “Hello World, from line X!”)

The Challenge Write a program that outputs Hello World, from line X!, where X is the line number, in the source code, of the ...
3
votes
6answers
2k views

print “Hello, world!” without using literals [closed]

Write a program that prints "Hello, world!" without using any kinds of literals. Don't use string literals, numeric literals, byte literals, char literals, etc. Default values are allowed in ...
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): ...
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: ...
393
votes
156answers
244k 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. ...
1
vote
1answer
230 views

Executable Sonnet [closed]

Write a program that is a sonnet, and when run prints out a sonnet. By "sonnet" I mean: 14 lines Each line, when read aloud, has 10 syllables Symbols can be ignored, or pronounced in whatever ...
223
votes
75answers
75k views

Code that will only execute once

Goal The goal of this challenge is to write code that will execute once and only once. This means basically that it damages the program, script, or environment in some way. If rebooting the system ...
0
votes
3answers
241 views

Create a Question Asker! [closed]

Writing questions for programming puzzles is tiring and takes many minutes to do. This is where you come in. Your job is to write a program that randomly generates plausible-sounding (but not ...
53
votes
18answers
8k views

Program that adds all natural numbers and yields -1/12 [closed]

As you might know there is a mathematical fun-fact that if you add all natural numbers you end up with... -1/12 (see Wikipedia here). Of course this is very strange result and can not be obtained by ...
8
votes
7answers
975 views

Do the needful? [closed]

Goal Replace all comments in C, C++, or Java Code with the comment // Do the needful. Specifics This coding challenge is a simple one. Take as input the name of ...
6
votes
1answer
578 views

Open source optical lattice clock

A recent question showed how Mathematica could be used to make a beautiful optical lattice clock image. The image looks like this. This challenge is to reproduce this image as closely as possible ...
14
votes
14answers
3k views

Throw a null-pointer exception [closed]

Your task is to generate a null-pointer exception. That is, your program must accept a value which it expects to be non-null, and throw an exception/error or crash because the value is null. ...
15
votes
2answers
1k views

Pathological Sorting

Pathological Sorting Your boss has demanded that you develop a sorting algorithm to improve the performance of your company's application. However, having written the application, you know that you'...
4
votes
1answer
700 views

Duct Tape some sorting

Your job is to make a sorting algorithm. The catch, you must copy it from Stack Overflow. Your program will take an input array (or equivalency), and output a sorted permutation of the array. Your ...
10
votes
5answers
1k views

Cheap, Fast, Good - Common Factor (Greatest) [closed]

Inspired by Cheap, Fast, Good, we're going to implement an algorithm which has exactly two of them. The Math Given two nonzero integers a and b, the GCF d is the largest integer that divides both a ...
54
votes
7answers
7k views

Duct tape can fix Mother's Day

Based on the Duct tape can fix anything question, that was too broad, with very similar rules. Only this time the objective is very specific: The challenge Your mission is to make a program that ...
21
votes
7answers
3k views

A completely fake reboot [closed]

This challenge is simple. Write code that produces what looks exactly like a full reboot of the computer. It must not show anything on the screen that indicates it is not a real reboot and should ...
13
votes
1answer
2k views

Duct tape can fix anything [closed]

Overview This challenge was inspired by this StackOverflow Meta post. In it, @hakre says: I've seen a project really written by Stackoverflow (a noob copies together from SO here and SO there), ...
31
votes
1answer
2k views

Confound my attempts to solve the halting problem

Please note: By its nature, the spec for this challenge is difficult to understand. It probably requires at least a freshman course in computability theory, or equivalent background reading. In ...
23
votes
12answers
9k views

Dither a Grayscale Image

Dither a grayscale image into pure black and white with your own algorithm. Guidelines: You must come up with your own new algorithm. You cannot use pre-existing algorithms (ex. Floyd-Steinburg) but ...
1
vote
6answers
523 views

What time is it? (Obfuscation) [closed]

Your goal is to write an obfuscated program that displays the current time. Guidelines: The program can print local or global time. You are allowed to draw ASCII numbers, display an analog clock, etc....
8
votes
2answers
1k views

Collatz Attack!

This challenge is based on some new findings related to the Collatz conjecture and designed somewhat in the spirit of a collaborative polymath project. Solving the full conjecture is regarded as ...
53
votes
33answers
11k views

Avoid the evil integers! [closed]

You are developing some code to generate ID numbers. Policy requires that no ID numbers include the digit sequence 666. Create a function (or your language's equivalent) which takes a positive ...
26
votes
4answers
2k views

Miniature Faking

As any amateur photographer can tell you, extreme post-processing is always good. One such technique is called "miniature-faking". The object is to make an image look like a photograph of a ...
37
votes
2answers
2k views

Musical Tweet Challenge

This is the audio version of the Twitter image encoding challenge. Design an audio compression format that can represent at least one minute of music in 140 bytes or less of printable UTF-8-encoded ...
19
votes
9answers
2k views

ASCII ART edge detection

As the title says, I was thinking to contest in which one must detect edges of an ASCII art. The code should accept a B/W ASCII art as input. A B/W ASCII art is defined as (by me) an ASCII art with ...
42
votes
41answers
21k views

Help!! How to do square root! [closed]

Hi guys, for my class I need to make a number square root but it doesnt work !!HELLPP! The challenge: ...
41
votes
14answers
8k views

Maze Generation [closed]

I know there is an (old) thread similar to this (here), but I'd like to reboot it with some modifications. The goal: generate a random-looking maze using an algorithm of your choice, then output the ...
17
votes
5answers
1k views

Lets take Beal's $1,000,000

Beal's Conjecture has a million dollar prize if you prove/disprove it. It states that if where A, B, C, x, y, and z are positive integers with x, y, z > 2, then A, B, and C have a common prime ...
28
votes
29answers
10k views

Convert short month names to their longer counterparts [Ended]

This challenge has ended! Congratulations Flonk! I was sure I would get a good grade, but after turning in Flonk's my work, my professor did not believe it was mine and also could not understand why ...
12
votes
3answers
4k views

building circuit for divisibility by 3

A boolean circuit in TCS is basically a DAG consisting of And, Or, Not gates, and by what is known is "functional completeness" they can compute all possible functions. eg this is the basic principle ...
13
votes
10answers
2k views

Make the most useful program within 100 characters [closed]

In this task, you are allowed make an useful program to do anything you can write within 100 characters. You are allowed to use less characters, but not more. Rules, just to protect from standard ...
168
votes
36answers
23k views

Write program in your favorite language in another language [closed]

The determined Real Programmer can write Fortran programs in any language. from Real Programmers Don't Use Pascal Your task is to write program in your programming language of choice, but you are ...
13
votes
2answers
487 views

The poet's quine

Write a quine with 1 or more rhyme scheme from http://en.wikipedia.org/wiki/Rhyme_scheme when read. The following characters are spoken aloud: any alphanumeric words or characters not in a comment; ...
5
votes
14answers
12k views

Divide Two Numbers Using Long Division [closed]

Your challenge is to divide two numbers using long division. The method we used to use in old days of school to divide two numbers. Example here You should NOT use ...
54
votes
31answers
23k views

Create a memory leak, without any fork bombs [closed]

Your task is to create a memory leak. This is a program that uses loads of memory, until the computer runs out and has to do some swapping to save itself from running out. The only way that the memory ...
-3
votes
2answers
180 views

compare string without conditional operator [duplicate]

Compare if three string variables with the same content, return true if they are or false if they are not without using ...