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
-9
votes
0answers
56 views

Anyone please help me to understand this and solve this [closed]

Sophie gives a list of numbers to her five-year-old daughter and explains four types of operations that she can perform on this list. Sophie also gives her a list that shows the sequence in which ...
8
votes
0answers
152 views

Gluing tetrahedra together

(This challenge exists to extend sequence A267272 in the On-Line Encyclopedia of Integer Sequences, and perhaps create a new OEIS sequence1.) This is a code-challenge, which will have you write code ...
-4
votes
0answers
151 views

Write a Javascript / TypeScript class which can generate subclasses and instances of itself by new-ing it, ad infinitum

The challenge is to write a JavaScript / TypeScript class, named SelfReproducingClass below, which satisfy the following criteria. The aim is to make ...
13
votes
8answers
2k views

We're much closer than you think

Martin Ender's 2D programming language Alice has two different modes depending on what orientation the IP has: orthogonal (Cardinal mode) or diagonal (Ordinal mode). Commands in Alice change their ...
22
votes
2answers
752 views

Extend the most recent “nice” OEIS sequence: stepping stone puzzle on a grid

Today Neil Sloane of the OEIS sent out an email asking for a confirmation of the current terms, and computation of some larger terms of the latest OEIS sequence A337663 with the keyword "nice&...
14
votes
4answers
405 views

Bad matrix multiplication that gives the right answer

Executive summary: Print NxN matrices \$A\$ and \$B\$ where \$ AB = 10A + B \$. Largest N wins! Details: Entrants in this challenge should choose an N. Submit a program that takes an input integer '...
-1
votes
0answers
80 views

Shortest C program which compiles to largest file size [duplicate]

Challenge This challenge is to create the shortest C program which compiles to the largest file size. Your score for this challenge is ...
5
votes
4answers
253 views

More Codington Crescent

Who's up for a second attempt? If you've ever listened to the radio program "I'm sorry, I haven't a clue", then you've probably heard of the game called "Mornington Crescent". For ...
24
votes
21answers
3k views

Minimal maximum byte for Turing Completeness

Summary We already have a challenge for the minimal number of characters for Turing completeness. But what about the minimal maximum byte? Challenge For a language of your choice, find a subset of ...
28
votes
9answers
3k views

Approximate when you are going to die

A mortality table or life table is an actuarial tool that gives the probability that a person aged \$A\$ years will die in the next year, and is used to help calculate the premiums for life insurance, ...
29
votes
17answers
2k views

Substandard deviation

The mean of a population \$(x_1,\dots,x_n)\$ is defined as \$\bar x=\frac1n\sum_{i=1}^n x_i\$. The (uncorrected) standard deviation of the population is defined as \$\sqrt{\frac1n\sum (x_i-\bar x)^2}\$...
10
votes
9answers
711 views

Codington Crescent [duplicate]

Let's just see how this goes If you've ever listened to the radio program "I'm sorry, I haven't a clue", then you've probably heard of the game called "Mornington Crescent". For ...
18
votes
13answers
2k views

Case invert your quine

Write a quine which attempts to invert the case of as many ascii characters in the source code as possible. For example in javascript: ...
19
votes
6answers
1k views

The 1+ Metagolf Challenge

I'm letting this one out of the sandbox. Hopefully it is well-written and make sense, feel free to improve. So in order to make 1+ more popular (and ease the creation of golfed 1+ text-printing ...
41
votes
8answers
3k views

Constructing an evil maze against random exploration

RollerCoaster Tycoon 2's maze is the inspiration for this question. Credit to Marcel Vos for thoroughly breaking the classic RCT2 AI. The pathfinding AI in this question is the AI in the latest ...
13
votes
4answers
534 views

Writing erasable code

My phone number (which I will not be sharing here) has a neat property where there is a two digit number, which when iteratively removed from my phone number will eventually remove all the digits. ...
25
votes
21answers
4k views

Create a Boolean Calculator

Our boolean operators are AND, OR, XOR, NAND, ...
28
votes
4answers
3k views

Orientation Oriented Programming

Write a program for a specific language that in different orientations performs different tasks. Your code should have at least two non-empty lines and at least two non-empty columns and should ...
12
votes
3answers
697 views

Metagolf the OEIS

We've had Meta Regex Golf and Display OEIS Sequences. Now, it is time for Meta OEIS Golf. Challenge Given a sequence of integers, your program/function should output a program/function in the same ...
21
votes
21answers
1k views

Shortlex predecessor

Please note the special scoring for this challenge. Given a non-empty string made of a-z, output the string immediately before it in the shortlex order. Shortlex ...
-5
votes
2answers
285 views

Output NC_045512, the first sequenced genome of SARS-CoV-2 (COVID-19) [closed]

Output the variant NC_045512 of SARS-CoV-2. The genome's raw form is available here. Lowercase and uppercase are both acceptable You must output with the letters A, C, T, and G. An arbitrary number ...
19
votes
28answers
2k views

A rainbow of identity functions

Closely related: How high can you count? Challenge In your programming language of choice, write as many different identity programs/functions as possible, under the following constraints: Each ...
14
votes
6answers
756 views

Reverse busy beaver problem

In this challenge, Turing machines operate on a zero-initialized binary tape that is infinite in both directions. You are given an integer \$N\$, where \$1 \le N \le 20000\$. Your program has to ...
9
votes
0answers
242 views

Leon's shooting range problem

Leon's story Leon is a professional sling shooter and he comes to a shooting range everyday to practice. A casual target is not a challenge for him anymore so before shooting he first covers the ...
19
votes
7answers
1k views

Break The Chain

