instruction stringlengths 34 53.1k |
|---|
In this challenge, you will create the shortest graphical program that displays exactly "Hello, world!"
You will need no input.
You might be asking yourself, "what does he mean by graphical?" Well, by graphical, I mean not writing to stdout. For example, look at my ES6 answer, which makes an alert box pop up rather tha... |
Related: Deck Names Friends or Foes Paying for Spells
The Magic: the Gathering card game has five colours of magical mana: white (W), blue (U), black (B), red (R), and green (G). Cards can be any of the \$2^5=32\$ subsets of these colours. Hereafter 'colours' refer just to the initials W, U, B, R, G.
The order that the... |
Given a multidimensional array, find the recursive alternating sum. An alternating sum is simply the sum of an array, where every other item (starting with the second) is negated. For example, the alternating sum of [7, 1, 6, -4, -2] is the sum of [7, -1, 6, 4, -2], or 14. In this challenge, you'll take the alternating... |
Here's an advanced version of the Count the Liberties challenge.
The definitions of the terms liberty and group are the same as the previous challenge, so have a look at the previous one for details, but briefly put,
A group is a group of stones that are connected horizontally or vertically.
Liberty is the number of e... |
King of the Cards
Code available here!
In this King of the Hill challenge, you must write a bot that can play Crazy Eights. This is a card game often played by children, in which the objective is to empty your hand.
How to Play
The game of Crazy Eights is deceptively simple. At the beginning of the game, each player ge... |
Design a function or program that, when run normally, outputs the triangular numbers. However, when any single character is deleted, the program/function should not function in the original programming language, but instead produce the triangular numbers in one other programming language.
Scoring
Your score will be the... |
Draw an "apartment" building according to the specifications below.
Basic Rules
Take, as input, the number of floors of the building.
Return a building with that many floors meeting the following specifications:
The building will be eight characters wide, with eight underscore characters (_) on top and eight dashes (-)... |
Definition of long text
Long text usually shows emphasis, for instance, loooooool or yaaaaaaaaaay. Usually the vowel is replicated many times. In this challenge we require:
At least 3 times, which means yaaay and yaaaay are allowed, but yay and yaay are not.
Consistent, which means that shoes can turn out be shoooeee... |
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 somewhat of the opposite, and finding the minimum numbe... |
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 ... |
The Zany Car Game is a tile matching game. You are given a number of tiles, with coloured cars split into a top and bottom half. To win the game, you need to find a square arrangement of the tiles so that only whole, correctly coloured cars are formed at each tile join , like the image below.
Challenge
Given a square ... |
For any ragged list its dimensions will be a list of non-negative integers defined as follows:
Elements that are not a list will have dimensions \$\textbf{[}\,\,\textbf{]}\$.
An empty list has dimensions \$[0]\$.
An \$n\$ dimensional list \$L\$ of length \$x\$ has dimensions \$x : k\$ where \$k\$ is the element wise m... |
Introduction
If \$\newcommand{\fib}{\operatorname{fib}}\fib(x)\$ calculates the \$x\$th Fibonacci number, write a program that calculates \$\fib(\fib(m))\$ for any integer value of \$m \ge 0\$. (Of course, there will be practical limits based on the language, so lesser limits are acceptable. Also, it's okay to stop at ... |
Given two positive integer fractions \$x\$ and \$y\$ such that \$x < y\$, give the fraction \$z\$ with the smallest positive integer denominator such that it is between \$x\$ and \$y\$.
For example \$x=2/5\$, \$y=4/5\$, the answer is \$1/2\$. Other fractions such as \$3/5\$ are also in between the two, but \$1/2\$ has... |
This is the reverse of this challenge.
Given an encoded list of codepoints and the characters used to encode it, you need to decompress it to its original string.
For example, given the encoded list [170, 76, 19, 195, 32] and the encoder characters " abcdefghijklmnopqrstuvwxyz", the output should be "the fox".
How, tho... |
Introduction
In chess, Knights can move two squares in one direction, and then one square in an orthogonal direction. On an x/y plane, these can be thought of as being a relative change of coordinates, such as (+1, -2).
Challenge
Your task is to output all 8 possible moves as pairs of relative x/y coordinates, in any o... |
A run ascending list is a list such that runs of consecutive equal elements are strictly increasing in length. For example [1,1,2,2,1,1,1] can be split into three runs [[1,1],[2,2],[1,1,1]] with lengths [2,2,3], since two runs are the same length this is not a run ascending list. Similarly [2,2,1,3,3,3] is not run as... |
Inspired by the recent 3Blue1Brown video
Consider, for some positive integer \$n\$, the set \$\{1, 2, ..., n\}\$ and its subsets. For example, for \$n = 3\$, we have
$$\emptyset, \{1\}, \{2\}, \{3\}, \{1,2\}, \{1,3\}, \{2,3\}, \{1,2,3\}$$
If we take the sum of these subsets, we can then ask ourselves the following ques... |
This challenge is about implementing Shm-reduplication, originating in Yiddish, where one takes a word, duplicates it, and replaces the first syllable in the second word with "Shm" in order to indicate that one does not care. Some examples include:
"Isn't the baby cute?", "Eh, baby shmaby"
"Come buy from my store, we ... |
Characters in strings are sometimes represented as their ASCII hexadecimal codes. Printable characters have two hex digits in their representation. Swapping those digits leads to another character, which will be our output.
The table of relevant character codes can be found on Wikipedia.
Details
Take a string as input... |
The sequence of Fibonacci numbers is defined as follows:
\$
F_0 = 0 \\
F_1 = 1 \\
F_n = F_{n-1} + F_{n-2}
\$
Given a Fibonacci number, return the previous Fibonacci number in the sequence. You do not need to handle the inputs \$ 0 \$ or \$ 1 \$, nor any non-Fibonacci numbers.
Errors as a result of floating point inaccu... |
We can arrange the positive integers like this:
1_| 2 | 5 | 10
4___3_| 6 | 11
9___8___7_| 12
16 15 14 13
That is, in L-shaped brackets expanding down and right infinitely.
Then, we can read it off with the antidiagonals:
1 2 5 10
/ / /
4 3 6 11
/ / /
9 8 7 12
/ / /
16 15 14 13
For the above, we rea... |
In this question I asked you to determine if a run ascending list could be made. It was code-golf so naturally most the answers are very slow. But what if we want it to be fast. In this challenge I ask you to solve the same task except your goal will be to minimize asymptotic time complexity.
Here's the challenge re... |
You are given 100 arrays/sets of 5-8 numbers between 1-20. If you combine all the arrays you will always get at least one of each number (1-20), so don't worry about an "unsolvable" case. The goal is to find the combination of arrays that minimizes duplicate numbers while still getting one of each number from 1-20.
Her... |
PROBLEM
For a list of numbers, list: Find the lowest possible integer, x, which is optimally close to the whole number even-harmonics of the values in list.
list has a length of n, and all of the values in list are <= 2000
x has a precision of 1.0 (integers only), and must be a value in the range [20, 100]
An even-har... |
Uilta is a minority tungusic language spoken in the far east of Russia.
A neat thing about Uilta is that it has pitch accent which can be predicted by a computer program. In this challenge we are going to take Uilta a word and determine where the accent peak is.
Let me explain how this can be done.
Phonemes
The first ... |
Whyte Notation is a classification method mainly for steam locomotive, that classifies by wheel arrangement. On a steam locomotive ( we're only focusing on non articulated locomotives here ), the wheels are generally disposed like this : you have a specific number of leading wheels, then a specific number of driver whe... |
Given a positive integer n, randomly output n non negative integers that sum to one hundred. n will be at most 200. The output should be present as a list of integers (not sorted).
Your random sample should be uniformly sampled from all lists of n non negative integers that sum to one hundred.
Your code should run in a... |
Intro
Imagine a list of elements and their outcomes when some non-commutative function is applied to them. For example, we will use the elements Rock, Paper, and Scissors, the outcomes Win, Lose, and Tie, and an operator * such that X*Y = what would happen if you played X against Y
As a list, you might write it this wa... |
Inspired/mostly copied but I don't think it's a dupe. Also Inspired.
In this challenge, you will create polyglots that include all languages from previous answers, and another language which you won't share and others must guess.
The first language prints 1, the second prints 2, etcetera.
For example, if the first answ... |
The Narrative
You are a bad musician. You never bothered to learn how to count rhythms. To remedy this shortcoming, you decide to write a program that will tell you how to count in any given time signature. You are still a bad musician, but you can at least pretend that you can count rhythms.
The Objective
Given a time... |
This challenge requires integration with C, so you can stop reading if you're not interested.
Matrix multiplication is a simple operation, but the performance depends a lot on how efficiently the code is written.
Let's compute m = x * y. The following code is the implementation of the textbook algorithm.
for (int i = 0... |
The "standard" polyhedral game dice have 4, 6, 8, 10, 12 and 20 sides. (Yes, I know that there are two 10-sided dice which together make a d100, but we're ignoring that right now.)
If I want to generate a random number between 1 and \$n\$ where \$n\$ is not one of those sides, I have a couple of options.
One option is ... |
Your challenge, should you choose to accept it, is to take as input:
A program in DirectionLang (as an ASCII string consisting of DirectionLang instructions)
A list of pairs of integers, henceforth known as the pretty places. This list may be taken in any reasonable format.
You should then output a truthy value if th... |
Given a word, decide if it is an ambigram.
When rotated:
b > q
d > p
l > l
n > u
o > o
p > d
q > b
s > s
u > n
x > x
z > z
Assume only lowercase letters as input.
Test input:
this,
another,
lll,
lol,
dad,
dab,
dap,
wow,
ooi,
lollpopdodllol,
Ones That Should Return Truthy Values:
lll,
lol,
lollpopdodllol,
Note tha... |
Problem
Assume you have a single 7-segment display without a decimal point, so 7 "lines" that can be labelled A through G as seen here.
This display will only show the numbers from 0 to 9 as usual, like so:
Any time this display changes from one number to another, some of its lights will have to change their state fr... |
Take as input an integer in any reasonable format.
Then, output all the proper sub-strings of the base-10 digits of that integer that are powers of two, in any reasonable format.
Test cases
10230 -> [1, 2]
13248 -> [32, 1, 2, 4, 8]
333 -> []
331 -> [1]
32 -> [2] # As 32 is not a proper sub-string, since it is the whole... |
J-uby is the Language of the Month for June 2022, so I'm looking for tips for golfing in it. As usual, please post one tip per answer, and avoid general tips such as "remove whitespace" or "avoid comments".
|
An alternating permutation is a permutation of the first \$ n \$ integers \$ \{ 1 ... n \} \$, such that adjacent pairs of values in the permutation alternate between increasing and decreasing (or vice versa).
Equivalently, it is a permutation where there are no "runs" of continuously increasing or decreasing values wi... |
Introduction
Time is a really simple concept. Seconds pass, one after the other, all the same. But humans love making it hard. This Stackoverflow question has gathered many answers and even though they are surprisingly long and complex, most of them will still fail for certain inputs. Can you format a number of seconds... |
Challenge
In this challenge, you have to fill an \$M\$ x \$N\$ rectangle grid with the most \$A\$ x \$B\$ rectangle pieces possible.
Requirements:
The sizes of the \$M\$ x \$N\$ rectangle grid is always bigger than the sizes of the \$A\$ x \$B\$ rectangle pieces. In other words, \$min(M, N) ≥ max(A, B)\$
You can freel... |
Robber's challenge
This cops-and-robbers challenge challenges the Cop to write a non-empty program that, when run, produces some non-empty output in language A, and, when reversed, produces some non-empty output in language B. The program may produce any output to STDERR when run in either language, but may not take in... |
Cops' challenge
This cops-and-robbers challenge challenges the Cop to write a non-empty program that, when run, produces some non-empty output in language A, and, when reversed, produces some non-empty output in language B. The program may produce any output to STDERR when run in either language, but may not take input... |
For this challenge a "binary tree" is a rooted tree where each node has 0 children (leaf) or 2. The children of a node are unordered, meaning that while you might draw the tree with left and right children there isn't a distinction between them and mirroring the tree or a sub-tree does not produce a new tree.
In this... |
aka. implement an easier version of 05ab1e's canvas element.
Description
The canvas element is used to draw ASCII lines on the screen.
The (easier version of the) canvas element takes a list of integers and returns a multi-line string (or a list of strings).
The integers map to the following directions:
7 0 1
↖ ↑... |
Lists can contain lists and we have nested lists. But we don't like nested lists and want to flatten them. By flattening I mean create a list which does not contain any list, but elements of lists it contained before. I'll explain it more.
Input
An arbitrary size list which has the below properties:
it can contain int... |
Given an integer \$N\$ consider a permutation \$p=p_1,p_2,p_3,\ldots\$ of \$1,\ldots,N-1\$. Let \$P = p_1 , p_1+p_2 \bmod N, p_1+p_2+p_3 \bmod N, \ldots\$ be its prefix sums modulo \$N\$. Sometimes \$P\$ will be a permutation of \$1,\ldots,N-1\$ itself.
For example, \$N=4: p=3,2,1 \rightarrow P=3,1,2\$
Negative example... |
The Mongolian language has "vowel harmony". In short the vowel harmony means that certain vowels are not allowed to be placed next to each other in a word. This means that suffixes of words have to care about the vowels present in the words they attach to and need to resolve to a vowel that matches the harmony of the... |
Related, but not dupe.
Challenge
A list of integers \$a_1, a_2, a_3, \dots, a_n\$ (\$ n ≥ 1 \$) is Fibonacci-like if \$a_i = a_{i-1} + a_{i-2}\$ for every \$i > 2\$. Note that every list that contains only 1 or 2 integers is Fibonacci-like.
For example, \$[1]\$, \$[6, 9]\$, \$[6, -4, 2, -2, 0, -2, -2, -4, -6, -10]\$, ... |
Given a list of positive integers such as [69, 420], your challenge is to generate the sequence of numbers that can be formed by concatenating numbers from the above set, in ascending numerical order.
For example, with [69, 420] the sequence begins:
69
420
6969
42069
69420
420420
Note that elements of the sequence sho... |
I have a set of colored plastic cups. They come in four colors: green, yellow, pink, and blue. When I put them on my shelf, I like to stack them in a certain pattern. Your job is, given a list of any number of four distinct values (to represent the four cup colors), output a visual representation of how I would stack t... |
Write a program or function which takes a string of text as input and outputs the number of non-alphabetical characters in it (standard I/O rules apply). A non-alphabetical character is any character not appearing in this string:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
In terms of ASCII character codes, t... |
Today, you're going to be writing Polish. No, not Polish notation—Polish, the actual language spoken in Poland.
Given a number and a noun, output a Polish sentence telling me that there are that many of that thing, using the appropriate template below.
The input consists of an integer in the range from 0 to 200, and a ... |
Parenthetical names
Your challenge is to build a program that puts parentheses around the 'title' part of names. For example, Sonic the Hedgehog is converted to Sonic (the Hedgehog).
Rules:
Around every the that passes the following rules, an opening parentheses will be added before the the and a corresponding closing... |
Given a non-negative integer n, print the result of P(P(...P({}))), where the number of P's is n (P is the power set function).
0 => {}
1 => P({})
2 => P(P({}))
3 => P(P(P({})))
n => P(f(n-1))
input result
0 {}
1 {{}}
2 {{},{{}}}
3 {{},{{}},{{{}}},{{},{{}}}}
...
The result should only contai... |
This is a cross-post of a problem I posted to anarchy golf: http://golf.shinh.org/p.rb?tails
Given two integers \$ n \$ and \$ k \$ \$ (0 \le k \le n) \$, count the number of combinations of \$ n \$ coin tosses with at least \$ k \$ tails in a row.
For example, if \$ n = 3 \$ and \$ k = 2 \$, the answer is \$ 3 \$:
HHH... |
In this king-of-the-hill challenge, you will program a bot, consisting of a python function of the form
def BOTNAME(info, me, round):
pass # ... main body
Specifically, the function must run in python3.9. Each bot will be entered into the contest 10 times.
The arguments it take in are info, me, round. The three ar... |
Let \$Z\$ be either the integers, the positive integers, or the non-zero integers; pick whatever's convenient. Give two functions \$f\$ and \$g\$, each \$Z \to Z\$, such that:
\$f(g(a)) = g(f(a))\$, for infinitely many integers \$a\$, and
\$f(g(b)) \ne g(f(b))\$, for infinitely many integers \$b\$.
Rules
Many of the ... |
Given a multi-dimensional rectangular array of non-negative integers, pad it with the minimal number of zeroes so that only zeroes are "touching the edges" of the array, in every dimension.
The output must remain rectangular, have the same number of dimensions as the input, and be no smaller than the input.
Example
For... |
In this challenge you will be simulating a frog jumping from lily-pad to lily-pad in a pond. A frog's jump distance is uniquely determined by the size of the lily pad it jumps from. So for example there are lily-pads that let a frog jump 1 unit, lily-pads that let a frog jump 2 units etc. A frog can never jump more ... |
Introduction
A circle-tangent polynomial is a polynomial of degree \$N\ge3\$ or above that is tangent to the unit circle from inside at all of its N-1 intersection points. The two tails that exits the circle are considered tangent at their intersection points from inside as well. You may consider such polynomials are w... |
Say I have a ragged list, like:
[
[1, 2],
[3,
[4, 5]
]
]
And I want to iterate over each item and delete it one-by-one. However, I don't know the structure of the list.
So, I have to iterate over the list, with the following algorithm:
Look at the first item of the list.
If it's a list, concatenate it to t... |
Plot contrivance
You wake up to find that something has gone horribly wrong! Your time machine has malfunctioned and you are lost sometime between June 2022 and October 1991.
You check the computer that you keep on the desk to see what time it is, but alas the positron interference from your quantum undetangler has fr... |
This is my 12th question, so I thought of this idea.
Goal:
Output 12, with any preceding or trailing whitespace permitted
In as many languages as possible (where different versions or flags count as the same language)
Without using any numbers
The criteria for a valid programming language are the same as those of The ... |
Let us consider the following representation of the periodic table.
__________________________________________________________________________
| | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|--------------------------------------------------------------------------|
|1| 1... |
Given a string like [[[],[[]]],[]], made of only commas and square brackets, your challenge is to determine whether it represents a list.
A list is either:
[], the empty list
At least one list, joined with commas and wrapped in square brackets.
You may use any three characters instead of [,].
You may output as:
Any ... |
In set theory, a set is an unordered group of unique elements. A pure set is either the empty set \$\{\}\$ or a set containing only pure sets, like \$\{\{\},\{\{\}\}\}\$.
Your challenge is to write a program that enumerates all pure sets, in some order of your choice. Standard sequence rules apply - you may:
Output al... |
Unsurprisingly, fibonacci primes are primes that are also Fibonacci numbers. There are currently 34 known Fibonacci primes and an additional 15 probable Fibonacci primes. For the purpose of this challenge, the Fibonacci numbers are the sequence \$F_n\$ defined as \$F_1 = 1\$, \$F_2 = 1\$, and \$F_n = F_{n-1} + F_{n-2}\... |
A binary max heap is a rooted tree with integer labeled nodes such that:
No node has more than 2 children.
The label of every node is greater than all of its children.
We say a sequence of integers is heapable if there exists a binary max heap, whose labels are the sequence's elements, such that if \$p\$ is the paren... |
Inspired by wezl.
Your challenge is to take words (sequences of [a-zA-Z]) and truncate them to length 3. For example, never gonna give you up would become nev gon giv you up.
Words will not necessarly be delimited by spaces - for example, youtube.com/watch?v=dQw4w9WgXcQ will become you.com/wat?v=dQw4w9WgX. Input will b... |
Given a multidimensional, rectangular array and a list of dimensions, such as:
[ [1, 2],
[3, 4] ]
[3, 4]
Your challenge is to extend the matrix to the dimensions given in the list.
To extend an array to a length in a single direction, simply repeat its elements; for example, if we want to extend [1, 2, 3] to length... |
To increase data safety at our company, we are planning to start using Gray code numbers (where successive values differ by only one bit) instead of classical binary ones.
Please help us to make a program that converts numbers to Gray code (single number to single number), but the program needs to be safe as well. This... |
Background
In the online graphing calculator Desmos, there is a certain shape that appears in the lower left portion of the graph in many high detail graphs, which the Desmos community has dubbed "Bernard". You can see an example of it in this graph and an isolated version of it in this graph. This shape is a consequen... |
There are a bunch of different casing conventions, like camelCase, PascalCase, snake_case etc. It's annoying juggling all of these, so instead of choosing one like a sensible person, why not cursedly mix all of them together?
Your challenge is to, given a list of words (only containing lowercase letters), convert them ... |
I have recently been on a quest to create really really slow sorting algorithms that make Bogosort seem like it is the best.
The task is simple: Sort an array of integers in as long average time as possible, with the average Bachmann–Landau notation begin as high as possible, while keeping the best case performance fas... |
Given \$a\$ and \$b\$, both odd \$n+1\$-bit integers, compute \$a/b\$ to a precision of \$n+1\$ bits in the 2-adic integers. That is, compute \$c\$ such that \$a = bc\, (\mathop{\rm mod} 2^{n+1})\$. \$n\$ should be your language's native integer size, or if native integers are bigints, take it as a parameter. If your l... |
This is a simpler variant of my previous challenge Don't touch the walls!, as suggested by Jonah.
Given a multi-dimensional rectangular array of integers between 0 and 9, output all the elements which are "touching the edges".
Output is very flexible: it can be in any order, and may be flattened or partially nested, bu... |
Given a decimal integer n as input, output the smallest (in terms of absolute value) decimal integer m such that the absolute value of n-m is a binary integer (composed only of 1s and 0s).
n and m can be any integer, positive or negative.
Example
Let n = 702. The closest binary integer is 1000 = |702 - (-298)|, so m = ... |
In this challenge you will receive a list of non-negative integers. Each one represents a mushroom with a cap of that radius centered at that location. So a 0 means that it occupies no space at all, a 1 means that its cap only occupies space above it, a 2 means it occupies space above it and one unit to the left and ... |
For this challenge, we will define the "complement" of a list of integers A as being any list B such that the union of A and B is a list of consecutive integers with no repeats.
In other words, B is the complement of A if
B has all of the integers between the minimum and maximum of A which are missing from A, and
B ha... |
Related.
Given a list of 3 or more positive integers, remove every number X for which there is another number Y in the list and the average of X and Y is also in the list. In other words, if X, Y, and the average of X and Y are all in the input, neither X nor Y should appear in the output.
Note: Pairs of numbers are no... |
So I have the situation where I have one boolean value a and, if that one is true and b<c I want it to end up as true, if a is false and b>c I want it to resolve as true as well. If b=c I want it to be always false, no matter the value b and c are both numbers. My best approach so far is a?b<c:b>c or maybe b^c^a^b<c. I... |
In this challenge you will receive a list of pairs of non-negative integers representing a mushroom forest. Each pair represents a mushroom whose center is at that horizontal coordinate. The only part of the mushroom we care about is the cap (the flat bit at the top).
The first integer in each pair represents which ro... |
Say I have a grid with some obstacles:
----
| X |
| |
|XX |
| |
----
I can fill this with numbers, as distance from the top left corner. But, because there are obstacles in the way some cells will take further to reach than a straight line:
----
|01X5|
|1234|
|XX45|
|7656|
----
This can be done through f... |
In the hovertext of this xkcd:
There's an "encoding" based on replacing runs of roman numerals with their sums. To do this:
Find all runs of at least 1 roman numeral (IVXLCDM)
Replace them with their sums, as numbers
The Roman Numerals are IVXLCDM, corresponding respectively to 1, 5, 10, 50, 100, 500, 1000. You shou... |
The Fibonacci polynomials are a polynomial sequence defined as:
\$F_0(x) = 0\$
\$F_1(x) = 1\$
\$F_n(x) = x F_{n-1}(x) + F_{n-2}(x)\$
The first few Fibonacci polynomials are:
\$F_0(x) = 0\$
\$F_1(x) = 1\$
\$F_2(x) = x\$
\$F_3(x) = x^2 + 1\$
\$F_4(x) = x^3 + 2x\$
\$F_5(x) = x^4 + 3x^2 + 1\$
When you evaluate the Fibo... |
For this challenge, a word is defined as a string of letters, separated by spaces.
Given a string of words, and an integer i representing an index into that string, output the whole word which contains the character at index i.
For example (using 0-based indexing), with the string code golf, and the index 6, the 7th ch... |
In this challenge we considered a frog hopping around a lily pond. To recap the lily pond was represented as a finite list of positive integers. The frog can only jump forward or backwards by a distance equal to the number at its current location. So for example:
[2, 3, 1, 4, 1]
Here the frog is on a 1 so i... |
Related
Sometimes when I use my microwave, I do a little trolling and enter times such as 2:90 instead of 3:30 because they end up being the same time anyway. The microwave happily accepts this and starts counting down from 2:90, displaying times like 2:86 and 2:69 until it gets back to a stage where it can count down... |
Write the shortest program or function that mimics the addition in this XKCD strip:
Input
Two positive decimal integers containing only the digits 150.
Output
The positive decimal integer result of adding the two inputs together in the manner shown above. This output should also only have the digits 150.
Specification... |
In this challenge, you'll print out the SBCS of Jelly, a popular golfing language. Its code page looks like this:
_0
_1
_2
_3
_4
_5
_6
_7
_8
_9
_A
_B
_C
_D
_E
_F
0_
¡
¢
£
¤
¥
¦
©
¬
®
µ
½
¿
€
Æ
Ç
Ð
1_
Ñ
×
Ø
Œ
Þ
ß
æ
ç
ð
ı
ȷ
ñ
÷
ø
œ
þ
2_
!
"
#
$
%
&
'
(
)
*
+
,
-
.
/
3_
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
4... |
FizzBuzz is where a range of positive integers is taken, and numbers divisible by 3 are replaced with "Fizz", divisible by 5 with "Buzz" and divisible by 15 with "FizzBuzz".
I've got some FizzBuzz output here. Unfortunately, it's been shuffled:
4
Fizz
Fizz
Buzz
2
A bit of logic shows us that this is 2, Fizz, 4, Buzz, ... |
Lambda calculus is a system of computation based on single-argument functions; everything in it is such a function. Due to this functional nature, juxtaposition is commonly used to denote function application, grouped from left to right. For example, \$(f g) h=f g h\$ denotes what would conventionally be written \$(f(g... |
There's a payment machine for laundry in my building which does a few frustrating things. The ones relevant to this challenge are:
It doesn't make change. So if you pay over the amount then you are not getting that over-payment back.
It doesn't accept coins smaller than 20c. Meaning the only coins it accepts are 20c... |
Given a string containing a sequence of ascending consecutive positive integers, but with no separators (such as 7891011), output a list of the separated integers. For that example, the output should be [7, 8, 9, 10, 11].
To disambiguate the possible outputs, we add the restriction that the output must always have at l... |
A twin of this.
FizzBuzz is where a range of positive integers is taken, and numbers divisible by 3 are replaced with "Fizz", divisible by 5 with "Buzz" and divisible by 15 with "FizzBuzz". For example, FizzBuzz from 1 to 10 is 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz.
Your challenge is to, given a list of Fizzes, B... |
Goal
You have to print the ASCII printable characters' code page (0x20-0x7E).
The output should look like this:
!"#$%&'()*+,-./
0123456789:;<=>?
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[\]^_
`abcdefghijklmno
pqrstuvwxyz{|}~
Rules
The output should be exactly like shown above, but trailing whitespace is OK.
No builtins that triv... |
A pristine program is a program that does not have any errors itself but will error if you modify it by removing any contiguous substring other than the entire program.
A crystalline program is sort of the opposite. It is a program which doesn't have any errors itself but will error if you modify it by adding any 1 cha... |
This challenge will be based on an R language trivia: every release is named and it's a reference to Peanuts comic strips (see here and here).
Task
Given a release name, output its number.
For reference, use the below list:
Great Pumpkin 2.14.0
December Snowflakes 2.14.1
Gift-Getting Season 2.14.... |
In these previous challenges[1][2] I've been dealing with "mushroom forests". To help with these I draw little diagrams of the forests to help. In this challenge we are going to reverse engineer the data from these diagrams.
To recap ha! mushroom forests are a list of pairs of non-negative integers. Each pair repres... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.