A code challenge is a competition for creative ways to solve a programming puzzle with an objective winning criterion not covered by other scoring tags (e.g. code-golf).
-2
votes
0answers
23 views
How to Automatically Upload Image to website daily for charity donation [on hold]
There's a charity promotion on a UK website where the website will make a donation every day that an image is uploaded from my image library. And the promotion is running for a month. So I can ...
4
votes
5answers
187 views
Multi-lingual Challenge
After all the fun we've had with polyglot challenges in the (recent) past, how about a challenge where the output can be in two languages?
Your answer needs to accept boolean input b and output the ...
9
votes
4answers
215 views
Abstract Syntax Tree Golfing: FizzBuzz, Python
Summary
Implement FizzBuzz in Python, with the fewest possible tokens.
Challenge
Write a program that prints the decimal numbers from 1 to 100 inclusive. But for multiples of three print “Fizz” ...
-2
votes
0answers
118 views
Cheat On A Typing Test - Highest WPM [closed]
Your Challenge:
Create some code that gains the highest words per minute on TypingTest.com by inputting the correct set of characters in quick succession. The typing test has to be a one-minute test ...
7
votes
1answer
268 views
Comment-free polyglot with different, nontrivial, behaviour per language
This challenge is inspired by this other challenge, which you may want to read first for some context. However, a competitive answer is likely to look very different, so after reading some posts on ...
32
votes
11answers
2k views
What will you bring for Thanksgiving?
Thanksgiving in the United States is coming up on November 24th. Many people will have a large dinner with their families, traditionally including turkey and many side dishes. This typically means the ...
-5
votes
4answers
144 views
Your Search Returned No Results [closed]
Your task is simple. Write a program (or function) whose output returns no search results on google.
Rules:
It must take no input.
It must not cause an error.
It must terminate.
It must produce the ...
-1
votes
0answers
42 views
Polylingual code [duplicate]
I saw the following in Jon Skeet Facts:
Jon Skeet can code in Perl and make it look like Java.
That inspired the following challenge:
Create a "Hello, World!" program that compiles and runs ...
20
votes
2answers
457 views
On this site we obey the laws of thermodynamics!
And in particular the second law: the entropy of an isolated system increases over time.
For this challenge,
An "isolated system" will be taken to be a program or function (abbreviated as "program" ...
8
votes
3answers
458 views
Manoeuvre the grid!
Briefing
You are a bot, in a 2D grid that extends infinitely in all four directions, north, south, east and west. When given a number, you must move the bot so that you get to the target number.
...
6
votes
0answers
115 views
Out Steganograph Me! [duplicate]
Out Steganograph Me
As a follow up to this challange, I want to see competitive algorithms for encoding strings as images, and then decoding them.
The Challenge
Your goal is to write a function or ...
7
votes
2answers
247 views
The logical quine
The challenge
Simply write a program that outputs its own source code.
Nothing more than a regular quine.
The problem
We don't have a computer so we have to run the program on a programmable logic ...
5
votes
0answers
159 views
Solve a Single Player Tron Game [closed]
Solve a Tron Game
Tron is a great game, and if you haven't played it the internet has MANY online versions available.
A fun challenge is to try to write an AI that plays Tron, which is normally much ...
0
votes
0answers
57 views
find the period of one division [duplicate]
We have a division a/b where a is one not negative integer, and b is one positive integer. Write the complete program, or a function that from the input a and b, return the period of the division a/b. ...
1
vote
0answers
157 views
Code that detects changes on itself [closed]
Challenge: Write a piece of code that only runs when the code is not being altered. If you change anything, the code should detect this and deny running. Of course, it should not be possible to just ...
14
votes
2answers
744 views
A game of atomic proportions
Your task make a bot that plays Atomas, with the highest score.
How the game works:
The gameboard starts with a ring of 6 "atoms", with numbers ranging from 1 to 3. You can "play" an atom between ...
10
votes
3answers
380 views
Print a specific value in the Wythoff matrix modulo 2
The Wythoff matrix is an infinite matrix consisting of the Grundy numbers of each square on a chessboard in Wythoff's game.
Each entry in this matrix is equal to the smallest nonnegative number that ...
24
votes
2answers
409 views
Hyper about quines
Inspired by Hyperprogramming: N+N, N×N, N^N all in one.
Thanks to @MartinEnder and @trichoplax for their help in the sandbox.
Definitions
Hyperquines
Define a hyperquine of order n as a quine-...
1
vote
0answers
123 views
Adding One to a number stored as an Array [closed]
I was challenged by one of my friends to solve this coding problem:
Given a non-negative number represented as an array of digits, add one to the number. The digits are stored such that the most ...
67
votes
15answers
12k views
When was this language released?
Your challenge is simple. You need to write a program that prints to either STDOUT or a file the year the language it is written in was released. Because this is such a simple task, the twist is that ...
3
votes
10answers
294 views
Shortest way to strip the commas from column n given a .csv file/input
Ok, so the input here is going to be a .csv file and so is the output. Now, given a .csv file/input like so
"apple","banana","apple,banana","orange"
"grape","orange","grape,orange","sprout"
# 0 ...
0
votes
0answers
123 views
Hangman solver algorithm [duplicate]
Please do not delete this without reading it completely. Put it in unclear if there are some questions. I will respond immediately.
This is different from the question "Write a Hangman Solver" because ...
13
votes
0answers
947 views
Write a Palindrome-Polyglot-Quine
Write a "palipolyquine": a program that is a quine, a polyglot, and a palindrome.
Rules:
The number of polyglot languages is more preferable than code size.
The shortest answer (in bytes) wins, in ...
41
votes
9answers
3k views
There can be only 1!
Your task is, given a positive integer n, to generate an expression that equals the number n.
The catch is: you're only allowed the number 1 in the output.
The operators at your disposal are:
+, -, ...
11
votes
11answers
2k views
Output “Lorem ipsum” with minimal number of characters
I remember people saying that code size should be measured in bytes, and not in characters, because it's possible to store information with weird Unicode characters, which have no visual meaning.
How ...
16
votes
2answers
313 views
Chuck Norris vs Travelling Salesman
Introduction
Almost everyone is familiar with the Travelling Salesman Problem (TSP). The task is to, given a list of N cities, find the minimum Hamiltonian cycle which is to say the shortest path ...
-8
votes
11answers
263 views
Outputting x to y
Challenge
You must choose one number x (y = x + 9) and create ten unique programs which each print out one of the numbers in the range x to y inclusive. However, there are three twists:
Each program'...
7
votes
10answers
679 views
DNA Encode a String
Challenge
You must write an encoder (and a separate decoder) which takes a string as input and outputs the string encoded in the style of a strand of DNA.
DNA
DNA is made up of four types of ...
4
votes
4answers
390 views
The longest period iterating quine
As we know, a quine is a program that outputs its own source code. However, it's also possible to write a program that outputs another, different program, that outputs the first program again. For ...
3
votes
24answers
1k views
Enterprise Quality Code Prime Sieve
Enterprise Quality Code!
TL;DR
Answers will consist of a full program (of length < 30k) prints the the first N Prime numbers (as a base 10 representation without leading zeros unless the chosen ...
2
votes
0answers
213 views
100KB image compression [closed]
Your task is to, given an image, compress it to 100000 bytes or less, while following all of the below rules:
No cheating/loopholes.
Your code must not be optimized to work best only on the test set ...
17
votes
4answers
366 views
Minimal Word Search
Last week, we worked to create the shortest 1-D string using the top 10,000 words in the English language. Now, lets try the same challenge in 2D!
What you need to do is to take all of the above ...
72
votes
53answers
8k views
Can you outgolf me? (Cops section)
Cops section
The robbers section can be found here.
Thanks to FryAmTheEggman, Peter Taylor, Nathan Merrill, xnor, Dennis, Laikoni and Mego for their contributions.
Challenge
Your task is to write ...
17
votes
0answers
459 views
Build a digital clock in Conway's Game of Life
Since my Tetris question seems to evade being answered even to this day, I thought I'd create a slightly easier challenge, one that doesn't need any user input.
Your task is to build a Game of Life ...
14
votes
0answers
274 views
Diff compression
For this challenge, you need to compress a diff. A diff is some data that represents the difference between two strings. For this challenge, you need to provide one or more programs that can:
Input ...
27
votes
7answers
1k views
Compounding english
A compound word is a word that contains 2 or more words in it. We can do better than that, though. We need you to create 1 (nonsensical) word that contains every word.
However, we want this word to ...
2
votes
0answers
149 views
Brute force my code lock [duplicate]
The code lock for my garage has 5 buttons, labeled "1 2", "3 4", "5 6", "7 8", and "9 0". To open the garage door, you have to enter the correct 4-digit PIN.
As you can see, every button represents ...
8
votes
4answers
233 views
Sort a list of unknown values with the least amount of comparisons
In this optimization challenge you will write a program that sorts a single array by only comparing elements through asking the user on stdout to input comparison results on stdin.
The below protocol ...
16
votes
2answers
387 views
Thwart Lepton compression
Dropbox recently released Lepton (GitHub), a method that losslessly compresses JPEG images round-trip, saving an average of 22%.
Because of the pigeonhole principle, any general compression algorithm ...
28
votes
8answers
2k views
Latin square compression
A Latin square is a square that has no repeated symbols in the rows or columns:.
13420
21304
32041
04213
40132
And as many Sudoku players know, you don't need all of the numbers to deduce the ...
23
votes
2answers
711 views
Guess the language
Introduction
This site is rapidly building up a huge dataset of code snippets, so let's do something with it!
Here's a data file. It contains 9,066 unique language+snippet pairs for 113 languages, ...
25
votes
1answer
461 views
Domain Name Appraisal
Domain name trading is big business. One of the most useful tools for domain name trading is an automatic appraisal tool, so that you can easily estimate how much a given domain is worth. ...
0
votes
1answer
156 views
Meta Obfuscate a String [closed]
There are numerous reasons for trying to obfuscate input. These include preventing decompiling, and being a nuiscance.
With this in mind your challenge should your choose to accept it is to write a ...
55
votes
20answers
8k views
Rube Goldberg Hello World
For this golf, you will need to use more than one language.
The task
A Rube Goldberg machine is a contraption that takes an enormous number of complicated steps in order to execute a very simple ...
15
votes
3answers
2k views
Write a program that always prints N when it is shifted N times up the ASCII alphabet
Write a program using only printable ASCII characters that takes no input. For reference, here are the 95 printable ASCII characters in order:
!"#$%&'()*+,-./0123456789:;<=>?@...
1
vote
0answers
159 views
Cosmic ray-proof programming [closed]
Cosmic rays are bad for computers. They corrupt RAM, and that causes problems. Computer chips are shrinking, and that makes them more vulnerable to the cosmic rays. We will not give in to these high-...
2
votes
0answers
172 views
What's so great about 1729? [closed]
This is not a duplicate of this question. This is asking for the nth number that can be represented as the sum of two cubes in two different ways, while that is asking for the n-th number that can be ...
1
vote
10answers
534 views
Hi, can you draw some odd art? Bye!
Create a program that outputs "Hi, Hello!" in k bytes. By altering n bytes, the code should output all odd numbers in the range 5 <= x <= 25.
Changing another m bytes should result in a code ...
2
votes
1answer
233 views
Find the last three words of each paragraph if they are shorter than 20 characters in total
Based on my SO question, but more specifically:
Find a RegEx such that, given a text where paragraphs end with an empty line (or $ at the very end), match the up to twenty last characters of a ...
8
votes
15answers
1k views
Traveling on a flat Earth
Coordinates in the flat-Earth world consist of latitude (x) and longitude (y), which are integers in the range 0...9999. Much like Gaussian integers, but they are always written using this notation:
...