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

876 questions
Filter by
Sorted by
Tagged with
251 views

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 ...
• 1,260
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 ...
• 3,920
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 ...
• 837
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 (...
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. ...
• 179
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 ...
• 2,121
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 (...
• 2,121
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 ...
• 71
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 ...
• 85k
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 ...
• 491
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 ...
• 1,131
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, ...
• 17.1k
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 ...
• 27.5k
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 ...
• 27.5k
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 ...
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 ...
• 12.7k
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: ...
• 2,229
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, ...
• 3,041
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 ...
• 498
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 ...
• 703
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-...
• 6,645
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 ...
• 179
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 ...
• 491
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 ...
• 6,645
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 ...
• 17.1k
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, ...
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 ...
• 865
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 ...
• 1,367
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. ...
• 85k
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 ...
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 ...
• 38.6k
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 ...
• 27.5k
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 ...
• 27.5k
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: ...
• 27.5k
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 ...
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 ...
• 1,131
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 ...
• 3,637
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. ...
• 27.5k
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, ...
• 27.5k
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 ...
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 ...
• 62.1k
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 ...
• 27.5k
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 ...
• 9,266
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 ...
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 ...
• 6,216
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 ...
• 11.9k
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 ...
• 17.1k
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 (...
• 9,791