Skip to main content

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

1 vote
0 answers
116 views

Through maze with a hint

Given a wall maze of 50x50, write two functions: One takes the maze as input and returns a positive integer; The other takes the integer and walk through the maze from left-top to right-bottom. At ...
l4m2's user avatar
  • 32.3k
18 votes
3 answers
968 views

Cancel and minimize game

Here is a game: Start with the set {1,2,3,...,n} of natural numbers. At any turn of the game, you may pick two numbers from this set, a and b, then replace them with their product a*b. Since it is a ...
Fabius Wiesner's user avatar
9 votes
2 answers
434 views

Error-Detecting Quine

Write a program with the following properties: it must be a quine, i.e. running it outputs precisely the program itself; it must take no input; for at least one integer k, it must be the case that ...
aeh5040's user avatar
  • 2,072
6 votes
2 answers
329 views

Unstablizable LaTeX

from Latexmk: If you use cross-references, you often have to run LaTeX more than once ... Sometimes cross-referenced locations change and you need to run LaTeX again to create the correct reference. ...
InQβ's user avatar
  • 453
8 votes
1 answer
392 views

Sequence of programs that prints the next one with length growth being equal to π

Challenge You must produce an infinite sequence of programs \$P_0, P_1, P_2,\$ … such that each program \$P_n\$, when run, prints the exact source code of \$P_{n+1}\$ and then halts. Each program \$...
Bryle Morga's user avatar
4 votes
8 answers
932 views

How many distinct characters can be used to implement Boolean Algebra in your programming language [closed]

I am interested in the following problem: What is the minimum number of distinct characters used in any programming language that can implement Boolean Algebra? In particular, what is the set that ...
dnn25519's user avatar
  • 169
3 votes
1 answer
297 views

Long running section 11.4 Minsky machine

Challenge We define a Minsky machine as a program made of the following two instructions: +X which increments the register X and continues to the next instruction -Xn which simply continues if X is ...
malediscord kitten's user avatar
3 votes
1 answer
302 views

Count number of families of sets satisfying a list of criteria

CHALLENGE This problem has a math background. For n=1,2,3,4 we want to count the number of families of sets with maximum n elements that satisfy many criteria of the form: $$\bigoplus_{k\in A,A\in \...
Fabius Wiesner's user avatar
3 votes
5 answers
407 views

Run a board game tournament

You are in charge of running a board game tournament. Unfortunately, you only have one copy of the game and only so much time, so only a limited number of games can be played. Similarly, you have a ...
Spitemaster's user avatar
  • 2,189
22 votes
2 answers
2k views

Fast leap year check

The task is to find parameters that make a fast leap year check correct for the widest range of years. We assume the Proleptic Gregorian calendar, which extends the Gregorian calendar backward from ...
Falk Hüffner's user avatar
4 votes
8 answers
3k views

Convert 8 Bit brainfuck to 1 bit Brainfuck / Boolfuck

Goal Input is a Brainfuck program for 8 bit cells, output it for 1 bit cells. Explanation We all know Brainfuck, normally it uses 8 bit cells. But there are implementations where a cell is just 1 bit, ...
12431234123412341234123's user avatar
3 votes
2 answers
552 views

Largest possible relative error

Output \$20\$ float64s with absolute value between 1 and 2 inclusive whose sum has the largest possible relative error. We can assume the true sum is not zero. The sum is to be computed from left to ...
Simd's user avatar
  • 3,167
16 votes
3 answers
2k views

Find 10 float64s that give the least accurate sum

Input Integer \$n > 1\$ Output Ten 64 bit floating point numbers between \$-n\$ and \$n\$, inclusive, whose sum is the least accurate. Details and examples. These examples are not claimed to be ...
Simd's user avatar
  • 3,167
-3 votes
5 answers
399 views

Create the characters you can write on a MacOS US English Keyboard (as another OS will read them)

Introduction This is a small challenge I came up with while trying to make some compact code for my younger brother to use. I don't think it's particularly interesting, but I believe it presents some ...
Mel's user avatar
  • 109
5 votes
9 answers
3k views

nimi ale lon toki pona! (Every word in Toki Pona!)

"nimi ale lon toki pona" is a song by YouTuber jan Misali which lists 137 common words in the constructed language Toki Pona. This challenge is not a duplicate of "How high can you ...
3-1-4-One-Five's user avatar

15 30 50 per page
1
2 3 4 5
61