Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

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
-1
votes
1answer
217 views

Ponderous primality testing [closed]

One of my favorite algorithms was posted on Stack Overflow as an answer to What is the fastest way to generate prime number recursively?. In pseudocode: Nathan's algorithm ...
393
votes
156answers
245k 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. ...
54
votes
21answers
5k views

Add a feature to a programming language [closed]

Your task is to tack on a feature to a programming language, either by implementing a very clever library, or by processing the input text and/or tweaking the compilation process. Ideas: Add PHP-...
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 ...
3
votes
9answers
627 views

Generate a valid sequence of numbers with specific rules [closed]

The challenge The program must return a valid sequence of numbers into some rules Rules x is the size of the sequence; x ...
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. ...
3
votes
1answer
319 views

What time is it again? [closed]

The Inspiration The Challenge I'm tired of seeing the same old-same old clock in my top-right-hand corner of my screen. It's time for a new clock. While the clock clock sated my lack of interesting ...
330
votes
55answers
103k views

Tweetable Mathematical Art [closed]

Integer math can generate amazing patterns when laid out over a grid. Even the most basic functions can yield stunningly elaborate designs! Your challenge Write 3 Tweetable (meaning 140 characters ...
28
votes
70answers
5k views

Return 1 - Popularity Contest [closed]

The Task Create a function/subroutine which returns 1. You can make it as elaborate as you like, as long as it returns 1. The Rules The entry with the most upvote wins - just like any popularity ...
13
votes
12answers
7k views

Make a Valentine wish with your favourite language [closed]

Write the most creative program to display your Valentine wish to your favorite programming language, in that language. E.g. ...
6
votes
10answers
2k views

Eight Queens Obsfucation [closed]

You've probably heard of the classic Eight Queens Puzzle. For those of you who haven't it goes something like this: Position 8 queens on an 8×8 chessboard so that no two queens threaten each ...
22
votes
9answers
2k views

King of the Hill - Liar's Dice

Liar's Dice is a fairly simple dice game. I've seen a few different variations of the rules, but here is the version I'm most familiar with: Each player starts with 5d6 Except when tallying the dice ...
2
votes
5answers
2k 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 ...
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 ...
1
vote
2answers
266 views

Find the line guaranteed by Sylvester-Gallai

The Sylvester-Gallai theorem says: Suppose you have a finite list of points in the plane. Suppose further that not all of those points are collinear (lie in a single line). Then there is some line ...
-7
votes
2answers
227 views

Unique multiplication by ten [closed]

People, it's a popularity contest, you have to do somthing cool here. Think about cool ways of breaking the code in most languages, not about validating for everyting! Initially this challenge ...
-7
votes
4answers
484 views

The Miscalculator [closed]

Inspired by a post I saw on social media, your job is to create a miscalculator (aka "wrongulator"): a calculator which always outputs the wrong answer! Challenge Write a program that inputs a ...
7
votes
1answer
3k views

Make the pattern from composition notebooks [closed]

This challenge was xnor's idea, taken from Digital Trauma's challenge donation thread. Your challenge is to write a program that, as xnor put it, "procedurally generate[s] the splotchy black-and-...
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
0answers
294 views

Build an image-glitching algorithm [closed]

It's well known that corrupted JPEG files or NTSC/PAL streams will appear as distorted versions of the true images, or versions covered in random-looking blocks of pixels. Consider the below image (...
28
votes
13answers
2k views

Write a function that tells you which of its lines has been removed

Write a function that contains five lines. If you run the function as-is, it should return 0. If you remove any one of the five lines and run the function, it should tell you which of the lines has ...
2
votes
7answers
626 views

Random with your hands tied [closed]

Task Develop some code to generate a psuedo-random number between X and Y (taken as input). Explain why or how it works. Conditions Do not use any random generating seeds, pre-written randoms, or ...
-9
votes
1answer
429 views

Self-debugging code [closed]

Your Task Write a program using ASCII characters. Five alphanumeric (0-9, A-Z, a-z) characters will be inserted at random into your program's source code. Your task is to detect and output these ...
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 ...
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 ...
20
votes
4answers
2k views

Force an Average on an Image

Write a program that takes in a standard truecolor image and a single 24-bit RGB color (three numbers from 0 to 255). Modify the input image (or output a new image with the same dimensions) such that ...
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. ...
65
votes
117answers
19k views

99 Bottles Of Beer [closed]

Recreate '99 bottles of beers on the wall'. The desired output is this: ...
40
votes
32answers
5k views

Ridiculous Runtime Errors [closed]

Write programs that produce crazy, obscure, ridiculous, or just plain nutty runtime errors. Obfuscation and golfitude (shortness) not required. solutions that look like they should work fine are ...
3
votes
0answers
319 views

Most creative/diabolical/entertaining way to find Python version? [closed]

There are important differences between Python 2 and 3, so it's often useful to know which version of the interpreter is running your code. The straightforward method is something like this: ...
46
votes
7answers
4k views

Who is this chatbot?

Objective: The task is to create a chatbot with whom you can spend your time discussing your deepest thoughts with. Create a chatbot with an AI that learns from your input. Your bot should inspire ...
27
votes
8answers
3k views

Create a programming language that only appears to be unusable (Robbers' thread)

See the cop thread for more information. Each answer to this question should crack an answer there. That is to say, it should be code to find the third-largest integer in the input when run in the ...
49
votes
6answers
4k views

Language Design: 2-D Pattern Matching

This is Fortnightly Challenge #6. Theme: Language Design There's a chatroom for this challenge. Come and join us if you want to discuss ideas! And now for something completely different... This ...
0
votes
15answers
568 views

Programming? No, it's Projamming [closed]

Hopefully not duplicate, but I did not find one. Challenge The challenge is to write full program, which compiles (without errors), but, when executed, will not finish the execution till the end, ...
10
votes
4answers
2k views

Produce different behaviour in all versions of your language [duplicate]

Write a program that: if a compiled language is used, compiles without errors if an interpreted language is used, runs without syntax errors for every major release of your language, and produces ...
15
votes
5answers
1k views

RTTTL Obfuscation

RTTTL, or Ring Tone Text Transfer Language is a music format that was invented by Nokia in the dawn of time when dinosaurs roamed the land. It allows for fairly crude pieces of music (no chords or ...
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 ...
0
votes
1answer
254 views

Help me get a date for Homecoming [duplicate]

My school has its Homecoming dance next week, and there's someone in mind I want to ask. But I don't want to ask her the normal way. I want to send her a program that prints "Rachel, will you go to ...
3
votes
8answers
2k views

n-queens problem, displaying more than one solution available

as some of you may know, n-queens problem is a set of algorithm puzzle that given a 'n x n' where n is the board size of a (let's say) chessboard, and the main goal is for the n queens (where n is the ...
2
votes
0answers
180 views

Self-validating quine [closed]

Quines have been around forever. It's a fun challenge: write a program that, when executed, generates its own source code as output. But how do you know it's actually producing its own source code? ...
12
votes
7answers
1k views

C code indenter

Situation: You are a high school teacher, teaching your computing class how to write C programs. However, since it is just the beginning of the term, you haven't taught them about the importance of ...
21
votes
6answers
2k views

The Great British Cake Off

I hear somebody was very selfish on their birthday, demanding cake from everyone and there were no plans to share! 🎂 It's bound to be somebody's birthday today, so why not bake them a cake. ...
52
votes
3answers
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 ...
386
votes
110answers
82k views

Most creative way to display 42

Douglas Adams was born on March 11, 1952, and died when he was just 49. In honor of this wonderful writer, I challenge you to display 42 in the most creative way possible. You could print it in the ...
1
vote
1answer
182 views

Palandrome-ish code [closed]

Create a program that does the same thing forwards and backwards, in different languages. “Different languages” does not include different versions of the same language. Challenge This program can ...
8
votes
0answers
329 views

Stack to the Future [closed]

Welcome Back to the Future's fans and enthusiastic codegolfers. Let's begin with this simple statement : Marty arrives in 2015 in one month (On october the 21st !). Therefore I propose we use the ...
16
votes
14answers
2k views

Rock, Paper, Scissors, Lizard, Spock [closed]

Create a function that will take two strings as input and return a single output for the result. Most popular answer wins. The rules of Rock-paper-scissors-lizard-Spock are: Scissors cut paper ...
0
votes
2answers
243 views

Mirror programs [closed]

Here is your task, should you choose to accept it: Output (through STDOUT, or whatever is most convenient) some n by m ASCII art ...
1
vote
1answer
301 views

The Truck Problem [closed]

I am a teacher who was given a problem a few years ago. Every year since I have given it to my advanced students as a bonus assignment, but in ~10 years only 8 solved it, each with a slightly ...
27
votes
5answers
1k views

Literally code golf [closed]

In modern day standards Golfing translates to playing a game of golf, while golf itself translates to a car manufactured by Volkswagen. So instead of the usual golfing of code, you will today be ...