All Questions

Filter by
Sorted by
Tagged with
13 votes
3 answers
2k views

Print all legal chess moves

The game of chess has moves. Lots of moves. But how many, exactly? In this challenge, you must print all possible chess moves for a single player (black or white — you choose). Moves are distinguished ...
anatolyg's user avatar
  • 13.6k
11 votes
4 answers
1k views

Output a 1-2-3-5-7... sequence

Follow-up of my previous challenge, inspired by @emanresu A's question, and proven possible by @att (Mathematica solution linked) For the purposes of this challenge, a 1-2-3-5-7... sequence is an ...
Tbw's user avatar
  • 1,805
19 votes
15 answers
2k views
+200

Output a 1-2-3 sequence

For the purposes of this challenge, a 1-2-3 sequence is an infinite sequence of increasing positive integers such that for any positive integer \$n\$, exactly one of \$n, 2n,\$ and \$3n\$ appears in ...
Tbw's user avatar
  • 1,805
16 votes
17 answers
1k views

Maximum number of trailing zeros

Input Positive integers a and b defining an interval of integers [a .. b]. Output The maximum number of trailing zeros in the binary expansion of any integer in the interval [a .. b]. Examples Input: [...
jmchappell's user avatar
14 votes
22 answers
5k views

FizzFizzFizzBuzz!

Given a positive integer n, output the "FizzFizzFizzBuzz" sequence for that number: print the decimal representations of the numbers 1 through ...
3-1-4-One-Five's user avatar
17 votes
55 answers
1k views

Fixed Repeating Output

Fixed Repeating Output is a challenge originally invented by Esolang user AnotherUser05 which shows that a language supports loops and I/O. Challenge A program that solves the challenge has to do ...
None1's user avatar
  • 375
11 votes
8 answers
3k views

Should the banker hit?

Baccarat is a casino game where gamblers bet on whether one of two hands, the player or the banker, will have a sum closer to 9 (mod 10) or whether they will tie. It is played with four to eight ...
Purple P's user avatar
  • 1,637
10 votes
4 answers
543 views

Construct the point with two segments

Given a rational point P, return four integral points A, B, C, and D, such that the line segments AB and CD intersect only at P. To make it a bit more interesting, segment AB doesn't include A and B. ...
l4m2's user avatar
  • 23.9k
17 votes
4 answers
2k views

Draw a Fibonacci Swoosh

Title courtesy of Greg Martin For this challenge, I'll define an arc of size \$k\$ as a single piece of a sine wave with a length of \$k\$ units and an height of \$\frac{k}{4}\$ units: And I'll ...
emanresu A's user avatar
  • 37.8k
5 votes
3 answers
239 views

Fewest Instructions for Mihály Quine

https://mihaly.barasz.com/compressed-loop/game.html You have a simple, line-oriented “compression” language. The language works as follows: The document must start with the ...
programjames's user avatar
21 votes
21 answers
1k views

Adding two numbers in Tally marks

Given two positive integers, add them. Both inputs and output are in Tally marks form, which can be expressed as: $$ T(n) := \begin{cases} n,&& n\le 5\\ 5 || T(n-5),&& n>5 \end{...
l4m2's user avatar
  • 23.9k
18 votes
13 answers
1k views

Emulate Jelly's tie-scan

The golfing language Jelly has a built-in ƭ called "tie", that cycles through a list of functions every time it's called. For example, ...
emanresu A's user avatar
  • 37.8k
9 votes
3 answers
188 views

Construct the Irish possessive

In this challenge you will take an Irish word and a personal pronoun and create the possessive pronoun construction combining the two. For example , ...
Wheat Wizard's user avatar
  • 98.5k
-3 votes
5 answers
206 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
13 votes
12 answers
2k views

Odds for second smallest prime factor

Given a prime number \$p\$ output the asymptotic density of the set of positive integers which have \$p\$ as their second-smallest distinct prime factor Input/Output Input: one of the following ...
Mukundan314's user avatar
  • 10.6k
4 votes
5 answers
565 views

Remove filler words from a string

I always stutter and use filler words when speaking to a lot of people at a time. So I need something to remove all my filler words. So here is the challenge. Your program should take input as a ...
3-1-4-One-Five's user avatar
27 votes
6 answers
3k views

How many cacti can I plant here?

Given a Minecraft terrain as a 2-dimensional array of integers or similar datastructure, determine the maximum number of cacti that can be planted on it. The integers represent the height (y) of the ...
Cactusroot's user avatar
11 votes
12 answers
731 views

Rockstar Poetic Number Literals!

The Rockstar programming language has "poetic number literals", allowing you to assign nonnegative, finite (at least one Rockstar interpreter supports infinity) numbers to variables without ...
3-1-4-One-Five's user avatar
11 votes
22 answers
1k views

Map key with value as standard [closed]

Given a non-empty string containing only printable ASCII (codepoints 0x20 to 0x7E), write the shortest program or function that map the key to its value. Inside the string the key will always have a ...
G. Ciardini's user avatar
10 votes
14 answers
739 views

Swifty Argument Labels

For the purpose of this challenge, arguments are things you pass to a function at the call site, while parameters are what the function uses in its implementation. Or, more succinctly: arguments = ...
macOSisthebestOS's user avatar
8 votes
3 answers
710 views

Implement a 2-player version of 1D Chess

The game is played on a 1x8 board with the following setup: KNR..rnk White's pieces are on the left, while black's pieces are on the right. The king (K) can move 1 ...
Quadruplay's user avatar
14 votes
14 answers
2k views

Break an integer into even- and odd-indexed bits

Objective Given an integer \$n\$ interpreted as two's complement binary, output two integers, namely the integer consisting of \$n\$'s bits at places of \$2^0, 2^2, 2^4, \cdots\$, and the integer ...
Dannyu NDos's user avatar
  • 5,941
29 votes
5 answers
2k views

Can I Clear The Grid?

I recently found this game and have been enjoying it. Basically, there is a grid of colored tiles and you act by clicking on empty spaces. When you click an empty space, the first tile (if any) in ...
hyper-neutrino's user avatar
  • 42.4k
18 votes
10 answers
931 views

Next cyclic suffix

We will say a string \$x\$ is cyclic maximal if there is no way to cycle its elements to get a lexicographically larger string. In other words there is no \$a\$ and \$b\$ such that \$a \oplus b = x\$ ...
Wheat Wizard's user avatar
  • 98.5k
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
34 votes
17 answers
3k views

Create a cactus from words

Introduction: A typical cartoonish cactus usually looks like this: One big stem in the middle, with some L-shaped branches sticking out. We'll use this general shape for this challenge. Challenge: ...
Kevin Cruijssen's user avatar
21 votes
4 answers
2k views

Avoiding Loops!

Given a collection of coloured laces, what would be the probability, \$P\$, that Alice won't create any loops if, until impossible, they tie two uniformly chosen, free lace ends of differing colours ...
Jonathan Allan's user avatar
6 votes
12 answers
908 views

Argument of a complex number (Robbers)

V1.1: Added criterion to help with tiebreakers, a bit overkill but still.V1.2: It's April 15th! Task: Crack the scrambled code for calculating the argument of a complex number \$z=x+iy\$ given two ...
CrSb0001's user avatar
  • 361
10 votes
23 answers
2k views

Argument of a complex number (Cops)

This is the cop's thread, where one should post the scrambled code. Here is the robbers' thread where the cracked source should be posted and linked to the cop's answer. NB: I am currently writing up ...
CrSb0001's user avatar
  • 361
6 votes
2 answers
509 views

Situations when recursion helps [closed]

Recursion is actually quite powerful, sometimes its doesn't look like that child problem of itself exist, but recursion is just helpful. One case per answer.
l4m2's user avatar
  • 23.9k
4 votes
8 answers
741 views

Evaluate Ternary Logic

Objective Given an expression involving ternary values, evaluate it into a ternary value. Ternary Values The three truth values in question are the values of Haskell's ...
Dannyu NDos's user avatar
  • 5,941
2 votes
3 answers
188 views

Rank poker High Card hands [closed]

In the poker game there are 1277 unique 'High Card' ranks. It's 1287 (13 over 5) if we include all straights. The challenge is to write a function which returns an integer value corresponding to the ...
Ziarek's user avatar
  • 123
14 votes
7 answers
2k views

How quickly can you type this unary string?

If I want to type the string aaa, the least keystrokes I can type it in is 3: a a a. But if I want to type the string ...
emanresu A's user avatar
  • 37.8k
8 votes
12 answers
1k views

Scan input for numbers and add thousands separators

Challenge Given ASCII-encoded text input of any size, detect numbers between -1,000,000,000,000,000,000 and 1,000,000,000,000,000,000 exclusive and rewrite them with thousands separators. Use commas ...
noname's user avatar
  • 391
7 votes
2 answers
246 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
17 votes
3 answers
906 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
  • 76k
1 vote
7 answers
111 views

Interlaced array [duplicate]

You are given an array A of length N and an array B of length ...
Daniil Tutubalin's user avatar
12 votes
14 answers
1k views

Lattice points visible from the origin

Challenge Create a program that outputs a square grid showing visible and non-visible points \$(x, y)\$ from the origin based on their greatest common divisor (GCD). A point \$(x, y)\$ is considered ...
vengy's user avatar
  • 2,163
10 votes
5 answers
941 views

Manipulate integers to zero

Objective Given a nonempty unordered list of positive integers, decide whether they can be added, negated, or multiplied to yield a single zero. Each given number must be used exactly once. There is a ...
Dannyu NDos's user avatar
  • 5,941
15 votes
16 answers
1k views

Pretty Palintiples

Imagine you have a positive integer number \$n\$. Let \$m\$ be the number obtained by reversing \$n\$'s digits. If \$m\$ is a whole multiple of \$n\$, then \$n\$ is said to be a reverse divisible ...
Trivaxy's user avatar
  • 487
8 votes
10 answers
1k views

Give two points with the most similar distances to the origin

Consider an \$(n+1) \times (n+1) \$ grid of points places at non-negative integer coordinates. Given two points in the grid at \$(a, b)\$ and \$(c, d)\$, we know that the distance of the first point ...
Simd's user avatar
  • 2,896
0 votes
0 answers
124 views

Shortest Float32Array to Int32Array conversion for audio processing

I'm currently converting a Float32Array to an Int32Array for input to a real-time audio raw PCM to MP3 recording application. <...
guest271314's user avatar
4 votes
0 answers
110 views

Electra "Hello World!" [duplicate]

This will be a bit of a different challenge. Back in 2023, I developed a 2D esolang called Electra, and looking back at my hello world program, (which is 582 bytes by the way) I see a lot of room for ...
DolphyWind's user avatar
22 votes
21 answers
4k views

One-Dimensional Pinball

Consider a finite, one-dimensional grid where each cell is marked with one of two symbols (I will use the symbols < and >, ...
Mukundan314's user avatar
  • 10.6k
21 votes
15 answers
2k views

Can I follow this recipe?

You work in a kitchen which has a peculiar rule. When you mix something into a pot you must always add at least one new ingredient. So you can add pasta, oil, salt then pesto, but not pasta, pesto, ...
Wheat Wizard's user avatar
  • 98.5k
17 votes
15 answers
1k views

Reconstruct a list of strings from its prefixes

emanresu A posted a challenge to reconstruct an ordered list of integers from its unordered set of unordered prefixes. Many users (beginning with xnor's answer) noticed that summing each unordered ...
Greg Martin's user avatar
  • 15.7k
18 votes
18 answers
1k views

Reconstruct a list from its prefixes

A list \$[a_1,a_2,a_3 \cdots a_n]\$ can be uniquely represented as an unordered list of its prefixes - \$ [[a_1],[a_1, a_2], [a_1,a_2,a_3] \cdots [a_1,a_2,a_3 \cdots a_n]] \$. This can be in any order ...
emanresu A's user avatar
  • 37.8k
11 votes
6 answers
398 views

µUnitDC: A unit-aware RPN calculator

Background This challenge is based on a personal project I did, UnitDC. This challenge is a super-miniaturized version of UnitDC. Challenge Please write a simple unit-aware calculator that evaluates a ...
Eternal_flame-AD's user avatar
21 votes
38 answers
2k views

Find the odd one out

Challenge The goal of this challenge is to generate and output a \$16 \times 32\$ (height \$\times\$ width) grid where all cells contain a decoy character, except for a random single cell that ...
vengy's user avatar
  • 2,163
18 votes
26 answers
2k views

Is it a tetrate of two?

The tetration operation consists of repeated exponentiation, and it is written ↑↑. For instance, 3↑↑3 =3 ^(3^3) = 3^27 = 7,625,597,484,987 A tetrate of two is an ...
isaacg's user avatar
  • 42k

15 30 50 per page
1
2 3 4 5
281