All Questions

11,672 questions
Filter by
Sorted by
Tagged with
123 views

Challenge You have a Chinese Checkers board looking like this: ...
7k views

DON'T… do NOT lowercase UPPERCASE this!

Write a program that outputs its input unchanged. However: If all uppercase characters are removed from the program, it lowercases all uppercase letters. If all lowercase characters are removed from ...
469 views

Extract words with clue numbers in a Crossword puzzle

Related: Read a crossword Task Given a completed Crossword puzzle, extract the words in it with their respective clue numbers, with "across" (horizontal) and "down" (vertical) words grouped and ...
271 views

Checking a Windows 95 OEM Key for validity [closed]

Introduction Windows 95 used a very simple algorithm for verifying license keys. The scheme of an OEM license key always looked like this: xxxyy-OEM-NNNNNNN-zzzzz ...
2k views

Shift the letters, soldier?

Context We're at war! You need to transfer an important message to your general to inform them from an imminent assault. The thing is, your enemy knows a lot about cryptography : you will need to be ...
556 views

Find the longest snake on a grid

Background A snake is a path over the cells of a square grid, such that it doesn't touch itself on a side of a unit square. Touching at a corner is allowed. An example snake: ...
3k views

Determine the Sharpness of a Word

Overview The sharpness of a word is the sum of the sharpness of each of its letters, using the following rules: Sharp letters A, and ...
2k views

135 views

Code that produces a memory leak in most “deeply implemented” garbage collected language? [closed]

What is the shortest code, in any garbage collected language (including ARC) that produces a memory leak? It does not matter how much memory is leaked. The shorter the code, and the more deeply ...
1k views

Quines that print what their index is

We all know what a quine is. A quine is a program which prints its own source code. And we also know about the printable ASCII characters. Well... this challenge mixes both. Your mission, should you ...
3k views

Make true and false global!

We all know true and false, but what do speakers around the globe say? ...
3k views

Your code has an uncanny mirror twin…

Write two programs, each taking a string s and a number n ≥ 0, such that: The first program prints ...
4k views

Compute xkcd's Wrong Times Table

The 2020-05-29 xkcd comic showed us the numbers that Randall Munroe feels would be most likely to result from multiplication, other than the correct answers. The table does seem to have some sort of ...
2k views

Zero the byte (eventually)

Given an infinite arithmetically-progressive¹ sequence, compute the minimum length of a prefix with a product divisible by 2^8. Sample cases & reference implementation Here is a reference ...
1k views

Bubbler numbers

Background My user ID is 78410, or $1 0 0 1 1 0 0 1 0 0 1 0 0 1 0 1 0_2$. One interesting property of this number is that, in binary, it doesn't have three consecutive identical digits, and yet it ...
156 views

Get a middle-ish string [closed]

You are the first engineer in a hot new startup, Lexographical. Our company is making waves by digitizing and indexing all words, real or not. The core of our product... Our secret sauce... Well, that'...
118 views

Brainfuck movement [closed]

A normal Brainfuck program starts out with an array of cells, all containing the number 0. This program, on the other hand, must be able to run starting with any ...
2k views

Pass The ⚽️ Around The Circle

The ball game is a game in which a number of players sit together in a circle. Each player is first assigned a number $n$, either 1, ...
1k views

Cut resistance of a list

Background Define a run in a list as a maximal contiguous subsequence of identical values. For example, the list 0 0 0 1 1 0 3 3 3 2 2 has five runs of lengths ...
4k views

Judge a book by its cover

Overview The cover of a book will be provided in the following ASCII format: ______ | | | | | | | | ------ The input can be in any reasonable format ...
2k views

Pairs with Sum divisible by 5

You will be given two integers $M$ and $N$. Find the number of pairs $(x,y)$ such that $1 \le x \le M$, $1 \le y \le N$ and $(x+y)\mod5 = 0$. For example, if $M = 6$ and $N = 12$, ...
842 views

Find all Belphegor primes

A Belphegor number is a number of the form $(10^{n+3}+666)*10^{n+1}+1$ (1{n zeroes}666{n zeroes}1) where $n$ is an non-negative integer. A Belphegor prime is a ...
293 views

Program ordinals and omega squared

A program ordinal is a (possibly transfinite) ordinal which can be assigned to programs in some language depending on their output. To be more specific: Strings that give no output have ordinal 0 ...
1k views

