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
18
votes
17answers
2k views

Build interpreter for non-existent language

Build an interpreter for a fake, stack-based language that gets an input, interprets it, and outputs the result as an array of numbers. It should iterate through each byte and perform a different ...
24
votes
15answers
11k views

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

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

Find the largest prime under a number… but only for the test cases [closed]

The Code Your program should take an input of n > 2 and output the largest prime less than or equal to n. You can choose how the number is input (standard input, read from a file, etc). For example: ...
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 ...
15
votes
26answers
4k views

“Hello world!”, repeating each character n times [closed]

In your language of choice, write a program that outputs exactly Hello world!. Each character in your program must be repeated n times - you choose n. For example, ...
28
votes
10answers
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 ...
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 ...
80
votes
72answers
15k views

Hello world! with limited character repetition

In a language of your choice, write a program that exactly outputs the characters Hello world! followed by a newline. The code: should not use any character more ...
-1
votes
2answers
297 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 ...
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 ...
12
votes
1answer
1k views

Find number of rectangles in a 2D byte array

...
3
votes
1answer
448 views
68
votes
46answers
70k views

How to write a C program for multiplication without using the * and + operators?

Is it possible to write a C program that multiplies two numbers without using the multiplication and addition operators? I found this on Stack Overflow. Please help this poor programmer with his ...
-1
votes
3answers
752 views

1+2+3+4+…+n = -1/12? [duplicate]

