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

Write a panic script to remote secure a Mac Pro from an untrustworthy local user [closed]

The Situation Suppose I allow "Shady Sam" admin access on my workstation to perform an important administrative task on my Mac Pro for me by giving them a temporary root login password. (Assume they ...
7
votes
2answers
260 views

Output ISO8601 date

The Task Given the positive value of unix timestamp output any of two valid ISO 8601 time formats: YYYY-MM-DDTHH:mm:SS or, alternatively, ...
7
votes
3answers
372 views

Computationally Calculate Core Count

Almost all operating systems allow you to run multiple programs at the same time. If your system does not have enough processors to run all the programs you want to run, it starts to give each program ...
10
votes
7answers
2k views

Non-idempotent Python [closed]

Write a few lines of Python code, X, that does not reference any global variables, such that ...
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 ...
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 ...
2
votes
0answers
379 views

Useful C++ template metaprograms [closed]

C++ implements a Turing-complete functional programming language which is evaluated at compile time. Hence, we can use a C++ compiler as an interpreter to run our metaprogram without ever generating ...
-1
votes
1answer
343 views

Print the map of a country with the weirdest code possible [closed]

It can be in any language, plus the map must be in the output only not in the source code. This is my first question here, so please feel free to edit it. Also, there might be some rules about ...
48
votes
6answers
4k views

MS Paint is underrated

MS Paint was always a great time waster, but it was shunned by most graphic designers. Perhaps people lost interest because of the jarring color palette, or because of limited undo levels. Regardless, ...
-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 ...
9
votes
1answer
3k 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 ...
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 ...
72
votes
27answers
8k views

More is less and less is more

Anybody can make the output of a program bigger by adding characters, so let's do the exact opposite. Write a full program, an inner function or a snippet for a REPL environment in a language of your ...
11
votes
4answers
616 views

A Chrestomathy of Obscurity

You should complete four tasks in a language which: must return no results* when searched for on this (codegolf.se) website, for example ToffeeScript; must have a page listed at Esolang, Rosetta Code ...
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 ...
66
votes
21answers
12k views

Translate your English source code into a foreign language [closed]

I have noticed that there are a disproportionate number of computer languages based on English. I propose to fix this by translating existing computer languages into foreign languages! Pick a ...
-1
votes
1answer
163 views

Generate a Pallette for an Image [duplicate]

This is a successor to my previous Code Golf challenge, which may be found here. This time, you are trying to determine what the contents of colors.txt should be. Your task is to take from the input ...
170
votes
8answers
31k views

Draw an Image as a Voronoi Map

Credits to Calvin's Hobbies for nudging my challenge idea in the right direction. Consider a set of points in the plane, which we will call sites, and associate a colour with each site. Now you can ...
11
votes
1answer
528 views

Resize rasterized text and make it look non-pixellated

This is a screenshot of some text typed in a text editor: This is the same text at a larger size. Notice how visible the aliasing is on letters with prominent diagonal strokes like ...
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 ...
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 ...
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 ...
18
votes
2answers
996 views

String to Image

A bit of background: When I first learned about Brainf*ck, one of the first things I did was to write a Java application that would take in a string and create a, somewhat, optimized program to print ...
169
votes
97answers
37k views

Programming Languages Through The Years

In this challenge, users will take turns completeing three fairly simple coding tasks in programming languages that are allowed to be progressively older. The first answer must use a programming ...
18
votes
8answers
2k 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 ...
2
votes
1answer
418 views

Generate the galaxies of elite [closed]

Introduction Elite was the first space trading video game, written and developed by David Braben and Ian Bell and published by Acornsoft for the BBC Micro and Acorn Electron computers in in September ...
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 ...
5
votes
1answer
819 views

Drawing an Image Based on a Trace of its Hue

Introduction Local genius Calvin's Hobbies recently challenged us to trace the hue of an image. It is recommended to read his challenge beforehand, but to highlight the main points: The trace of hue ...
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 <...
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 ...
44
votes
4answers
2k views

Sometimes I need a Lossless Screenshot Resizer

Sometimes I need to write more documentation than just comments in code. And sometimes, those explanations need screenshots. Sometimes the conditions to get such a screenshot are so weird that I ask a ...
4
votes
3answers
3k views

Generate unique non-sequential string of length n without memory of previously generated strings

Scenario: Imagine a situation where you wish to share a unique alphanumeric code. Perhaps it is a one-time-use coupon code you hand write on business cards, or some other scenario where it is ...
1
vote
2answers
577 views

Create a Scalable Valentine's Day Heart [closed]

Happy Valentine's Day! To celebrate this day of love and happiness (or sadness and loneliness for those of us who are single...), let's write some code to create some hearts! Specifically, if you ...
11
votes
1answer
346 views

Pseudo-quine polyglot language-detection counters

Quines are fun. Polyglots are fun, too. Polyglot Quines exist, but we can raise the bar even higher. Write a file that contains a valid program for languages α, β, and γ. When the ...
3
votes
1answer
527 views

Warhol these pictures [closed]

We've all seen the famous painting of Marilyn Monroe created by Andy Warhol. Let's try to replicate that effect with the usual suspects. Your task is to write a program/programs that do as many as ...
9
votes
0answers
777 views

Emulate Rule 110 with Conway's Game of Life (or vice versa) [closed]

Can you find initial conditions for either Rule 110 or Conway's Game of Life to emulate the other? That is, produce output (in any form, not necessarily the familiar pixel grid) which corresponds ...
-3
votes
1answer
129 views

Listing links from pages — with error handling

In my previous question Debunking Stroustrup's debunking of the myth “C++ is for large, complicated, programs only”, a lot of people complained that comparison with Stroustrup's program isn't fair, ...
-4
votes
2answers
454 views

Implement slow sorting algorithm [duplicate]

All good coders know some good sorting algorithms like quicksort or merge sort. There is also slow sorting algorithms, e.g. bubble sort and insertion sort. But those are such easy to implement and so,...
161
votes
57answers
39k views

Debunking Stroustrup's debunking of the myth “C++ is for large, complicated, programs only”

Stroustrup has recently posted a series of posts debunking popular myths about C++. The fifth myth is: “C++ is for large, complicated, programs only”. To debunk it, he wrote a simple C++ program ...
48
votes
3answers
4k views

Computer Generated Textured Wall Paint

The paint on the walls in my room has a random, almost fractal-like, 3-dimensional texture: In this challenge you will write a program that generates random images that look like they could be part ...
8
votes
36answers
4k views

Calculate the square of an integer with restrictions [closed]

The Puzzle You have to write a program or function p(n) that returns the square of what is entered into it and you may assume that the input is a non-negative integer. Put in simpler terms, return n2....
20
votes
7answers
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 ...
42
votes
4answers
5k views

Paint by Numbers

You're given a true colour image. Your task is to generate a version of this image, which looks like it was painted using paint-by-numbers (the children's activity, not nonograms). Along with the ...
12
votes
7answers
3k views

Reverse the Polarity

The aim of this challenge is to write a program that satisfies the following conditions: The program is not palindromic, or essentially palindromic (meaning that it is possible to remove characters ...
15
votes
1answer
745 views

Optimum Letter Cards for Spelling Words

Let's say you have a list of words and you want to be able to use letter cards to spell each word. For example, to spell cat, you would use three cards labelled C, A, T. Assuming each card is double-...
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 ...
9
votes
0answers
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; ...
35
votes
9answers
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 ...
6
votes
4answers
622 views

Underground geek rock band names

We have a group of stealthy computer-savvy geeks who are also musicians with a very subversive element to their songs that the authorities in their totalitarian country just can't stand, and are ...
0
votes
1answer
385 views

Program an Artistically Rich Comic Strip [closed]

The Challenge Program a comic strip. As artistically rich and detailed as you can possibly make it, so long as it complies with the following rules: the comic must be your own original work, not a ...