Cheat activated

Background The game Grand Theft Auto: San Andreas went down in history also thanks to its wide selection of cheats. They're almost 90 and anyone who has ever touched this game, no doubt has tried ...
3k views

Let's study Neil numbers

Congratulations to Neil for hitting 100k rep! As a tribute, we are going to study 'Neil numbers'. Neil's user ID is 17602 and there's something special about the binary representation of this number: ...
300 views

Sunset in every capital [closed]

This is a very simple challenge. Task Whenever your code is run, your code should output the next sunset date and time in GMT for all capital cities on Earth. You should get the list of capitals ...
3k views

Remove loops from a walk

I've been playing around with a robot on the coordinate plane. This robot is able to tell me if it goes left, right, up, or down by reporting back a string consisting of the letters ...
743 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 ...
1k views

Counting characters

Write a function or program that accepts one character (or a string of length 1) as input, and outputs the number of times that character occurs inside the code. This program must be a Proper Quine, ...
349 views

Golf Me A Text-Editor [closed]

Golf Me a Text Editor (similar challenges: Create a simple line editor and Line editor (more text here)) I seem to have forgotten which program to use to open, read, and write text files. Something ...
335 views

Produce the string “deno” from the string “node” [closed]

The string "node" must be hard-coded in plain ascii to obtain a string with the value "node", which must be transformed into the string "deno". You cannot include "deno", any other variations, any ...
2k views

Check if an array (or equivalent) has the same number of odd and even numbers - Code Golf Edition!

Inspired by this code review question, I am curious to see what happens if we turn that into a code-golf challenge! The description is easy, the input is an array or any similar data structure with ...
839 views

Stepping Through Time

Given a 24 hour time, e.g. 20:48, output the nearest time where each adjacent pair of digits has an absolute difference of 1, e.g. 21:01. That is, each number in the output must differ from the ...
1k views

You are the captain of a world-famous wrestling team. An Olympic-grade match is coming up, and you are determined not to let your team down. You also happen to be a competent programmer, so you are ...
2k views

Reverse factorial function

Given a number n, find x such that x! = n, where both x and n are positive integers. Assume the input n will always be the factorial of a positive integer, so something like n=23 will not be given as ...
121 views

Make paper snowflakes! [closed]

The task Given a folded and cut in places snowflake, "unwrap" it and output the result Input The base folded snowflake, without any cuts, looks like: ...
4k views

Write a microwave timer!

You are an employee of Microteque, a leading Silicon Valley startup creating smart microwave ovens for all kinds of strange places. Your customers can get their microwaves printed with patterns to ...
4k views

Maintain Social Distancing!

Task Given the situation with this global pandemic, you've been enlisted to help maintain social distancing. Your challenge, should you choose to accept it, is to write a program that takes in the ...
198 views

Is there a language that supports Turing machines?

Is there a programming language that supports single tape Turing machines specified in some format? I am aware multiple formats for expressing them exist, but is there a standard one using which an ...
184 views

Resource for generating shortest regex given a list of strings

I'm looking for a program such that, given a finite list of strings, can find the shortest regexes possible to match exactly all of them and nothing else. Since there are multiple languages that ...
192 views

List of programming languages that can run code at runtime [closed]

What all languages have a construct similar to python's eval, so you can write code during runtime and run it? A list would be helpful for certain programming ...
218 views

SELECT ALL FROM SelectQL WHERE (answer=“short” OR NOT length=10000)

I've invented an SQL-like language. Let's call it SelectQL. You can't INSERT anything, you can only SELECT, and I don't have the ...
1k views

Bilibili AV/BV Code Conversion

Background Bilibili is a China-based video sharing platform, similar to Nico Nico Douga in Japan, and Youtube around the world. Since the establishment, Bilibili had been using the AV code to ...
6k views

Build a Turing *incomplete* language

The world is full of Turing-complete programming languages. Just about every useful language (and most useless ones) are Turing-complete. Some even became Turing-complete by accident. Often this is ...
1k views

Omit needless spaces for me

A great Python golfing tip is to omit needless spaces. But if you are like me, you don't always have the time to search for which spaces to remove. If only there was a way to speed up the process... ...
3k views

Generate a “Poem”

Given a strictly positive integer, N, produce an output satisfying the following: Produce an array of length N. Every string (i.e. "word") in the array is of ...