Today, Numberphile posted this video where it's stated that 1+2+3+4+...+n = -1/12. While this isn't really new (several ways to prove that have been found, you can ...
39
votes
49answers
7k views

Write an aphorism using valid code [closed]

Can you write an aphorism in at most 4 lines of code ? Code should read as much as possible as an aphorism in plain English and should return the boolean true. ...
6
votes
18answers
6k views

Sum of Numbers of Array [closed]

Given an array (N) of integers, check if it is possible to obtain a sum of S, by choosing some (or none) elements of the array ...
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 ...
15
votes
20answers
1k views

Quine…but shifted by one

Referring to the printable ASCII character codes in decimal, we know that from 32 to 126 we have the printable characters with 32 being (space). Your challenge is to write a program using only ...
16
votes
8answers
1k views

Thinking outside the box

You are trying to fit a sphere into a 5-sided box, but sometimes it does not fit completely. Write a function to calculate how much of the sphere is outside (above the rim of) the box. There are 3 ...
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 ...
10
votes
23answers
10k views

Rotate An Integer Array with an O(n) algorithm [closed]

Write a function that rotates an integer array by a given number k. k elements from the end should move to the beginning of array, and all other elements should move to right to make the space. The ...
5
votes
5answers
890 views

Finding n'th character in a Lucky String [closed]

Lucky numbers are those numbers which contain only "4" and/or "5". For example 4, 5, 44, 54,55,444 are lucky numbers while 457, 987 ,154 are not. Lucky number sequence is one in which all lucky ...
4
votes
1answer
466 views

write an “operating system” that dims Num Lock

I want to write x86 assembler code that can be used to boot your computer from and dims NumLock. This means you cannot rely on glibc or any other of these "comfi" libraries you cannot rely on the ...
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 ...
8
votes
26answers
1k views

Halt with 50% non-Halting

Create a program that halts exactly 50% of the time. Be original. Highest voted question wins. By exactly I mean that on each run there is a 50% chance of it halting.
0
votes
4answers
323 views

The most pointless shell command you can concoct, based upon a often used shell command [closed]

Let's waste some time coming up with stupid ideas which are close cousins of good ideas. Your useless command doesn't have to fit any minimum or maximum length. Do, however, try to turn it into a one-...
10
votes
3answers
1k views

Let's simulate a random snowflake

I saw this question on https://mathematica.stackexchange.com/ and I think it's pretty cool. Let's make the snowflake with other programming languages. This is a quote from the original question: '...
19
votes
15answers
2k views

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

In my previous code challenge, I asked you to write a function that tells you which of its lines has been removed. The instructions were: Write a function that contains five lines. If you run ...
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 ...
3
votes
7answers
742 views

Creating a quine in as many characters as possible [closed]

A code-bowling is not the same as a code-golf, in a Code-Bowling, you should solve the challenge in as many characters as possible. The goal of this Code-Bowling is to create a quine in as many ...
19
votes
6answers
2k views

An unintentional-looking but crash-causing bug [closed]

There are a range of questions revolving around this concept, but these all seem to just involve causing a crash, resulting in many answers which are very obviously designed to cause a crash. So the ...
10
votes
7answers
4k views

How do I convert a word document to a pdf?

Help guys my assignment says it needs to be in .pdf format but I did it in Word. I'm really stuck. How do I take a word document in .docx format and make a .pdf that contains all the text from it? ...
18
votes
61answers
10k views

How do I find the factorial of a positive number?

The challenge: Write a program or a function that inputs a positive number and returns its factorial. Note: This is a code-trolling question. Please do not take the question and/or answers ...
48
votes
35answers
44k views

Print a smiley face

Requirements For the sake of the challenge let's define a unit: A unit is defined as any point that compose the grid in which the face is drawn (pixels for screen, characters for ASCII art, etc..)....
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 ...
42
votes
75answers
13k views

How do I write an adding function? [closed]

The problem: I am the lead developer for a big company, we are making Skynet. I have been assigned to Write a function that inputs and returns their sum RULES: No answers like ...
13
votes
22answers
3k views

Input text from one file, output it to another

The challenge: Input text from one file and output it to another. Solution should be a complete, working function. Note: This is a code-trolling question. Please do not take the question and/or ...
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 ...
280
votes
141answers
481k views

I need a program where the user inputs an array of doubles and the program outputs the array sorted

Note: This question was severely edited since I first posted it here. The rules were moved to here, read them before posting any answer to understand the purpose of this. This was the first question ...
13
votes
17answers
2k views

Create a Y2K disaster [closed]

Your program can do anything you want. The only condition is that it perform as expected if the date is before 2000, and fails spectacularly afterward. Define spectacularly however you'd like. For ...
10
votes
4answers
1k views

Christmas quine!

In the language of your choice, write a program that is arranged in the shape of a Christmas tree that prints itself in the same shape. What is not allowed: Printing out the source file Code that is ...
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 ...
95
votes
29answers
37k views

Make a scalable Christmas Tree [closed]

Your challenge: Make a Christmas tree. The size must be choosable by some input method, but doesn't have to be directly related to any part of the tree; however, larger inputs should produce a larger ...
6
votes
6answers
2k views

Build a snowman! [closed]

It's getting to be that time of year, and I figured I might as well post the first winter-themed question :) Your challenge is to build a snowman. How, you ask? Well, you decide! You can do ASCII ...
7
votes
3answers
1k views

Tic Tac Tae Toe

(Better known as 3D Tic Tac Toe; I just made up a name that sounded catchy ;-) ) Let two people play this game against each other. Specifications: Output the easiest way of explaining this will be ...
4
votes
13answers
1k views

Same code shape and output shape [closed]

I am not sure if this is possible. I have tried it and couldn't make it work at all, but I am being hopeful. If this is not possible please flag this question and I will promptly delete it. ...
11
votes
2answers
695 views

Just one note - musical instrument synthesizing [closed]

Statement The task is to synthesize sound (one note played) of some musical instrument (of your choice) using function in some general purpose programming language (of your choice). There are two ...
29
votes
3answers
8k 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 ...
4
votes
0answers
332 views

Program which tells two different storys [closed]

this code looks like a story but does nothing useful. My challenge for you guys is to write piece of code which sounds like another story but it must generate output - another story. So the point of ...
10
votes
5answers
1k views

Today (September 24) is HONDA birthday [closed]

today (24 of September) is birthday of company HONDA. Originally their company name is 本田技研工業株式会社 I want to ask to make a gift for HONDA. The task is to make ...

1 4 5 6 7 8