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
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): ...
31
votes
3answers
2k views

Design a One Instruction Set Computer!

Notice: I'm willing to give a bounty to any answer that I find interesting. Your challenge is to design a Turing-complete one instruction set computer (OISC): An OISC is an abstract machine that ...
31
votes
4answers
2k views

Reproduce an image using lines

Write a program that takes in a true-color RGB image I, the maximum number of lines to draw L, and the minimum m and maximum M length of each line. Output an image O that looks as much as possible ...
30
votes
20answers
6k views

Olympic Games Logo - Free Style Edition [closed]

In a similar spirit as this question, your mission is to create the best-looking logo in at most 1K of code. Rules: At most 1K of code (inclusive), no external data. The answer with the most upvotes ...
30
votes
3answers
2k views

Plant a tree and watch it grow

The trees we are growing have some rules that define how they grow: Growth Rules: Trees consist only of branches. Branches are made up of a combination of the following symbols: ...
30
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 ...
29
votes
53answers
8k views

The Smart Person's Mirage

Once upon a time, I was reading this question/answer on Quora Are there really programmers with computer science degrees who cannot pass the FizzBuzz test This code is given as the obvious answer <...
29
votes
9answers
2k views

Anti-golfscript anti-golf: create a task where GolfScript or J is outgolfed by your (conventional) lang [closed]

You need to make three things: Statement of a task, T. Solution of the task in language not typically used for golfing, A. Solution of the task in language typically used for golfing, B. Don't try to ...
29
votes
3answers
7k views

Emulate a MOS 6502 CPU

This is kind of inspired by the Intel 8086 challenge that's also on here, but I thought a 6502 challenge would be interesting too. The challenge I thought this would be a fun one to see the results ...
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, ...
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 ...
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 ...
28
votes
21answers
5k views

Limerick Hello World [closed]

A rhyming program you write Attempting to win the fight For winning the contest and vote It must compute "Hello World" Then print it very polite The most popular poem will win. The requirements are: ...
28
votes
12answers
7k views

Hello World in 1024 characters [closed]

In exactly 1024 characters, no more, no less: Must print Hello World. Must not use unnecessary whitespace. Must not use comments. Judging should favor ...
28
votes
6answers
7k views

Let's draw the flag of Nepal

Nepal’s flag (Wikipedia, Numberphile) looks very different from any other. It also has specific drawing instructions (included in the Wikipedia article). I want you guys to make a program which will ...
28
votes
17answers
9k views

Transform number into 7-segment display pattern

Given two arbitrary numbers A,B. Print number B as a Digital LED Pattern where A is the scale. input: 1 2320451640799518 ouput: ...
28
votes
5answers
3k views

Draw an Image with a Snake

Imagine a continuous 2-dimensional path that can only turn left, right, or go straight, cannot intersect itself, and must fill a rectangular grid such as the grid of pixels in an image. We'll call ...
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 ...
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 ...
28
votes
1answer
2k views

Animation of Code Golf

When I see code-golf entries that knock a few characters off, whittling down the code, I go look at the edit history for a side-by-side diff. See and learn :) This challenge is to make a program ...
27
votes
9answers
5k views

Convert English to a number [closed]

Short and sweet description of the challenge: Based off the ideas of several other questions on this site, your challenge is to write the most creative code in any program that takes as input a ...
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: ...
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 ...
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 ...
27
votes
8answers
3k views

Hello world! with NO repetition

In any programming language that existed before this question was asked, write a program (not a function) that outputs the characters Hello world! followed by a ...
27
votes
8answers
3k views

Cubify This! A lesson in grayscale… er… color… er… whatever

Being a big fan of the Rubik's cube and of cool art, I've been working on combining the two together to do some really cool stuff. Basically solving miniature Rubik's cubes to form rudimentary pixels ...
27
votes
6answers
2k views

Write a C / C++ Polyglot

This challenge's concept is pretty simple. All you have to do is write a program that will compile as both valid C and valid C++! Well, there are some catches. The program must behave differently when ...
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 ...
26
votes
7answers
3k views

Write a code golfer [closed]

Your job, should you choose to not refuse it, is to write a program that will "golf" a piece of given code in your language of choice. Basic functionality: Remove extraneous whitespace Remove ...
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 ...
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 ...
25
votes
17answers
8k views

Print 1 to 1000 in C++ without semi-colons

Following this popular question, present your solution which prints the numbers 1 to 1000 (all of them, not the string "1 to 1000" verbatim or something funny) in C++ without using any semi-colons. ...
25
votes
3answers
2k views

Generate Realistic Maps

I drew this map of the regions of an imaginary word in a few minutes in MS Paint: I think that being able to generate maps like this programmatically would be really cool. Challenge Write a program ...
25
votes
3answers
2k views

“Write” a simple calculator without writing a single line of code

It's very easy: Create a program without writing a single line of code. The code may only consist of existing Stack Overflow questions and answers. The program should create two random numbers and ...
25
votes
3answers
1k views

Leonhard loves labyrinths

The background My son Leonhard (4 years old) loves labyrinths. I don't know where he knows labyrinths from, but he paints them and knows quite well how they work: Recently, he started making a game ...
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 ...
24
votes
15answers
10k views

Generate a 1920 x 1080 graphic with 2,073,600 unique colours

Challenge: Write a program that outputs a graphic file 1920 pixels wide by 1080 pixels high. Every one of the 2,073,600 pixels within the graphic must be a unique colour and no colour values should ...
24
votes
16answers
9k views

Create an analogue clock

Create an analogue clock Goal: To create a working analogue clock using any programming language. Requirements: Your clock should feature at least the hour and minute pointers. The produced clock ...
24
votes
4answers
3k views

Display the mouse pointer trails… of the future!

Inspired by this example of using d3js, I challenge you to create a canvas (or your language-of-choice equivalent) in which the mouse pointer trails will be displayed, with the following twist: The ...
24
votes
6answers
3k views

Write the prettiest bytebeat composition

Bytebeat is a style of music one can compose by writing a simple C program that's output is piped to aplay or /dev/dsp. ...
23
votes
61answers
5k views

Reinvent the For loop [closed]

For loops are used extensively in many languages, but what would you do if no languages supported them? Create a way to execute a basic ...
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 ...
23
votes
6answers
5k views

Detect what programming language a snippet is

Your challenge is to take some source code as input, and output which programming language it is written in. For example, you could have the input ...
23
votes
4answers
1k views

Play a Song for Me

Challenge Given guitar tablature you must output the song represented by the tab. This may be to the speakers of your computer or to an audio file (.wav, .mp3, .midi, .aiff, etc.). There will also be ...
22
votes
5answers
4k views

Just Another Perl Hacker [closed]

Classic code golf challenge. Write the most obscure Perl program to print "Just another Perl hacker". Here's the Wikipedia article on it. Bonus points if it fits in 3 lines / 70 characters 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 ...
22
votes
9answers
1k views

Musical Quines on an ASCII Piano

There are 88 keys on a standard piano and 95 printable ascii characters (hex codes 20 through 7E): ...
22
votes
6answers
1k views

Bloatware contest: producing 100+ MiB executable [closed]

Create short source code in your favourite compiled language that compiles into a big (not less than 104857600 bytes) executable file. The program must be runnable (assuming 1GB of free memory) and ...
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. ...
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 ...