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
47
votes
15answers
6k views

Generate the Stack Overflow logo [closed]

The challenge is to generate an image similar to the StackOverflow logo: The output must contain: Image size 64*64 or greater A gray |__| shaped base A curved segmented stack coming up from the base....
195
votes
80answers
24k views

What? No error? [closed]

Your task is simple. Write a program that should obviously produce an error on first glance either when compiled or run, but either doesn't or produces some other unrelated error. This is a popularity ...
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 ...
15
votes
24answers
5k views

Generate me some appropriate license plates!

The scenario: You are a software designer working for a gov't-run company that designs license plates for cars and other vehicles. You've been asked to develop software that generates license plates. ...
0
votes
4answers
2k views

ASCII-art videogame edition [closed]

I thought it might be fun to throw this on here. Generate an ASCII-art for one of your favorite videogames. What you want to generate is up to you but it should meet 2 requirements. It should be ...
9
votes
15answers
1k views

Random without Time-Basis [closed]

Computers do not out-of-nowhere create random numbers without basis, as most likely, time is the universal basis of randomness. I want you to create a code that creates random numbers with these ...
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 ...
11
votes
8answers
1k views

Practical Golf - US States [closed]

My family has an e-commerce business. On our own site, we force people to choose their state from a dropdown menu when they enter their address, but through some other channels we use, customers can ...
6
votes
1answer
748 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 ...
71
votes
17answers
20k views

What colour is this? [closed]

Given three number values - being the Red, Green, and Blue elements of a colour (eight bits per channel, 0 to 255) - your program must output the name of the given colour. For example; ...
2
votes
0answers
385 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 ...
78
votes
7answers
9k views

Start a revolution in Oceania

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....
-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 ...
11
votes
4answers
620 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 ...
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 ...
15
votes
3answers
4k views

Self-matching regex [closed]

Write a non-trivial regex that matches itself. For example, #.*$ will match a comment outside of a string in python until the end-of-line, and also matches itself ...
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 ...
11
votes
1answer
530 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 ...
12
votes
2answers
2k views

Implement a Useless interpreter [closed]

Your task is to build an interpreter to the Useless language: Here are the functional requirements: All the described commands should be accepted by the interpreter. ...
9
votes
0answers
639 views

Create a popular penrose tiling [closed]

The recent question about Wang tiles has led me to think that creating Penrose tilings might be an interesting popularity contest. Background Wang tiles are tiles that can tile the plane, but only ...
57
votes
9answers
5k views

xkcd challenge: “Percentage of the screen that is [x] color”

So I think we've all probably seen this xkcd comic: : This might either be too general or too difficult, I'm not sure. But the challenge is to create a program in any language that creates a window ...
-1
votes
4answers
1k views

Linkin Park Logo [closed]

Your goal is to draw the Linkin Park Logo in minimum bytes. Please add a title with the language and the number of bytes in your code.
-1
votes
1answer
164 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 ...
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 ...
16
votes
10answers
6k views

Crash (i.e. cause the interpreter to stop working and force close) Python [closed]

I would like to see who can make Python have a fatal crash with the most creative code. This means that when the program runs, Windows for example, will take over and pop up with something like “IDLE ...
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: ...
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 ...
18
votes
2answers
1k 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 ...
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 ...
3
votes
8answers
1k views

Compute the number of ways how you can express a number as a sum [closed]

For a given natural number n, compute the number of ways how one can express n as a sum of positive natural numbers. For example,...
5
votes
9answers
3k views

Partition of a positive integer N [closed]

Find the number of partitions of a positive integer n. Hope someone uses the explicit finite formula for the partition function defined in Jan Hendrik Brunier and Ken Ono paper here. ...
-1
votes
2answers
296 views

Largest Denominator [closed]

The number 1 can be written as sum of fractions of the form 1/p (where p>1). There are different ways to write it. You will be given an integer k which denotes the number of fractions to be used to ...
20
votes
6answers
3k views

Parallel projected voxel terrain generator

Your job is to generate a heightmap and show it as a parallel projected, voxel landscape. The rules are the following: The (heightmap of the) landscape has to be randomly generated You also have to ...
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 ...
2
votes
1answer
428 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 ...
5
votes
1answer
822 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 ...
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 ...
1
vote
2answers
593 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 ...
3
votes
2answers
811 views

Print all multiples of 32 from 0 to `n`…imperfectly [closed]

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 ...
7
votes
5answers
1k views

“Useful” self-modifying script for financial firm [closed]

True Story: Several years ago while interviewing at an investment advisory firm that managed over a billion dollars in client funds, I was asked a collection of reasonable and bizarre questions by a ...
9
votes
0answers
782 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 ...
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 ...
17
votes
1answer
3k views

Hide evil code - print files containing a given string anywhere in a directory tree [closed]

The point of this puzzle is to learn how a malicious code can be hidden and discovered in a program. A person is asking the question: Plz give me some code that how can I search a file may be in ...
-3
votes
1answer
131 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
480 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,...
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....
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 ...
9
votes
16answers
3k views

Write a mathematical function whose result is “hello world” [closed]

Write a mathematical function that results in an integer representation of "hello world" For example "hello world" in hex is 68656c6c6f20776f726c64 so the goal ...
45
votes
3answers
3k views

Create xkcd-Style Narrative Charts

In one of the more iconic xkcd strips, Randall Munroe visualised the timelines of several films in narrative charts: (Click for larger version.) Source: xkcd No. 657. Given a specification of 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 ...