All Questions

Filter by
Sorted by
Tagged with
3
votes
0answers
123 views

Chinese checkers adjacent squares [closed]

Challenge You have a Chinese Checkers board looking like this: ...
43
votes
17answers
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 ...
12
votes
5answers
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 ...
2
votes
3answers
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 ...
14
votes
29answers
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 ...
21
votes
6answers
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: ...
26
votes
29answers
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 ...
17
votes
11answers
2k views

The Double-Castle Numbers™

Introduction A double-castle number™ is a positive integer number that has a pattern of $$\underbrace{a\cdots a}_{m\text{ }a\text{s}}b\underbrace{a\cdots a}_{m\text{ }a\text{s}}b\underbrace{a\...
5
votes
3answers
587 views

Solve the Rook's Round Trip

The riddle In yesterday's newspaper, I found a puzzle in which a Rook should start in the lower-left corner of a 12x12 checkerboard and then, during a round trip, visit each field exactly once except ...
15
votes
5answers
857 views

Solve a separable differential equation

A first order separable ordinary differential equation is (arguably) the easiest type of differential equation to solve, and takes the form of $$N(y)\frac{dy}{dx} = M(x) \\ y(x_0) = y_0$$ For two ...
1
vote
0answers
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 ...
16
votes
12answers
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 ...
25
votes
11answers
3k views

Make true and false global!

We all know true and false, but what do speakers around the globe say? ...
26
votes
11answers
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 ...
42
votes
5answers
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 ...
15
votes
20answers
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 ...
17
votes
15answers
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 ...
-2
votes
2answers
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'...
1
vote
2answers
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 ...
15
votes
12answers
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, ...
23
votes
20answers
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 ...
40
votes
18answers
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 ...
20
votes
19answers
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\$, ...
12
votes
10answers
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 ...
6
votes
3answers
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 ...
11
votes
10answers
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 ...
38
votes
22answers
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: ...
0
votes
1answer
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 ...
23
votes
17answers
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 ...
14
votes
6answers
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 ...
14
votes
21answers
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, ...
1
vote
2answers
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 ...
-4
votes
11answers
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 ...
17
votes
50answers
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 ...
12
votes
10answers
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 ...
11
votes
12answers
1k views

Lead your team to win the wrestlers world championship!

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 ...
17
votes
33answers
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 ...
3
votes
0answers
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: ...
23
votes
45answers
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 ...
35
votes
14answers
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 ...
1
vote
1answer
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 ...
6
votes
0answers
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 ...
0
votes
1answer
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 ...
4
votes
0answers
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 ...
24
votes
9answers
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 ...
41
votes
7answers
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 ...
16
votes
8answers
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... ...
18
votes
20answers
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 ...
5
votes
3answers
228 views

Can I trade today?

Back in 2018, there has been introduced new law in Poland to ban trading on sundays, but certain exceptions have been made (listed below). The task today is to determine, can one trade on the sunday ...
7
votes
9answers
462 views

Convert a string to sentence case

Input: A string (or the closest thing to that in your language) Output: The same string but converted to sentence case Rules: For this challenge, sentence case can be considered "...

15 30 50 per page