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

2 votes
2 answers
467 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,088
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,088
-3 votes
5 answers
246 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
  • 9
3 votes
9 answers
2k 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
7 votes
2 answers
262 views

Convert maximum values to bit widths

Background The newest version of the C standard, C23, adds preprocessor macros like INT_WIDTH, ULONG_WIDTH, and ...
Tavian Barnes's user avatar
18 votes
3 answers
937 views

Magical BF: BF code that works in two ways

Challenge In this challenge, we will use a language that is very similar to Brainfuck but slightly different. This variant of BF does not have any input and output commands; instead, it simply takes ...
Bubbler's user avatar
  • 77.5k
0 votes
2 answers
222 views

The many ways to skin a `cat` [duplicate]

The well known cat command simply copies its stdin directly to stdout unchanged. But there are plenty of other commandline tools that exist... What other commands ...
CarmenCarmen's user avatar
-2 votes
2 answers
274 views

Forward foo, reverse bar, but avoid dead code [closed]

So simple: Provide some code that outputs foo and with the reversed source outputs bar. But before you come up with something ...
Philippos's user avatar
  • 2,590
5 votes
9 answers
1k views

Print the banned characters based on the most common characters

This is an answer-chaining post, so in this challenge every answer (except the first answer) depends on the previous answer. The goal of this challenge is to output the restricted characters. The ...
Fmbalbuena's user avatar
  • 4,167
19 votes
29 answers
3k views

Restricted Meta-Cat

Your challenge, should you choose to accept it, is to write a program in a language of your choice that, when given a string (limited to printable ASCII) as input, outputs a new program in the same ...
noodle person's user avatar
4 votes
5 answers
722 views

What is the smallest possible binary output you can generate

Here is a challenge: What is the shortest possible compiled program? Writing one line programs are fun, but they often lean on language libraries that get pulled into the final bits. How lean can you ...
Roger Hill's user avatar
16 votes
6 answers
4k views

I irradiate your source code, you irradiate your output

Your task is to write a program \$p\$ which outputs a string \$s\$ with the same length as \$p\$, where \$s \neq p\$. If I remove the \$n\$th byte from your program to get program \$q\$, then either \$...
Wheat Wizard's user avatar
  • 99k
1 vote
0 answers
64 views

How Many Staircases [duplicate]

Problem You're a staircase engineer on a house and realize you only have n rectangles to create a staircase. So you are tasked with finding the number of ways to ...
3.14's user avatar
  • 383
30 votes
44 answers
4k views

Repeat your program to print Fibonacci numbers

Write a program fragment so that, when repeated N times it prints the Nth Fibonacci number. For example, if your program is print(x) then: ...
mousetail's user avatar
  • 12.7k
10 votes
12 answers
2k views

Encrypting Emojis

Problem You are tasked with creating a program that performs emoji encryption on a given string of emojis. In this encryption scheme, each emoji is replaced by a unique character (from ...
3.14's user avatar
  • 383

15 30 50 per page
1
2 3 4 5
61