instruction_seed stringlengths 34 53.1k | _source stringclasses 1
value |
|---|---|
if you have a range of numbers with values missing, eg l=[1,2,9,10,99], you can always use modulus and subtraction to make all the numbers in the list cover a smaller range, for example: l%99%6=[1,2,3,4,0]. your task is to take in a list of numbers and output an equation which will map them to unique numbers in the ran... | stackexchange_codegolf |
Challenge
Given an ASCII representation of a Babylonian number as input, output the number in Western Arabic numerals.
Babylonian Numeral System
How did the Babylonians count? Interestingly, they used a Base 60 system with an element of a Base 10 system. Let's first consider the unit column of the system:
The Babylonia... | stackexchange_codegolf |
The magic music box (MMB)
This explains the motivation for the challenge, feel free to ignore.
The magic music box is a word game played by a group of people, where one is the owner of the magic music box and the other people are trying to put words inside the magic music box.
Rules for the game with humans: the game g... | stackexchange_codegolf |
As you may know, in DNA there are four bases — adenine (A), cytosine (C), guanine (G) and thymine (T). Typically A bonds with T and C bonds with G, forming the "rungs" of the DNA double helix structure.
We define the complement of a base to be the base it bonds to — i.e. the complement of A is T, the complement of T is... | stackexchange_codegolf |
What general tips do you have for golfing in Grass? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Grass (e.g. "remove no-op characters" is not an answer).
Please post one tip per answer.
| stackexchange_codegolf |
As the title says, I was thinking to contest in which one must detect edges of an ASCII art.
The code should accept a B/W ASCII art as input.
A B/W ASCII art is defined as (by me) an ASCII art with only one kind of non-white-spaces character (in our case: an asteriks *). And as output produce a standard ASCII art (all... | stackexchange_codegolf |
There have of course been challenges to render ASCII art fonts here and there. This challenge doesn't add anything to those. In contrary, it subtracts from them for a good reason. If you allow all characters,
it's a lot of boring work
the task is mainly about clever compression of the font and short extraction
This o... | stackexchange_codegolf |
The Task
In this challenge, your task is to write some code which outputs one of its anagrams chosen randomly with uniform distribution but it should never output itself.
Elaboration
Given no input, your program should output any one of the anagrams of its source code. Your program should never output its own source a... | stackexchange_codegolf |
Does anyone have any suggestions as to how I could shorten this program?
_=map(ord,raw_input());_=[10if y==88else 0if y==45else 58-_[x-1]if y==47else y-48for x,y in enumerate(_)];t=0;exec('t+=sum(_[:2+(_[0]+_[1]>=10)]);_=_[2-(_[0]==10):];'*10);print t
Run it online
I'd like to write a bowling calculator. I'm fairly pr... | stackexchange_codegolf |
Given a list of positive integers, write code that finds the length of longest contiguous sub-list that is increasing (not strictly). That is the longest sublist such that each element is greater than or equal to the last.
For example if the input was:
\$[1,1,2,1,1,4,5,3,2,1,1]\$
The longest increasing sub-list would ... | stackexchange_codegolf |
Your task is to write the shortest algorithm in a language of your choosing that accomplishes the following:
Given two matrices it must return the euclidean distance matrix. The euclidean distance between two points in the same coordinate system can be described by the following equation:
\$D = \sqrt{ (x_2-x_1)^2 + (y_... | stackexchange_codegolf |
(massive thanks to El'endia Starman and Sp3000 for helping me design test cases for this!)
Given a positive integer n and a list of positive integer rotational periods for a number of clock hands (in seconds), output the smallest positive integer x where x seconds after starting the clock with all of the hands aligned,... | stackexchange_codegolf |
Code Golf Challenge
I have an isdue, my fingrrs are fat and I freqintly jave an isdue of ty[ing one keystrpke to the right on my kryboard.
I'm afraid the isdue is getyng worse anf worsr as time goes on.
Sopn every keystrpke I make wil; be shiftrd pne to the right!
Befpre then I'd like a program (or functipn) to autp sh... | stackexchange_codegolf |
You are a package handler for Big CompanyTM and your job is to load boxes into a truck. These are special, stretchy trucks: their length can be adjusted at will. But stretching trucks are expensive, so keep the truck lengths as short as possible!
The Challenge
Write a full program or function that, when given the truck... | stackexchange_codegolf |
Goal
Your task is to create a program taking no input that returns the link to your answer. You can find a link to your answer by clicking at the share button on your answer.
Rules
Standard loopholes apply except for searching for the answer online. In fact, you are expected to find the answer online.
You are allowed ... | stackexchange_codegolf |
Loves me, Loves me not
This simple kids' game is old, but still popular. Since we are living in 21st century now, let's digitize it!
Specification
Program must take no input, unless you are using a language that can't generate random seed - in that case you are allowed to take the seed as an input. Your task is to writ... | stackexchange_codegolf |
This challenge initially appeared in this challenge as a an extra brain teaser. I am posting it with permission from the original author so that we can have a formal competition.
Your task here will be to implement a function1 that forms a permutation on the positive integers. This means that each positive integer ... | stackexchange_codegolf |
Your task is to take \$n \ge 2\$ points in 3D space, represented as 3 floating point values, and output the Euclidean distance between the two closest points. For example
$$A = (0, 0, 0) \\ B = (1, 1, 1) \\ C = (4, 0, 2)$$
would output \$\sqrt3 = 1.7320508075688772...\$, the distance between \$A\$ and \$B\$.
The Euclid... | stackexchange_codegolf |
I enjoy participating in math competitions run by Mu Alpha Theta, a mathematics honor society in the United States. At competitions, I take a 30-question multiple choice test. There are five choices per question, labeled A through E.
My score on a test is four points for each correct answer, zero points for a question ... | stackexchange_codegolf |
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 V each have a sharpness of 1
N and Z each have a sharpness of 2
M and W each have a sharpness of 3
Dull letters
C and U each have a sharpness of -1
S has a sharpness of -2
O has a shar... | stackexchange_codegolf |
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 ordered like a real crossword puzzle.
The words are numbered in the row-major order of their first letters. If an "across" wor... | stackexchange_codegolf |
I remember people saying that code size should be measured in bytes, and not in characters, because it's possible to store information with weird Unicode characters, which have no visual meaning.
How bad can it be?
In this challenge, you should output the following Lorem Ipsum text, taken from Wikipedia:
Lorem ipsum do... | stackexchange_codegolf |
The Universal Crossword has a set of guidelines for crossword puzzle submissions.
In this challenge we are going to be concerned with their rules for hidden word themes. A hidden word clue consists of a clue and a word. It can either be a
"word break" or a "bookend".
For a word break the word must not appear as a cont... | stackexchange_codegolf |
Given two strings as input, return the result of XORing the code-points of one string against the code points of the other.
For each character in the first input string, take the code-point (e.g. for A, this is 65) and XOR the value against the corresponding index in the second string and output the character at the co... | stackexchange_codegolf |
Given a multi-line string as input containing characters "|", "_" and " " (space), count the number of cells it contains.
A cell is the following structure of 3 characters by 2 lines:
_
|_|
That is, an underscore on one line (the characters to its right and left don’t matter), and "|_|" right below it.
Two cells can ... | stackexchange_codegolf |
There have been a couple of challenges involving doubling source code: here and here. The task we have here is a bit harder, but should be doable in almost every language.
In this challenge, you will take in an arbitrary positive integer. Your program must output that integer doubled.
When your source code is doubled, ... | stackexchange_codegolf |
Your task is to fill the bucket with numbers upto a given input.
Rules
Numbers occupy the leftmost position then rightmost, then leftmost and so on.
After overflow, the numbers start to gather around the bucket in a similar manner. They occupy position diagonally.
The examples should make it clear what the expected out... | stackexchange_codegolf |
This challenge, if you accept it, is to write three functions or programs A, B, and C:
A is a quine that outputs all of A,B and C (which is also the whole content of the code in your submission).
B takes a parameter F and checks whether it is such a quine (outputting FBC), or doing something different.
C takes a param... | stackexchange_codegolf |
Challenge
I'm under attack by the larcenous Midnight Crew and I need to summon the Catenative Doomsday Dice Cascader in order to defend myself. Since I'm low on space, I need the code to be as short as possible.
The algorithm for the Catenative Doomsday Dice Cascader is as follows:
First, the six sided die in the Prime... | stackexchange_codegolf |
The cofactor matrix is the transpose of the Adjugate Matrix. The elements of this matrix are the cofactors of the original matrix.
The cofactor (i.e. the element of the cofactor matrix at row i and column j) is the determinant of the submatrix formed by deleting the ith row and jth column from the original matrix, mul... | stackexchange_codegolf |
Y'know, we've had a lot of "alphabet" challenges recently. (one two three four five.) While I love a good challenge, and those challenges were very fun, I think it's time for a change of pace. We need to exclude such challenges in the future. It's time for automation!
You're going to find some alphabets for me, and for... | stackexchange_codegolf |
Introduction
Brainstract, a newly created dialect of Brainfuck adds a bit more elements to the syntax. In addition to the normal Brainfuck syntax, there are macros. To define a macro:
{macro_name ++++}
Then use it:
{macro_name} Adds 4 to the current cell
Challenge
Your challenge is to take a valid Brainstract progra... | stackexchange_codegolf |
Let's get right in to it.
Your challenge is to make a program that does these things depending on its input:
If the input is a number, output "Prime" if the number is a prime number and "Not prime" if the number isn't a prime number. You can assume the number is > 1.
If the input is two numbers, output every single p... | stackexchange_codegolf |
In response to here.
Unlike the previous one, this focuses on code-golf and a new logo, no longer consisting of 6 sticks and the graying-effect as the position of the sticks go deeper.
Make the Stack Overflow logo using the following criteria:
The tray:
Make a gray tray shaped like a bracket facing upwards using th... | stackexchange_codegolf |
A number spiral is an infinite grid whose upper-left square has number 1. Here are the first five layers of the spiral:
Your task is to find out the number in row y and column x.
Example:
Input: 2 3
Out : 8
Input: 1 1
Out : 1
Input: 4 2
Out : 15
Note:
Any programming language is allowed.
This is a code-golf cha... | stackexchange_codegolf |
Given two sets of strings, \$ D \$ and \$ R \$, find the shortest string which contains every string in \$ D \$, but contains none of the strings in \$ R \$.
There are almost always multiple possible outputs; you should output at least one of them, but you can output more.
You can assume this is possible with the input... | stackexchange_codegolf |
Scramble a Megaminx!
A megaminx is a dodecahedral version of the familiar Rubik's cube. Since 2008, the World Cube Association uses Stefan Pochmann's megaminx scrambler. The scrambles look like this:
R-- D++ R++ D-- R++ D-- R++ D++ R-- D-- U'
R++ D-- R++ D-- R-- D++ R-- D-- R-- D-- U'
R++ D++ R-- D++ R++ D++ R++ D++ R-... | stackexchange_codegolf |
Given a sequence of bytes, output the SHA-256 hash value of the sequence.
The SHA-256 Algorithm
The following pseudocode is taken from the Wikipedia page for SHA-2.
Note 1: All variables are 32 bit unsigned integers and addition is calculated modulo 2^32
Note 2: For each round, there is one round constant k[i] and one ... | stackexchange_codegolf |
Inspired by this tweet where a user stated the following:
it's insane how much code would be cleaned up if JS got pipes and pattern matching
i often do this since it's the best way to make use of TS inference and pattern matching would make it less hacky
const result = (() => {
if (scenario1) {
return {
t... | stackexchange_codegolf |
It's obviously ellipsisessieses.
Inspired by a chat message.
Your challenge
Given a list or space or comma-separated string of words, ellipsisessiesesify them.
To ellipsisessieses-ify a word:
Start with the word.
Add the first letter of the original word to the end.
Add 2 of the last letter of the original word to the... | stackexchange_codegolf |
Background
A polyhex of size \$n\$ is a contiguous shape made from joining \$n\$ unit regular hexagons side-by-side. As an example, the following image (from Wikipedia) contains all 7 distinct tetrahexes (polyhexes of size 4):
A dihex is a polyhex of size 2.
Now, let's define a sticky polyhex as follows:
A single dih... | stackexchange_codegolf |
Challenge
Input two integers.
Integer I/O must be decimal.
If the integers are equal, output a truthy value.
Otherwise, output a falsy value.
Clarifications
You will never receive non-integer inputs.
You will never receive an input that is outside the bounds [-2³¹, 2³¹).
Rules
Standard loopholes are disallowed.... | stackexchange_codegolf |
Output this table:
-2*
-1*
-
0
-
1
2
-1*
0
1
-
2
3
4
1
2
3
-
4
5
6
3
4
-
5
-
6
7
5
6
-
7
-
8
9
6
7
8
-
9
10
11
8
9
10
-
11
12
13
10
11
-
12
-
13
14
You can output one string with two types of split, 1D string array with one type of split, or 2D string array
If your language support mix... | stackexchange_codegolf |
Let \$A\$ be a square matrix that is at least \$2 \times 2\$ where each element is an integer. \$A^2 = A \times A\$ will then have the same dimensions as \$A\$, and will have integer elements. For example, let
$$A = \left[ \begin{matrix}
-3 & 2 \\
0 & -1
\end{matrix} \right]$$
Therefore,
$$\begin{align}
A^2 & = \left... | stackexchange_codegolf |
Background
Network discovery tool Nmap takes a list of TCP/UDP port numbers as input and performs a security audit against the listed ports. The target port listing on the command line includes selected port numbers as strings separated by a comma. To make specifying big amounts of ports more convenient the tool also s... | stackexchange_codegolf |
Make a quine. Simple enough, except it has to be a palindrome and accept input.
Now, any side of a palindromic quine is one half of it. For example, one side of the hypothetical quine AAAA is AA. One side of AAAAA is AA (the center symbol is ignored).
Your job is to make a quine like this that accepts input. If the inp... | stackexchange_codegolf |
According to TIO there are two types of programming languages:
Practical (seen in many corporate environments as a development standard).
Recreational (if seen in a corporate environment, you're probably fired).
Your Task
Mix together one language from each of these realms to achieve the simple goal of calculating th... | stackexchange_codegolf |
Last week, we worked to create the shortest 1-D string using the top 10,000 words in the English language. Now, lets try the same challenge in 2D!
What you need to do is to take all of the above words, and put them in a rectangle as small as possible, allowing for overlaps. For example, if your words were ["ape","pen... | stackexchange_codegolf |
The computational parity of an integer is defined as 1 if the integer has an odd number of set bits, and 0 otherwise. (src).
Input
You will receive one nonnegative integer that you will take the parity of. Optionally, you may take the size of the integer in bytes or bits as an argument, but you must specify this in yo... | stackexchange_codegolf |
For functions \$f, g: \{0,1\}^n \rightarrow \{0,1\} \$, we say \$f \sim g\$ if there's a permutation of \$1,2,3,...,n\$ called \$i_1,i_2,i_3,...,i_n\$ so that \$f(x_1,x_2,x_3,...,x_n) = g(x_{i_1},x_{i_2},x_{i_3},...,x_{i_n})\$. Therefore, all such functions are divided in several sets such that, for any two functions \... | stackexchange_codegolf |
Write a mathematical statement, using the symbols:
There exists at least one non-negative integer (written as E, existential quantifier)
All non-negative integers(written as A, universal quantifier)
+ (addition)
* (multiplication)
= (equality)
>, < (comparison operators)
&(and), |(or), !(not)
(, ) (for grouping)
varia... | stackexchange_codegolf |
Introduction
A recursive acronym is an acronym that contains or refers to itself, for example:
Fish could be a recursive acronym for Fish is shiny hero, notice how that also contains the acronym itself. Another example is Hi -> Hi igloo. Or even ppcg paints -> ppcg paints cool galaxies pouring acid into night time star... | stackexchange_codegolf |
Write a program to convert Polish prefix notation to infix notation, then change it to an RPN-to-infix converter in the shortest number of chars.
Your score is 100 minus the number of characters changed, added and deleted.
Don't write one PPN and one RPN function, then do something like:
"I changed rpn(raw_input()) to... | stackexchange_codegolf |
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 target of radius 1.0 with k rectangle stickers. He then fires n shots that cannot hit the stickers.
What's special about Leo... | stackexchange_codegolf |
Inverse function of this challenge
To (properly) multiply an string by an integer, you split the string into characters, repeat each character a number of times equal to the integer, and then stick the characters back together. If the integer is negative, we use its absolute value in the first step, and then reverse t... | stackexchange_codegolf |
With the US election going on right now, I noticed that there is one (completely meaningless, but still) thing which Trump can still achieve and which is out of reach for Biden: Having the won states being connected.
Task: Given a list of strings of two-letter abbreviations (see below) for US states, determine whether ... | stackexchange_codegolf |
The Problem
A doomsday scenario is described by three numbers on a single line, n, m, and p. Following that line are n lines with m values per line. Each value represents the total units of water each cell can hold.
The following p lines describe the weather for the next p days. 1 unit of rain falls on a single cell ea... | stackexchange_codegolf |
Challenge
We take three positive integers a, b, and c as input. Using these integers, first create a sequence in the range [0, c] (inclusive on both ends), in steps of b. For example, for a=4, b=2, c=100, the sequence would be [0,2,4,...,96,98,100].
For every number in this sequence which is divisible by a, replace it ... | stackexchange_codegolf |
After you wake in a dark room, you see a rectangular grid of lights with corresponding switches. You decide to use a coordinate system with the bottom left light representing (1,1) and the coordinates increasing as you go up (y direction) and to the right (x direction). The grids are identical in that flipping the swi... | stackexchange_codegolf |
We've had problems to generate minesweeper games.
We've had problems to solve these minesweeper games.
Now...
It's time to battle other people on a minesweeper game!
Your program must be run in Java. Essentially, each player can do an action every turn.
You may move to any space touching yours including corners. The b... | stackexchange_codegolf |
Requirements
You need to make a smiley face go from smiling to frowning and back. There needs to the below faces in the code: Smiling, no expression, frowning, no expression, and then back to smiling. The new face needs to replace the old face flipbook style so that there's only one face on the screen at a time. There ... | stackexchange_codegolf |
Use any programming language to display "AWSALILAND" in such a way, so that each letter is in a new line and repeated as many times as its position in the English alphabet. For example letter, (A) should be displayed just once because it is the first letter of the alphabet. Letter D should be displayed 4 times because ... | stackexchange_codegolf |
look! It's an ASCII maze! Soo coolzors, amazeballs and stuff.
+-+-----+---+
| | | |
| | ++ | |
| | ++ +-+ |
| | |
+-------+ | |
| | |
+---------+-+
But, but, but... it's a pain to work out which direction all the parts of the maze are going. I just want to draw the layout and the maze make it... | stackexchange_codegolf |
Background
Boolean Algebra concerns representing values with letters and simplifying expressions. The following is a chart for the standard notation used:
Above is what actual boolean algebra looks like. For the purposes of this code golf, this is not the syntax that will be used.
Your Task
Given a string with three c... | stackexchange_codegolf |
Introduction
The telephone numbers or involution numbers are a sequence of integers that count the ways \$n\$ telephone lines can be connected to each other, where each line can be connected to at most one other line. These were first studied by Heinrich August Rothe in 1800, when he gave a recurrence equation where th... | stackexchange_codegolf |
Print the following text and nothing else:
<html>
<body>
<p>HTML is kinda annoying</p>
</body>
</html>
I'm happy I'm not a web developer.
The catch? Your code must fit the template: print(<?>), where ? can be any group of characters. You can paste your completed code (with the print(<>) part) into this Scast... | stackexchange_codegolf |
Curry is the Language of the Month this month and some users are starting to get into it, so let's get some tips together.
Haskell and Curry are similar in a lot of ways and a lot of tips for Haskell work well in Curry and vice versa. So I'd like in this question to gather tips for code-golf in Curry, that would be use... | stackexchange_codegolf |
Background
I have a ladder leaning on a wall, and a remote-controlled robot that can climb it.
I can send three different commands to the robot:
UP: the robot takes one step upwards. If it was on the highest step, it trips over, falls down and explodes.
DOWN: the robot takes one step downwards. If it was on the lowest... | stackexchange_codegolf |
This is the robbers' thread. For the main rules to this challenge see the cops' thread
In this challenge, robbers will choose a cop's vulnerable or safe post and try to figure out a pair of languages such that they print the correct results for the 4 programs.
When you find a solution post an answer of it here and lea... | stackexchange_codegolf |
Cops' Challenge
Robbers' challenge here.
It has now been four days since the challenge was posted so all new answers should be marked as non-competing in the title. These answers can still be cracked by robbers but will not go towards their total, and cannot win this challenge.
In this cops-and-robbers challenge, you... | stackexchange_codegolf |
There is a network of up to 26 nodes (named A to Z or a to z as per your wish). Every pair of nodes may be connected or disconnected. A node may be connected to at most 4 other nodes. Your task is to draw the network in a 2D diagram. Input will be given such that this task is possible (see more constraints in output se... | stackexchange_codegolf |
Introduction
In Tennis, the server alternates serving on the left side or the right side of the court every point, starting on the right. It is possible to figure out which side to serve on for that point just based on the score; if there have been an even number of points you serve on the right, and after an odd numbe... | stackexchange_codegolf |
Most of you have probably heard of the famous Turtle Graphics program, initially made popular by Logo. This challenge is to implement a Turtle Graphics program in your language of choice.
Rules:
The floor must be a diagonal with dimensions input by the user through std-in in the form x/y, representing the x and y len... | stackexchange_codegolf |
The brainiacs at New Scientist tweeted this morning that "The word STABLE has the neat property that you can cycle the first letter to the end to make a new word: TABLES. And you can do it again to make ABLEST." (https://twitter.com/newscientist/status/1379751396271124480)
This is of course correct. It is not, however,... | stackexchange_codegolf |
figlet is utility that converts plain text to an ascii-art representation for use in banners and the like. For example:
$ figlet "CODE GOLF"
____ ___ ____ _____ ____ ___ _ _____
/ ___/ _ \| _ \| ____| / ___|/ _ \| | | ___|
| | | | | | | | | _| | | _| | | | | | |_
| |__| |_| | |_| | |___ ... | stackexchange_codegolf |
As the title says, you are to create a pristine program in as many languages as possible. A pristine program, taken from here, is:
Let's define a pristine program as a program that does not have any errors itself but will error if you modify it by removing any contiguous substring of \$N\$ characters, where \$1 \le N ... | stackexchange_codegolf |
Related: Ellipse circumference
Introduction
An ellipsoid (Wikipedia / MathWorld) is a 3D object analogous to an ellipse on 2D. Its shape is defined by three principal semi-axes \$a,b,c\$:
$$ \frac{x^2}{a^2} + \frac{y^2}{b^2} + \frac{z^2}{c^2} = 1 $$
Just like an ellipse, the volume of an ellipsoid is easy, but its surf... | stackexchange_codegolf |
Following on from the third order quine challenge, your task is to write an Ouroboros program that uses as many languages as possible.
That is, in language A, write a program pA which outputs program pB in language B. Program pB should output program pC in language C, and so on until eventually a program outputs the or... | stackexchange_codegolf |
This is the robbers' challenge. The cops' one is here.
In Fewest (distinct) characters for Turing Completeness, the goal is to find the minimum number of characters which make a language Turing Complete...in other words, allow it to do any computation possible with any other language. In this challenge, we'll be doing ... | stackexchange_codegolf |
Stock Time Machine
You've gained access to a dataset, tomorrowStocks, which contains the stock prices from your favorite business on the NASDAQ. This dataset is a container indexed by minutes past opening. Each index contains the price of the stock at that time.
// Assume the stock market opens at 9:30AM EDT
// tomorro... | stackexchange_codegolf |
Definition
A square-free semiprime is a natural number that is the product of two distinct prime numbers.
The task
Given a natural number n, count all square-free semiprimes less than or equal to n.
Details
Please write a function or procedure that accepts a single integer parameter and counts all square-free semipri... | stackexchange_codegolf |
Challenge
This coding challenge is to figure out how many rounds the cat can live.
In a \$4\times4\$ matrix, there are a number of mice and exactly 1 cat.
Example:
$$
\begin{array}
{|r|r|}\hline
& & & ⬜ \\
\hline
⬜ & & ⬜ & ⬜ \\
\hline
⬜ & ⬜ & ⬜ & \\
\hline
& & & \\
\hline
\end{array}
$$
But in each square of t... | stackexchange_codegolf |
Background
You awake to find yourself lost in a one dimensional labyrinth! A mystical genie (or something) appears and explains that the exit lies in front of you, but that between you and the exit is a series of challenges. As you wander forward you realize that all of the so-called challenges are merely locked doors.... | stackexchange_codegolf |
This is a cops-and-robbers challenge based around defining languages and proving they are Turing complete.
This is the robbers' thread. The cops' thread is here.
Robbers
The cops will post definitions of Turing-complete languages. Your task is to crack them by proving that they are indeed Turing complete. See the cops'... | stackexchange_codegolf |
Introduction:
In Dutch, the words leading and suffering, being 'leiden' and 'lijden' respectively, are pronounced the same way. One is written with a "short ei", and one with a "long ij", as we Dutchman would say, but both 'ei' and 'ij' are pronounced [ɛi].
Challenge:
Given a list of numbers, determine which (if any) a... | stackexchange_codegolf |
How can we depict a turned shape simply and nicely using ascii characters in 3D space?
I suggest this method :
Instead of a circle we use a square rotated by 45° for the cutting section so that we only need '/' and '\' characters to draw it.
/\
/ \
\ /
\/
And we use '_' character for the profiles: upper, lower ... | stackexchange_codegolf |
Implement a program or function which simulates common dice for role playing games. It should handle at least the d6 and d20, the two most common dice.
However, it should work as stereotypical gamers expect them to work, and not as real dice work.
It is an in-joke between gamers, that one can have a specially lucky die... | stackexchange_codegolf |
You will be given as input a non-empty list of positive integers. For example:
[1,2,2,2,1]
You want to produce a ragged list as output which has this as its "depth map". This list should have the same elements in the same order but each element n should be at the depth equal to its value.
[1,[2,2,2],1]
This is a li... | stackexchange_codegolf |
Cops' Thread
Your challenge is to find an uncracked, unsafe cop on the cops thread, and find an input value for which their code does not do as specified by the challenge.
You must use values within the bounds specified by the cop and the challenge - if a float breaks their program but they specified integers only, it... | stackexchange_codegolf |
Part 1 of the task is here
Flags Mashup Bot is a small Twitter bot that generates a new country name based on two random country names and tweets the result every couple of minutes.
Task
Your task is to replicate what the bot does by writing a script or a function based on the following criteria:
The input is two cou... | stackexchange_codegolf |
Very recently, I changed my SE username because I made this account some years ago and wanted to get back into asking questions. However, I’m still planning to post questions and potentially earn votes. We can imagine a site that has some issues dealing with name changes. The problem: given a list of names, reputation ... | stackexchange_codegolf |
Some sleep commands implement a delay of an integer number of seconds. However, 2³² seconds is only about 100 years. Bug! What if you need a larger delay?
Make a program or a function which waits for 1000 years, with an error of less than ±10%. Because it's too time-consuming to test, please explain how/why your soluti... | stackexchange_codegolf |
Given two points A and B, find the angle from line AO to line BO about point O where O is the origin ((0,0)). Additionally, the angle may be positive or negative depending on the positions of the points (see examples). Input will be points A and B, and may be given in any convenient form. Output will be the angle in de... | stackexchange_codegolf |
The quaint hamlet of Кодгольф in the Russian far east has a problem: their population is low (below 66), and no new people have arrived for years. Moreover, after centuries of near-isolation, just about everybody is related to each other.
Mayor Стекобмен has a solution that should keep the morale high: organise a weddi... | stackexchange_codegolf |
A listening party is an event where a bunch of people get together to listen to some music (like a viewing party, but for music). In the age of the internet you can do Listening Parties online with friends, where you just all hit play together.
The problem is on the internet everyone is in different time-zones so you ... | stackexchange_codegolf |
The program will be provided as the first argument, stdin should be used for all
read requests by the program and stdout for all write requests. It can be
assumed that the program is less than 80 characters wide and less than 25 lines
high.
~ should push -1 if there is nothing to read.
Any pop off the bottom of the l... | stackexchange_codegolf |
Disclaimer: This challenge is extremely scientifically inaccurate.
;)
Given an input of a list of molecules, output what the result would be if they
were to all combine via dehydration synthesis, if possible.
For the purposes of this challenge, although this description is inaccurate, a
dehydration reaction
between two... | stackexchange_codegolf |
Introduction:
I think we've all heard of it, but here a very brief summary: Noah gathered two of every species of animal on the planet, male and female, to save in his Ark during a great flood. The actual quote from the Bible is:
Genesis 7:2-3
You must take with you seven of every kind of clean animal, the male and it... | stackexchange_codegolf |
Introduction
Arrays are usually used with for-loops or iterators. One different task might be the use as a cheap way to rotate through a set of items, so after reaching the last index, the next item would be the first item of the array. This is useful for cases like menus and physical controls.
Challenge
Given the size... | stackexchange_codegolf |
This rar file, when decompressed, gives a 65024-byte exe file. Requiring you to output the contents of that file would be absolutely no fun.
But you aren't required to do that. Actually, you're to do something opposite: Output a binary of the same length (65024 bytes), such that no byte equals the byte at same position... | stackexchange_codegolf |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.