2022 Developer Survey is open! Take survey.

Questions tagged [code-challenge]

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).

Filter by
Sorted by
Tagged with
6 votes
1 answer
251 views

Irradiated Polyglots

Design a function or program that, when run normally, outputs the triangular numbers. However, when any single character is deleted, the program/function should not function in the original ...
user avatar
  • 1,260
4 votes
1 answer
132 views

BitCycle Metagolf

Background BitCycle is a two-dimensional Turing-complete programming language involves moving bits around a playfield. Because I am too lazy to write BitCycle programs myself, you will be writing a ...
user avatar
  • 3,920
26 votes
28 answers
3k views

What's the Missing Code? (Cops)

Cops' Challenge Robbers' challenge here. It has now been four days since the challenge was posted so all new answers should be marked as non-competing in the title. These answers can still be cracked ...
user avatar
  • 837
4 votes
0 answers
167 views

Calculate the probability of getting this hand in n tries [closed]

Imagine there is a card game where the primary objective of the game is to get 4 of one card in your hand. Game mechanics Each player starts of with 10 cards in their hand. The remaining 32 cards (...
user avatar
4 votes
3 answers
248 views

Find All Digitroot Cyclic Sequences With Length Greater Than One

Digital sum, DR, Digit root is the iterative process of summing digits of a number until you end up with a single digit root number: e.g. digit root of 12345 is 6 since 1 + 2 + 3 + 4 + 5 = 15 = 1+5. ...
user avatar
  • 179
3 votes
2 answers
228 views

Implement constant-latency branchless multiplication efficiently

Modern hardware can perform multiplication very fast in a constant latency of 3~4 cycles. But some tiny chips for embedded environments sometimes lack hardware multiplication, which has to be emulated ...
user avatar
  • 2,121
7 votes
3 answers
595 views

Build an optimizing Brainfuck compiler/interpreter

the goal Build an optimizing Brainfuck implementation. Whether it is a compiler, an interpreter, a JIT compiler, or whatever else is up to you. scoring A reference implementation (...
user avatar
  • 2,121
6 votes
3 answers
184 views

Write a regex that would increment a 2-digit hexadecimal number

Your regex will receive a string of the form !XX! #<extra> where X is any hexadecimal digit (0-9 and A-F capital letters ...
user avatar
  • 71
11 votes
1 answer
456 views

Longest infinite loop in 5 states

Challenge Statement The goal of this challenge is to build the 5 state Infinite Time Turing Machine that takes the longest to halt. Since Infinite Time Turing Machines can run for infinite time your ...
user avatar
  • 85k
0 votes
0 answers
138 views

Infinite-Time Busy Beaver

An infinite time Turing machine is a generalization of a Turing machine to infinite computation lengths. It has three tapes: two of them are blank initially, and the other one contains the input to ...
user avatar
  • 491
4 votes
1 answer
174 views

Generate Matching Regexes

Write a program that takes two lists of strings and generates a javascript regex that fully matches all the strings in the first list and matches none of the strings in the second list. To be specific ...
user avatar
  • 1,131
9 votes
8 answers
517 views

Biggest katlani noun dictionary in 400 bytes

Katlani is a constructed language being designed in chat. In this challenge, your goal is to print the largest dictionary of katlani nouns possible in 400 bytes or less. Task In 400 bytes or less, ...
user avatar
8 votes
8 answers
372 views

From code to golf (Robbers' thread)

This is a cops-and-robbers challenge, the cops' thread is here You can change the word code into golf by changing a letter at a ...
user avatar
  • 27.5k
12 votes
10 answers
807 views

From code to golf (Cops' thread)

This is a cops-and-robbers challenge, the robbers' thread is here You can change the word code into golf by changing a letter at ...
user avatar
  • 27.5k
6 votes
1 answer
188 views

Represent any integer with an expression that uses no digit besides '4' [closed]

Fourward (Introduction) I have an unhealthy obsession with the number 4. I love it so much, in fact, that seeing any other digit is frustrating to me. I therefour wish to create a 'Fourier ...
user avatar
-2 votes
1 answer
152 views

Program compressor

Choose a language and write a program in the language that: Take a valid program of the language as input, Output a string(bytearray, etc.). It needn't be a valid program. Only finite valid inputs ...
user avatar
  • 12.7k
19 votes
6 answers
1k views

Wordle solver challenge

Wordle is a daily online word game that has received considerable attention recently. The Game The object is to guess a secret word in the fewest attempts. Consider the following instance of the game: ...
user avatar
-7 votes
2 answers
133 views

Multiplying numbers [duplicate]

Your task, is simply to multiply 2 integers given in input, separated by a ",". The catch is, you cannot use the multiplication operator "*", even if it is being used differently, ...
user avatar
  • 3,041
22 votes
6 answers
939 views

Play the Fruit Box Game

Play the Fruit Box Game Intro Fruit Box is a game consisting of a 10x17 grid of numbers, each between 1 and 9, where the goal is to clear as many numbers as possible in a two-minute time window. In ...
user avatar
  • 498
18 votes
1 answer
645 views

Largest SKI output in less than 200 combinators

The Challenge Create an terminating expression in SKI Combinator Calculus in less than 200 combinators (S, K, I) that reduces to the expression with the most combinators. There will be no limit on how ...
user avatar
  • 703
21 votes
17 answers
856 views

Kolmogorov-simple numbers

If you visit Code Golf often, you may have heard of Kolmogorov complexity. It's usually defined as the amount of bytes required to express some string in a programming language. Here the Kolmogorov-...
user avatar
  • 6,645
-1 votes
1 answer
252 views

Draw Lines in ASCII [closed]

Challenge Draw lines in ASCII corresponding to given inputs: in the first line there are given size of rows and columns of the view and number of separators between each point in the second line is ...
user avatar
  • 179
-1 votes
2 answers
201 views

Challenge: create a large number using an esoteric programming language [duplicate]

I enjoy large numbers and esoteric programming language, so I decided to combine them into a programming challenge. Your goal is to push the limits of esoteric languages like BF or Pyth and return the ...
user avatar
  • 491
28 votes
11 answers
2k views

Infinite ordinals from a well-ordering

Your task is to write a short program that represents a large (infinite) ordinal, using a well-ordering of the set of positive integers. Your program will take two different positive integers and ...
user avatar
  • 6,645
24 votes
8 answers
2k views

Write some Genetic Quines

In this challenge, you'll create some programs which behave similarly to genes. When you run one, it will return one of its two "alleles" (a half of its source code), and concatenating any ...
user avatar
11 votes
7 answers
1k views

Iterative Quine

Create a program which prints itself, followed by an additional program. This additional program should print the first program, itself, and then a third program. This continues until the nth program, ...
user avatar
10 votes
2 answers
780 views

Let's go for a rollercodester ride

Let's go for a rollercodester ride The objective of this challenge is to create a program that is run recursively through several languages of your choice. The output of the first iteration becomes ...
user avatar
  • 865
19 votes
2 answers
536 views

Counting and so on

Content You count numbers every day (I think), and most of you know how to count properly, the one next to 1 is 2, and the next ...
user avatar
  • 1,367
24 votes
8 answers
5k views

Make a Hello World using as many bytes as possible

Write a program that outputs the exact string: jan ale o, toki! ("Hello, world" but in toki pona to prevent builtins.) with an optional trailing newline. ...
user avatar
  • 85k
-6 votes
3 answers
404 views

Make a GUI window in any language using minimum "different characters" [closed]

I want you to make a gui window like this: * if you're thinking, the [quit] button closes the window in any language using minimum "different" characters.. AND remember that the gui window ...
user avatar
16 votes
1 answer
331 views

Build the widest unsupported bridge with nothing but frictionless blocks

In this challenge you must write a computer program that creates a stack of a thousand identical \$1 \times 1\$ frictionless homogeneous blocks such that each block is supported and the stack is ...
user avatar
  • 38.6k
24 votes
4 answers
2k views

A quantum quine

Your challenge is to write a program that is a quine, meaning it prints out its own source code. For at least one individual character, when it is removed from the program's source, a single different ...
user avatar
  • 27.5k
15 votes
18 answers
3k views

It almost works (Robbers' Thread)

Cops' Thread Your challenge is to find an uncracked, unsafe cop on the cops thread, and find an input value for which their code does not do as specified by the challenge. You must use values within ...
user avatar
  • 27.5k
13 votes
7 answers
507 views

Splinter metagolf

The language Splinter is an esoteric programming language where data is stored in 'splinters'. There are three different types of syntax: Simple character output: ...
user avatar
  • 27.5k
4 votes
3 answers
396 views

Will the hydra finally die? Part II

Background This is a follow up question to the question: Will the Hydra finally die? As before a dangerous A Medusa have released a dangerous Hydra which is revived unless the exact number of heads it ...
user avatar
5 votes
2 answers
434 views

Generate the shortest regex to match these but not those [closed]

Challenge Given two lists of strings where each string is of length 50 and each list is also of length 50 generate the shortest regex you can that fully matches all the strings in the first list and ...
user avatar
  • 1,131
7 votes
10 answers
3k views

The worst ever phone number entry screen

The name of the challenge was prompted by this GIF and the GIF also gave me the idea. Your challenge today is to take a input guaranteed to be \$2<=n<=100\$ and output a sequence of ...
user avatar
12 votes
14 answers
727 views

Minimal distinct character quine

Your challenge is to construct a proper quine using as few distinct characters as possible. Scoring Your score is equal to the number of distinct characters in your code, aiming to minimise this. ...
user avatar
  • 27.5k
9 votes
8 answers
751 views

Encode a Lenguage

The Len(language,encoding) family of languages is a variety of Lenguage derivatives. To encode a program into a Len language, you replace every character with its representation in a certain encoding, ...
user avatar
  • 27.5k
8 votes
3 answers
368 views

Polyglot Interpreters

Challenge Choose any number of languages. Call this set L. Write a program so that running it in any language in L produces an interpreter for a different language ...
user avatar
39 votes
31 answers
4k views

Concatenated halting problem: no + no + ... = yes

Challenge Write \$2 \le n \le 10\$ distinct, valid non-halting full programs in your language of choice. If all of them are concatenated in order, the resulting full program should be a valid halting ...
user avatar
  • 62.1k
18 votes
10 answers
2k views

Make a polyglot generator

A polyglot is a program that runs in several languages. Your challenge is to: Choose at least two languages (Different versions count as different languages) Create a program or function that takes ...
user avatar
  • 27.5k
23 votes
74 answers
4k views

Compose a song, line by line

It's time for CGCC to demonstrate our musical talent! In this challenge, you're going to compose songs while keeping your byte count as small as possible. On Day 0, multiple answerers will post a ...
user avatar
  • 9,266
10 votes
0 answers
325 views

Leave a wake of dead cells behind you

Conway's Game of Life is a well known cellular automaton "played" on an infinite grid, filled with cells that are either alive or dead. Once given an initial state, the board evolves ...
user avatar
7 votes
2 answers
321 views

Largest Compatible Maze

Background Consider an \$n\times n\$ grid, where each cell is either empty (denoted by .) or a wall (denoted by #). We say that ...
user avatar
  • 6,216
31 votes
23 answers
9k views

R.E.P.A.I.R. T.H.E. K.E.Y.B.O.A.R.D

Sequel of this AWESOME challenge You, a genius tech prodigy detective, have successfully disarmed the bomb and want to break into the computer. The police found the password ...
user avatar
  • 11.9k
48 votes
7 answers
6k views

Reverse Zip Bomb

A zip bomb is a compressed file, designed so that unpacking it yields the biggest file possible. These are fairly well known, and there are examples of 42 KB files which expand into multiple petabytes ...
user avatar
6 votes
1 answer
307 views

Two Diehards Make a Glider

In Conway's Game of Life, there is an infinite square grid of cells, each of which is alive or dead. The pattern changes each "generation". A dead cell with exactly 3 live neighbors (...
user avatar
  • 9,791
16 votes
5 answers
737 views

Keep PPCG running in Game of Life

Conways' Game of Life is a well known cellular automaton "played" on an infinite grid, filled with cells that are either alive or dead. Once given an initial state, the board evolves ...
user avatar
5 votes
1 answer
319 views

2D Pathfinding with Momentum

You are piloting a spaceship, outfitted with an engine that can accelerate you at 1km/s^2 in the direction the ship is facing (you have very good inertial dampers). You also have thrusters which can ...
user avatar
  • 1,995

1
2 3 4 5
18