# All Questions

11,345 questions
Filter by
Sorted by
Tagged with
210 views

### Is this a rectangle?

The challenge: Given four coordinates, each in x y form, your job is to find out whether or not the given coordinates form a rectangle, and output a truthy/falsey. Rules: For the sake of simplicity,...
517 views

### Triangular code, triangular output

For this challenge, submissions should be a program or function shaped like a right triangle, which produces a right triangle of the same size. What is a right triangle? For this challenge, a right ...
833 views

### Convert to and from Base 94

The challenge Make 2 programs which convert decimal to and from base 94, or a bidirectional program. Base 94? Base 94 is like any other base, but instead of 0 to 9 and letters, it uses ASCII ...
425 views

### Maintain diagonal symmetry when placing N items on a square grid

Write a program that takes in two non-negative integers S and N in that order. S represents the side length of a square grid of . characters. N represents the ...
72 views

### Decode Arabic to Arabic Presentation Form

Objective Given an Arabic string consisting of ISO/IEC 8859-6 Arabic letters (U+0621–063A, 0640–064A), decode it to Arabic Presentation Forms-B (U+FE70–FEFF). Behavior of Arabic letters ISO/IEC ...
1k views

### Check membership of an infinite list

As input you will receive An integer $a$ A list of integers that is infinite and strictly-monotonic1. Your program should check in finite time if $a$ appears the list. You should output one of ...
86 views

### The uncrackable cipher [closed]

I ran this through reddit yesterday and nobody could figure it out. I honestly don't know what the original text is. I originally received this in a body of an email. This is a temporary account, but ...
624 views

### Code golf edit distance 2

The edit distance between two strings is the minimum number of single character insertions, deletions and substitutions needed to transform one string into the other. This task is simply to write ...
185 views

### Does base n have any Rotate-Left-Double numbers?

Task A Rotate-Left-Double number in base $n$ is a number $m$, when its base-$n$ digits are rotated left once, equals $2m$. The base-$n$ representation of $m$ cannot have leading zeros. ...
677 views

### Boil eggs using hourglasses

These are the classical puzzles: You need to boil eggs for exactly 9 minutes, or else the visiting Duchess will complain, and you will lose your job as head chef. But you have only 2 ...
328 views

### Multiplayer Rock-Paper-Scissors

Objective Given a nonempty multiset of Rock, Paper, and Scissors, output the winning figure ...
1k views

### Mirror and reverse text

Inspired by I reverse the source code, ... Your task, if you wish to accept it, is to reverse text and mirror select characters. Yes, yes, I know. Very surprising. Input A string, ...
5k views

### How happy is this emoticon?

In this challenge, submissions will be programs or function which, when given an emoticon such as :-), :(, or ...
5k views

### Is this a legal date? - April Fools' edition

Task A date can be compactly represented in a 6-character string in the format ddmmyy where the first two characters (dd) ...
2k views

### Let's decompress a bit

Given a compressed string $s$ made of printable ASCII characters (32 to 126), your task is to print or return the original text by applying this simple decompression algorithm: Start with $k=0$ ...
1k views

### Generating generating expressions for sequences

(yes, "generating generating" in the title is correct :) ) Context In middle (?) school we are taught about sequences and, in particular, we are taught about linear sequences where the ...
1k views

### Convert Planck unit to SI metric

Objective Given a dimension of an SI unit, convert the Lorentz-Heaviside version of a Planck unit $1$ into SI metric. What is a Planck unit? Planck units are a set of units of measurement. It ...
6k views

### God is real . . . unless declared integer

This challenge is inspired by Fortran's idiosyncratic implicit typing rules. Your task will be to determine the data type of the object GOD according to the ...
537 views

### KoTH: Wizard Battle

In this challenge, all bots are wizards. At the beginning of each round, they create a wand which has a certain chance of successfully stunning another wizard. They then fight, by choosing one bot to ...
2k views

### Pseudo-deterministic number generator

Task Write a function/full program that will be able to produce two different sequences of integers in [0, ..., 9]. You will take an input ...
4k views

2k views

### Cook me a character meal

Chef Avillez is about to cook us some really nice meal. He is just waiting for us to give him some ingredients and to request a meal. Task Given a list of ingredients (strings matching ...
182 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. ...
244 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. ...
844 views

### Reconstruct a 3d arrangement of cubes from two of its projections

Setup Take the following 4x4x4 cube along with a 2D view of 3 of its faces, with a common 1x1x1 cube highlighted: The arrows ...
680 views

81 views

### Minimum Hop Count in Directed Graph based on Conditional Statement [closed]

A directed graph G is given with Vertices V and Edges E, representing train stations and unidirectional train routes respectively. Trains of different train numbers move in between pairs of Vertices ...
2k views

### Measure the lengths of binary patterns

Let's consider the sequence of the binary representation of positive integers (without any leading zero): ...
4k views

### Even a clock that isn't working gets the time right two or three times a day

Context When I was a little kid, I watched a Disney movie where Goofy told his son "Boy, even a broken clock is right two or three times a day." (see this youtube clip, courtesy of @Arnauld). ...
116 views

### Tips for Golfing in Symja

Symja is a "computer algebra language & Java symbolic math library for Android NCalc calculator". It's a fun little language, so I'm wondering if y'all have any tips for golfing in Symja. As per ...
80 views

### Tips for golfing in Pure Data

Pure data is a graphical programming language designed for audio processing. This makes it unsuitable for most general programming but especially unsuitable for code-golf. It would then be nice to ...
1k views

### Day of the week of an ambiguous date

Goal Write a program or function that returns the day of the week for a date, eg. 01/06/2020 -> Mon However, it's unknown if the date is in the format mm/...
1k views

### KoTH: Highest HP is Eliminated!

In this challenge, bots must survive as long as possible. In each turn, the bot with the most HP is eliminated. This challenge is inspired by the Smallest unique number KoTH. Results After 100,000 ...
4k views

Introduction The current coronavirus disease is officially named COVID-19, from the 3 words corona virus disease, and the year 2019. (Technically it's coronavirus, making 2 words, but whatever...) ...
278 views

### Return a word with a prescribed sum of letters

Identify each letter of the English alphabet with the number denoting its position in the alphabet, that is, a = 1, b = 2, c = 3, ..., z = 26 (no distinction ...
2k views

### A bit of a digital XOR

Here are the first 100 numbers of a sequence: ...
427 views

### What can you see on a hexagonal spiral?

This code-golf challenge will have you computing OEIS sequence A300154. Consider a spiral on an infinite hexagonal grid. a(n) is the number of cells in the part of the spiral from 1st to n-th cell ...
3k views

### Ah, why is there a bug in my program?

This challenge is inspired by @LuisMendo's MATL answer to my "binary multiples" challenge. Task Pick a code-golf challenge that is open and that has been posted before this one; let me call it the "...