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).
-4
votes
0answers
96 views
Write a medium-sized “Hello, world!” program [closed]
You apply for a programming job. In many ways, it is like a typical programming job. Repetitive work, unreasonable demands, and clueless bosses that barely know how to print "Hello, world!" in any ...
-1
votes
0answers
97 views
Optimizing View Counts
Objective
You run a video site like YouTube or Vimeo. Each video has a unique ID which is a 32-byte string containing any of the following characters: a-zA-Z0-9. You are tasked to perform view ...
1
vote
2answers
139 views
Greater Average Submatrix
Objective
Write a program in any language that reads a matrix from stdin in which all columns are space delimited and all rows are newline delimited. The program must output a sub matrix so as that ...
-3
votes
0answers
80 views
Shuffling cars puzzle [duplicate]
This has spawned from a real-life conundrum, I made a decision based on guesswork but it got me thinking, what interesting ways would people come up with to programmatically calculate a best solution ...
13
votes
1answer
273 views
Make a (software) modem!
Objective
Design a modulator/demodulator pair to accurately transmit data as quickly as possible over simulated plain old telephone service (POTS).
Steps
Generate some random (/dev/random or the ...
36
votes
26answers
3k views
Difference should make no difference
Your company lately hired a new bunch of extremely dedicated sysadmins. They feel that just watching computer screens is quite limiting (I mean, 60Hz refresh rate is just NOT enough), so they hooked ...
89
votes
35answers
5k views
Source code ecological footprint
You've just been hired by a German car manufacturing company. Your first task, as an engineer, is to write a program that computes the ecological footprint of ASCII strings.
The ecological footprint ...
7
votes
4answers
374 views
Write two programs that compresses and decompresses data
Challenge:
Create a program that compresses a semi-random string, and another program that decompresses it. The question is indeed quite similar to this one from 2012, but the answers will most ...
26
votes
7answers
2k views
Beatles Songs and Hexagons
Write two triangle (i.e. pyramid) shaped programs.
The first one should be an upwards pointing text triangle with a minimum base width of three characters. So it would have a structure like
X
XXX
...
33
votes
5answers
636 views
Overcoming cluster size
Fed up with the reliability of flash storage, you decided to store all your programs on one of those good old 1,440 KiB floppies. However, after copying not even 3,000 programs, the disk was full. ...
34
votes
22answers
3k views
Remapping ASCII
Challenge
Write a program that reorders the ASCII characters!
It should output a single string containing all of the printable ASCII characters exactly once. The first character of this string is ...
16
votes
4answers
2k views
Big big numbers
Whilst trying to golf several of my answers, I've needed to write large integers in as few characters as possible.
Now I know the best way to do that: I'll be getting you to be writing this program.
...
8
votes
10answers
1k views
A Program that Print Programs
Challenge
Your goal is to write a program that prints another program.
That printed program should print another program, and the new program should print another program, until the end.
Rules
...
30
votes
106answers
3k views
Let's make a word-search!
In this challenge, we will together create a word-search containing many programs in different languages.
I have started us off with a grid of 60-by-25 blanks (·), some of which are replaced by the ...
9
votes
0answers
217 views
Radiation Hardened Quine
As you should (hopefully) know, a radiation hardened quine is a quine that you can remove any one character from and still print its original, pre-modified source. The thing is, with most of these you ...
11
votes
1answer
368 views
An optimization version of the Hadamard problem
First, some definitions.
A Hadamard matrix is a square matrix whose entries are either +1 or −1 and whose rows are mutually orthogonal. The Hadamard conjecture proposes that a Hadamard matrix of ...
18
votes
4answers
1k views
Golfing strings in Fourier
Challenge
Given a string as input, golf down the Fourier program which outputs that string.
In Fourier there is no easy way to output a string: you have to go through each character code and output ...
2
votes
0answers
106 views
Num of pyramids possible with given number of bricks [closed]
I encountered this question in an interview and could not figure it out. I believe it has a dynamic programming solution but it eludes me.
Given a number of bricks, output the total number of 2d ...
11
votes
1answer
457 views
Lossless English language text compression challenge [closed]
Challenge:
Your challenge (should you choose to accept it) is to compress and decompress the 5MB "Complete Works of William Shakespeare" as found here:
...
-2
votes
1answer
190 views
Ich ne know pas [closed]
Challenge
You must write a program which correctly identifies the language a passage is written in.
Rules
The passage will be a string passed to your program either via STDIN or function arguments.
...
1
vote
3answers
438 views
Brainf*** code golf challenge - write a Brainf*** program that searches for the first non-zero cell
The challenge is to write a brainf*** program that searches sequentially through memory for the first NON-zero cell.
The program should start somewhere in fairly low memory (there will probably be ...
5
votes
0answers
356 views
Take It or Leave It III: A Game Show for Computers
This is the third in a series of puzzles that I will be posting every Monday at Midnight PST, and the final variant of "Take It or Leave It".
The first puzzle is located Here
The second puzzle is ...
13
votes
4answers
386 views
Find the largest independent set in a high-dimensional lattice-like graph
For a given positive integer n, consider all binary strings of length 2n-1. For a given string S, let L be an array of length n which contains the count of the number of 1s in each substring of ...
4
votes
1answer
382 views
Reflections in Water [closed]
Take a string as input. This string can be as long as you'd like, however, it may only include letters and spaces––no numbers, punctuation, etc. When a word is passed into your function, an image will ...
20
votes
7answers
3k views
Take It or Leave It II: A Game Show for Computers
This is the second in a series of puzzles that I will be posting every Monday at Midnight PST. The first puzzle is located Here.
Context:
A reclusive billionaire has created a game show to ...
28
votes
5answers
2k views
Take It or Leave It: A Game Show for Computers
Context:
A reclusive billionaire has created a game show to attract the world's best and brightest programmers. On Mondays at the stroke of midnight, he chooses one person from a pool of ...
6
votes
1answer
293 views
Cross platform… You wish
Write a program that will produce differing behaviors on as many different platforms as you can. Each differing platform awards one point (including an initial platform, meaning you can't score less ...
-6
votes
6answers
155 views
Deep thought: Levenshtein distance [duplicate]
So, blatantly plagiarizing from inspired by this challenge and its sequel, I thought I'd add another.
The text to match:
What do you get when you multiply six by nine
The result your ...
2
votes
2answers
663 views
A Kingdom Hearts VGM challenge
I'm a huge video game music fan. One of my favorite OSTs is that from Kingdom Hearts, by Yoko Shimomura.
The challenge
Create a program or function that takes two arguments in any format: an ...
1
vote
0answers
92 views
Minimizing Covering Arrays
This is the followup question to this previous CodeGolf question about Covering Arrays (the details of what Covering Arrays are and how they are formatted at the NIST website are there).
In this ...
12
votes
5answers
947 views
Code close to the challenge: Inception
This is a sequel to this challenge: Code close to the challenge: Sum of integers
The challenge in this one is a bit harder, and also makes for a cool title (Which is why I picked it):
Calculate ...
35
votes
16answers
3k views
Code close to the challenge: Sum of integers
This is a simple challenge:
Given a sequence of integers, find the sum of all integers in it.
But with a twist.
Your score is the Levenshtein distance between your code and the following phrase (The ...
30
votes
17answers
6k views
Holy Hole In A Donut, Batman!
Holy Hole In A Donut, Batman!
Some characters are more holy than others. Using as few unholy letters as possible, display the statement above.
Challenge
Write a full program to print Holy Hole In A ...
30
votes
2answers
1k views
Shortest universal maze exit string
A maze on an N by N grid of square cells is defined by specifying whether each edge is a wall or not a wall. All outer edges are walls. One cell is defined as the start, and one cell is defined as the ...
9
votes
5answers
659 views
Path of exile map combinations
This question will feature a mechanic from the game "Path Of Exile" in this game there are things called MAPS they are items that you can use to open high level areas, you can also combine 3 of them ...
9
votes
0answers
407 views
Lossy ASCII art compression
Background
PICASCII is a neat tool that converts images into ASCII art.
It achieves different degrees of brightness by using the following ten ASCII characters:
@#+';:,.`
We'll say that these ...
13
votes
6answers
918 views
A determinant optimization challenge
Consider 30 by 30 Toeplitz matrices all of whose entries are 0 or 1. This challenge is a simple optimization challenge to find the matrix with the largest determinant possible.
Input None
Output A ...
5
votes
2answers
261 views
Conversion to Boolean satisfiability
Given a matrix M all of whose entries are 0 or 1, we want to known whether there exists a non-zero vector v with each element in {-1, 0, 1}, such that Mv = 0.
An easy way to do this is just to try ...
5
votes
1answer
189 views
Most efficient table storage for determining recurrence
The goal of this challenge is to implement a storage and retrieval pattern that will most quickly determine if a set of recurrence definitions fall within a date range.
Consider the schema: Event ...
0
votes
2answers
297 views
Javascript function challenge add(1,2) and add(1)(2) both should return 3 [closed]
A friend of mine challenged me to write a function that works with both of these scenarios
add(1,2) // 3
add(1)(2) // 3
My instinct was the write an add() function that returns itself but I'm not ...
33
votes
8answers
5k views
40 Numbers in 9 Bytes
There are 40 ways a directed Hamiltonian path can be arranged on a 3×3 grid:
This graphic (thanks Sp3000!) shows only the 20 undirected paths. Traverse each colored line in both directions for ...
-4
votes
9answers
302 views
Generate and print the first 20 Fibonacci numbers with the least unique characters
As the title suggests, my task is fairly straightforward:
Write a program in your language of choice that will print out the first 20 Fibonacci numbers using the least unique characters.
For example ...
1
vote
1answer
206 views
Quine permutation group
Write a program or function which, when run, outputs another program or function which is valid in the same language as the original program, and which itself will output another program or function ...
25
votes
8answers
1k views
Uniquely separated pixels
For an N by N image, find a set of pixels such that no separation distance is present more than once. That is, if two pixels are separated by a distance d, then they are the only two pixels that are ...
16
votes
2answers
3k views
Prime Nerd Sniping Pattern
Longest day of the year - here's something to waste the extra time...
Overview
Note this is not a popularity contest and not a graphical output challenge - you are only required to output a string ...
17
votes
3answers
542 views
Stacking Pythagorean Triangles
Background
A Pythagorean triangle is a right triangle where each side length is an integer (that is, the side lengths form a Pythagorean triple):
Using the sides of this triangle, we can attach ...
34
votes
4answers
882 views
Build a one-word search generator
The word BANANA appears exactly once in this word search:
B A N A A N B B
A B A N A B A N
A N A B N N A A
N N B A A A N N
N A A N N N B A
A N N N B A N A
N A A B A N A N
B A N A N B B A
The word ...
43
votes
6answers
4k views
1 character typo generating most error messages from C++ compilation
It seems that simple changes to a C++ file, especially with templates, can generate pages of errors. This contest is to see what the largest "bang of the buck" is, that is the more verbose error ...
16
votes
5answers
662 views
Boggle Board Compression
When working on Non-Palindromic Polyglot Boggle, I found it quite tedious to pack the codes as efficiently as possible onto the Boggle board, even with only two strings. But we're programmers, right? ...
6
votes
2answers
438 views
Coding hex board game
Introduction
Hex is a strategy board game played on a hexagonal grid, theoretically of any size and several possible shapes, but traditionally as an 11×11 rhombus. Other popular dimensions are 13×13 ...