You are given an \$ 25 \times 25 \$ square lattice graph. You are to remove certain nodes from the graph as to minimize your score, based on the following scoring system: Your score will be the \$ \...
12
votes
3answers
364 views

How much weight can you lift?

With all the gyms closed down with the COVID-19 situation, we have to exercise with the weight we have lying around at home. The problem is, we have a small selection of plates at varying weights, and ...
3
votes
0answers
144 views

Simulate the isotropic non-totalistic cellular automaton

There are many generalizations of Conway's Game of Life. One of them is the isotropic non-totalistic rulespace, in which the state of a cell in the next generation depends not just on its state and ...
4
votes
2answers
342 views

Chase the Easter Bunny and collect his eggs

Chat room: https://chat.stackexchange.com/rooms/106513/easter-bunny-challenge Git repo: https://github.com/AJFaraday/easter_bunny_hunt The garden is a 2-dimensional grid with 49 rows and 49 columns. ...
12
votes
4answers
2k views

Who's that pokemon (based on its etymology)?

As we all know, most Pokemon are created by combining some English (or Japanese) words; these words are the Pokemon's "etymology." For example, "charmander" is "char" and "salamander" put together. ...
4
votes
6answers
233 views

FizzBuzz: Least unique bytes [duplicate]

Introduction: Although it seems challenges scored by least unique characters have been attempted, there are few which were well-received. I think it's a potentially interesting scoring criterion, as ...
6
votes
2answers
290 views

2D interpolation

Given required values for an expression with 2 variables, output a short expression which fulfill these values Input You may take the input in any reasonable format, e.g. ...
-2
votes
20answers
565 views

Hello ASCII World!

Construct a full program which outputs Hello, World!. The score of your submission will be equal to the sum of all of the ASCII values of the distinct characters. ...
10
votes
6answers
972 views

As close to flat as possible

Write a program or function that fulfills the following Scores less than 101 bytes under normal code-golf rules Takes no input1 and always outputs a single integer. Every integer is a possible output....
26
votes
8answers
2k views

Single Digit Representations of Natural Numbers

Task Write a program/function that when given a positive integer \$n\$ and a digit \$d\$ which is not 0 outputs a way to represent \$n\$ using only addition, subtraction, multiplication, ...
-6
votes
10answers
319 views

Generate a secure password [closed]

Task Your task is to generate a password that is both secure and short in the fewest bytes possible given an integer seed as input. Input No seed Or An integer seed Output A password Scoring ...
8
votes
2answers
388 views

Find the largest recurring prime

Inspired by Find the largest fragile prime A recurring prime (or whatever you choose to call it) is a prime that, when removing leading digits, always remain prime regardless of how many digits are ...
1
vote
2answers
475 views

Hash bomb filtrate

Pipe a short stream to the following Java program run with accompanying command line options, such that it prints true. ...
30
votes
17answers
7k views

Fastest yes in the west

There has been a question about yes in the past, but this one is slightly different. You see, despite yes having a rather long size, it is incredibly fast. Running ...
2
votes
0answers
130 views

Predictor Generator [closed]

Write a program that when given a string \$S\$, it generates a program of the same language as itself. The generated program, when given a continuous substring of \$S\$, should predict the next ...
4
votes
5answers
318 views

Find the most important character

Find the most important character The challenge is to write a program that outputs the most occurrent character in the input string, excluding these bracketing characters ...
3
votes
1answer
245 views

Estimate the mean minimum Hamming distance

Task Inputs \$b \leq 100\$ and \$n \geq 2\$. Consider \$n\$ binary strings, each of length \$b\$ sampled uniformly and independently. We would like to compute the expected minimum Hamming distance ...
-6
votes
5answers
318 views

Approximating the amount of prime numbers below `x`

Background We define the prime-counting function, \$\pi(x)\$, as the number of prime numbers less than or equal to \$x\$. You can read about it here. For example, \$\pi(2) = 1\$ and \$\pi(6) = 3\$. ...
2
votes
0answers
75 views

Selfish Programs [duplicate]

The Challenge Write two programs P and Q such that: P and ...
14
votes
1answer
547 views

Is everything in order?

Challenge: Input: a string, consisting of only printable ASCII characters Output: a truthy/falsey value whether its characters are in alphabetical order (based on their UTF-8 unicode values), from any ...
4
votes
2answers
179 views

Inter-language 2-cycle quine [duplicate]

Challenge Create 2 programs A and B The output of program A is exactly program B The output of program B is exactly program A Neither program should depend on inputs to yield the correct output A ...
9
votes
1answer
417 views

Caddyshack or: How to compress already-golfed code

In golf, a knowledgable caddie helps an already good golfer to be even better. In this challenge, you build a "caddie" to help you code golf. In particular, your caddie will compress golfed code in ...
10
votes
6answers
1k views

Polyglot self-interpreter time

Your task is to make a program which interprets the language it is run in, but also works in many languages. Let's say you make a Brainfuck-Underload self-interpreglot, as it will be called. Run in ...
6
votes
1answer
610 views

Average number of strings with Levenshtein distance up to 3

The Levenshtein distance between two strings is the minimum number of single character insertions, deletions, or substitutions to convert one string into the other one. Given a binary string \$S\$ of ...
20
votes
4answers
453 views

Hexagonify™ a String Block

Sandbox What is Hexagonification™? Hexagonification™ is a transformation that creates a hexagon with 3 copies of a rectangle block, each skewed to the right by 30 degrees and then ...
29
votes
19answers
4k views

Pass on your radiation

The task here is pretty simple. You should write a program that takes a string as input and outputs it (that is a cat program). Additionally when the \$n\$th byte of your program is removed (without ...

1
2 3 4 5
17