text
stringlengths
180
608k
[Question] [ Given a positive integer *n*, compute the value of the [Mertens function](https://en.wikipedia.org/wiki/Mertens_function) \$M(n)\$ where: $$M(n) = \Sigma\_{k=1}^{n}\mu(k)$$ and \$\mu(k)\$ is the [Möbius function](https://en.wikipedia.org/wiki/M%C3%B6bius_function) where \$μ(k) = 1\$ if \$k\$ has an eve...
[Question] [ ## Background [**Binomial transform**](https://en.wikipedia.org/wiki/Binomial_transform) is a transform on a finite or infinite integer sequence, which yields another integer sequence. The binomial transform of a sequence \$\{a\_n\}\$ is given by $$s\_n = \sum\_{k=0}^{n}{(-1)^k \binom{n}{k} a\_k}$$ It ...
[Question] [ A tower is made out of layers, each one being one unit shorter than the one below it. Every layer is completely on top of the previous layer. For example, here is a tower along with it's height map: ``` # ## ### #### ##### 14532 ``` Because the lengths of the layers are the integers from 1 to n, a...
[Question] [ You should have heard about the **[Fibonacci Numbers](https://en.wikipedia.org/wiki/Fibonacci_number)**, often called the Fibonacci Sequence. In this sequence the first two terms are 0 and 1, and every number after the first two is the sum of the two preceding ones. In other words, `F(n) = F(n-1) + F(n...
[Question] [ # Historic Tetris Achievement [Blue Scuti](https://en.wikipedia.org/wiki/Willis_Gibson) became the first ever human to beat the classic game of Tetris on NES. Here's the Tetris [Kill Screen](https://www.youtube.com/watch?v=GuJ5UuknsHU) [![Blue Scuti](https://i.stack.imgur.com/vVwak.jpg)](https://i.stac...
[Question] [ Part of [**Code Golf Advent Calendar 2022**](https://codegolf.meta.stackexchange.com/questions/25251/announcing-code-golf-advent-calendar-2022-event-challenge-sandbox) event. See the linked meta post for details. --- The Elves like playing number games. One day, Bin (a friend of Fen) suggests a new gam...
[Question] [ # Intro [![enter image description here](https://i.stack.imgur.com/MaKOj.png)](https://i.stack.imgur.com/MaKOj.png) Given a whole number \$< 100,\$ extend/shorten the english representation of the number to have as many characters as it's value. [Sandbox](https://codegolf.meta.stackexchange.com/questio...
[Question] [ Here's a reasonably trivial sequence which is not in the [Online Encyclopedia of Integer Sequences](https://oeis.org/). Start with an empty sequence then define each term as the number of characters required to write out, in English, all of the digits of the sequence so far without spaces.\* For refere...
[Question] [ ## Introduction: I think everyone knows what a Lava Lamp is, but in case they do not: [![enter image description here](https://i.stack.imgur.com/dILgU.gif)](https://i.stack.imgur.com/dILgU.gif) [(Image source)](http://api.ning.com/files/qrbliHRnvdw1Rjlr3hjMBmZV8cArQzQHkjqIHMFYV8KWdSCn2lBsAOS6i8s6TltT...
[Question] [ **Challenge** Given a sequence of numbers, create a function which returns the sequence steps. * Assume a sequence will be `N >= 3` * Sequence will repeat it steps at least once * Sequence will only contain natural numbers * Your function or program should return the shortest possible sequence of steps...
[Question] [ *~~Inspired by~~ Taken from [a question at Stack Overflow](https://stackoverflow.com/q/47693536/2586922)*. # The challenge Given an integer `n>1`, output all arrays that can be obtained by swapping exactly two entries in the array `[1, 2, ..., n]`. The arrays can be produced in any order. You can consi...
[Question] [ ## Premise: Your reputation is in Stack-Exchange Form if it can be represented by decomposing your medal counts (gold, silver, and bronze counted separately) into their base-10 digits and joining them in any given order, with a few caveats. While decomposing, each * Gold medal digit is worth three di...
[Question] [ *inspired by [Count down from infinity](https://codegolf.stackexchange.com/q/98274/45941)* Given a non-negative integer `N`, output the number of repetitions of the following steps it takes to reach 0: 1. Convert `N` to binary (`4812390 -> 10010010110111001100110`) 2. Flip each bit (`100100101101110011...
[Question] [ Inspired by one of many bugs I ran into while implementing selection sort in trilangle. Given a non-empty list of non-negative integers, "sort" the list using the following procedure: 1. Find and output the smallest value in the list. 2. If the list only has one element, stop. 3. Recurse on a sublist: ...
[Question] [ Your task is to write a non-empty program / function of byte count **L**, which, when repeated **M** times, checks whether a given positive integer **N** is equal to **L × M**. You should, in theory, support an arbitrary number of repetitions (an arbitrary positive integer value of **M**), but it's fin...
[Question] [ [Triangularity](https://github.com/Mr-Xcoder/Triangularity) is a new esolang developed by [Mr. Xcoder](https://codegolf.stackexchange.com/users/59487/mr-xcoder) where code structure has to follow a very specific pattern: * For the `n`th line of code, there must be exactly `2n-1` characters of the progr...
[Question] [ Write a program that prompts the user for an even integer greater than 2. Given Goldbach’s conjecture that every even integer greater than 2 can be expressed as the sum of two primes, print out two prime numbers which, when added together, provide the requested even number. Edit: the program only has...
[Question] [ Given an undirected graph, find out if it is a tree. A tree is an undirected graph in which there is exactly one path between any two vertices. In other word, the graph is both acyclic and connected. ## Input You can take input in any reasonable format. Here are some example formats: * an adjacency mat...
[Question] [ Given an positive even integer \$ n \$, output the set of "ways to pair up" the set \$ [1, n] \$. For example, with \$ n = 4 \$, we can pair up the set \$ \{1, 2, 3, 4\} \$ in these ways: * \$ \{\{1, 2\}, \{3, 4\}\} \$ * \$ \{\{1, 3\}, \{2, 4\}\} \$ * \$ \{\{1, 4\}, \{2, 3\}\} \$ This can more formally...
[Question] [ Build an interpreter for a fake, stack-based language that gets an input, interprets it, and outputs the result as an array of numbers. It should iterate through each byte and perform a different function based on this table: 0000 (0): Concatenate (Combine top two numbers in a stack as if they were a s...
[Question] [ **Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers. --- This question does not appear to be about code golf or coding challenges within the scope defined in the [help center](https://codegolf.stackexchange.com/help/on-topic). Closed 7 years ago....
[Question] [ Assign the numbers 0 through 7 to the 8 vertices of a cube in any way you want. Exactly one number must be assigned to each vertex. For example, your vertices might be assigned like this: ``` 3-----1 /| /| 4-----2 | | | | | | 5---|-0 |/ |/ 6-----7 ``` Write a program that takes in an integer...
[Question] [ Given an integer `n` (where `n < 10001`) as input, write a program that will output the first `n` [Ulam numbers](http://oeis.org/A002858). An Ulam number is defined as follows: 1. U1 = `1`, U2 = `2`. 2. For `n > 2`, Un is the smallest integer which is greater than Un-1 that is the sum of two **distinct...
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/11020/edit). Closed 2 years ago. [Improve this question](/posts/11020/edit) ...
[Question] [ ### Challenge Given some input string, return a truthy value if it represents a correct roman numeral between 1 (=`I`) and 3999 (=`MMMCMXCIX`), and a falsey value otherwise. ### Details * The input is a non-empty string that only comprises the characters `IVXLCDM`. * The roman numerals (that we use her...
[Question] [ This is a bit similar to this [dust covered entry](https://stackoverflow.com/questions/2985540/code-golf-banner-generation) but I'm hoping my spin on it makes it unique enough. Not been able to find anything dissuading me from posting this but there is quite the sea out there. Anyway! The challenge: Yo...
[Question] [ Given a prime `P` greater than `10`, your program or function must figure out its divisibility rule `x`, defined as the integer with smallest absolute value which yields a multiple of the original prime when multiplied by the last digit of the prime and added to the rest of the original prime. ## Examp...
[Question] [ **This is part of a Cops and Robbers challenge. [Go here](https://codegolf.stackexchange.com/q/103182/8478) for the cops' part.** For the purpose of this challenge, we'll define **whitespace** as *only* linefeeds (0x0A) and spaces (0x20). Note that most languages and regex flavours consider many other ...
[Question] [ ## Background Most everyone is familiar with the *Fibonacci numbers* \$F(n)\$: > > \$0, 1, 1, 2, 3, 5, 8, 13, 21, ...\$ > > > These are formed by the recursion function \$F(n) = F(n-1) + F(n-2)\$ with \$F(0)=0\$ and \$F(1)=1\$. [A000045](https://oeis.org/A000045) A closely related sequence is the *...
[Question] [ In combinatorics, the [**rook polynomial**](https://en.wikipedia.org/wiki/Rook_polynomial) \$R\_{m,n}(x)\$ of a \$m \times n\$ chessboard is the generating function for the numbers of arrangements of non-attacking rooks. To be precise: $$R\_{m,n}(x) = \sum\_{k=0}^{\min(m,n)} r\_k x^k,$$ where \$r\_k\$ ...
[Question] [ The [generalised harmonic number](https://en.wikipedia.org/wiki/Harmonic_number#Generalized_harmonic_numbers) of order \$m\$ of \$n\$ is $$H\_{n,m} = \sum\_{k=1}^n \frac 1 {k^m}$$ For example, the [harmonic numbers](https://en.wikipedia.org/wiki/Harmonic_number) are \$H\_{n,1}\$, and \$H\_{\infty,2} = ...
[Question] [ What general tips do you have for golfing in 2 dimensional programming languages? I'm looking for tips which can be applied to code-golf problems and are specific to 2D programming languages, but not specific to any one language (Responses like "remove comments" and "use the `M` operation" are not answ...
[Question] [ **This question already has answers here**: [Shorten text with Run Length Encoding](/questions/7320/shorten-text-with-run-length-encoding) (28 answers) Closed 4 years ago. Write a program uses [run-length encoding](http://en.wikipedia.org/wiki/Run-length_encoding) to shorten a list of non-negati...
[Question] [ > > Yes, I know there is a [similar question](https://codegolf.stackexchange.com/questions/5136/code-golf-word-unscrambler), but this one specifically concerns any possible words, even with letters left over, while the linked one restricts to a permutation of the input > > > ## Objective Have you e...
[Question] [ What general tips do you have for golfing in QBasic? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to QBasic (e.g. "remove comments" is not an answer). Tips pertaining to the [QB64](https://www.qb64.org/) emulator are also welcome. It has...
[Question] [ At runtime, keep prompting for *a line of input* until the user input is **not** the name of an existing file or directory or other file system item, relative to the current working directory. Then return/print that last inputted filename. You may assume that all user inputs will be valid filenames. ##...
[Question] [ # The Challenge Given an integer `n>0` output a `n+1 X n+1` matrix containing all integers from `1` to `2n` as shown in the test cases bellow # Test Cases ``` n=1 1 2 2 2 n=2 1 2 4 2 3 4 4 4 4 n=5 1 2 3 4 5 10 2 3 4 5 6 10 3 4 5 6 7 10 4 5 ...
[Question] [ In this challenge you will take two lists as input and you will *zip* them. The zip can be defined with this recursive expression: \$ \mathrm{zip}(a,b) = \begin{cases} \left[\,\,\right] & a = \left[\,\,\right] \\ [a\_0]\mid\mid\mathrm{zip}(b, t) & a = [a\_0] \mid\mid t \end{cases} \$ or this Haskell pr...
[Question] [ Letters of the words want fairness. They decided to appear same number of times in a sentence equally. Example: ``` Priorities ``` Will become: ``` Ppprrioooritttieeesss ``` Each letter appears 3 times, as the most common letter was `i`, appearing 3 times. It does not matter where you put the repeated ...
[Question] [ This challenge was originally sandboxed by Magic Octopus Urn; I adopted and posted it with his permission. *This is the cops' thread. The robbers' thread is [here](https://codegolf.stackexchange.com/q/154742/61563).* ## The challenge * **Step One:** Write a piece of code (function or full program) whic...
[Question] [ ## Definition of Additive Primes: * Numbers which have exactly 2 divisors are called *Prime* numbers. * Numbers which are prime and their sum of digits is also a prime number are called ***[Additive Primes](http://prime-numbers.wikia.com/wiki/Additive_Primes)*** --- ## Task: Given an integer `x`, compu...
[Question] [ **Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers. --- This question does not appear to be about code golf or coding challenges within the scope defined in the [help center](https://codegolf.stackexchange.com/help/on-topic). Closed 7 months ago...
[Question] [ # Introduction A quine is a program that outputs its own source code. For example, a well-known Python quine is `_='_=%r;print(end=_%%_)';print(end=_%_)`. Running it outputs `_='_=%r;print(end=_%%_)';print(end=_%_)`, therefore it is a valid quine. An error quine is similar to a regular quine, however i...
[Question] [ Challenge Description: An anagram is a word or phrase formed by rearranging the letters of another word or phrase. For example, "listen" and "silent" are anagrams. In this challenge, your task is to write a program or function that takes a list of strings as input and returns the unique anagrams. Write...
[Question] [ Write a program to replace all occurrences of "force" with "first" and all occurrences of "first" with "force", keeping the original case for all character positions: ``` "ForcefoRcefOrcE" -> "FirstfiRstfIrsT" "FirstfiRstfIrsT" -> "ForcefoRcefOrcE" ``` The rest of the string must stay unchanged, and so...
[Question] [ With the given text below, there are some words in the text that repeats several times in the text. Use any programming language to write a short code that compresses the text to display it. Or in other words, use the smallest number of bytes to display the text. The Text is: ``` Peter Piper picked ...
[Question] [ ## Goal You are given an integer `n` (`n > 1`). You must output how many permutations of the integers `1` to `n` there are which start at `1`, end at `n`, and don't have two consecutive integers which differ by 1. Alternatively, if you take the complete graph `K_n` and remove the edges of the path `1-2...
[Question] [ ### Introduction Let's say that **S1** = `a...b` and **S2** = `..c..`. If we place them on top of each other, we get: ``` a...b ..c.. ``` We merge both strings, with the `.` as the liquid character (which can overlapped). We get this: ``` a.c.b ``` If one of the string is longer than the other, we just...
[Question] [ 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 length N. * Every letter in the word is unique. * Every first letter of the words are unique between each other. * The remaining items of e...
[Question] [ # 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 characters 33 to 126. Not 127 because `chr(127)` is DEL. Not 32 because that's a *space*. # Examples ``` 0 -...
[Question] [ A [variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity) (also referred to as **[VLQ](https://en.wikipedia.org/wiki/Variable-length_quantity)** or `uintvar`) is a way to encode up to a 28 bit integer value using only as many bytes as necessary. This was used in [MIDI file fo...
[Question] [ Given a list of positive integers \$\mathcal I=I\_1,I\_2,I\_3,...,I\_n\$ and a base \$b>1\$ return their "carry-less sum", i.e. represent \$\mathcal I\$ in base \$b\$ and sum digit-by-digit discarding carry. Worked example: ``` I = 13, 2, 9; b = 3 ``` In base 3: ``` 111 + 2 + 100 ----- = 210 `...
[Question] [ # Introduction Super Mario 64 has a heavily overcomplicated RNG, ably explained [here](http://youtu.be/MiuLeTE2MeQ) by Pannenkoek. I thought it might be interesting to implement it. # Challenge Implement the RNG function, except for the two special cases. (Not part of the below description; everything ...
[Question] [ Take this array: ``` [1, 2, 6, 4, 4, 1, 0, 0, 2, 0, 4, 1, 4, 2, 4, 8, 1, 2, 4] ``` There are quite a few places where `[1, ..., 2, ..., 4]` appears, where `...` is any number of items. These include `[1, 2, 6, 4]`, `[1, 0, 0, 2, 0, 4]`, `[1, 0, 0, 2, 0, 4, 1, 4]`, and `[1, 2, 4]`. The shortest of these...
[Question] [ ## Introduction: *I have loads of different ciphers stored in a document I once compiled as a kid, I picked a few of the ones I thought were best suitable for challenges (not too trivial, and not too hard) and transformed them into challenges. Most of them are still in the sandbox, and I'm not sure yet...
[Question] [ *Related: [Let's design a digit mosaic](https://codegolf.stackexchange.com/questions/167337/lets-design-a-digit-mosaic), [Print/Output the L-phabet](https://codegolf.stackexchange.com/questions/87064/print-output-the-l-phabet). [Sandbox post here](https://codegolf.meta.stackexchange.com/a/16667/78039)*...
[Question] [ **This is part of a [cops-and-robbers](/questions/tagged/cops-and-robbers "show questions tagged 'cops-and-robbers'") challenge. [Go here](https://codegolf.stackexchange.com/q/144600/8478) for the cops' part.** ## The Robbers' Challenge A cop's answer can be cracked by removing any subset of characters...
[Question] [ **This question already has answers here**: [Finding Local Extremes](/questions/22252/finding-local-extremes) (21 answers) Closed 3 years ago. Given an array of positive integers, output an array of all the elements that are greater than or equal to the adjacent ones. Most elements will have two...
[Question] [ **Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers. --- Questions without an **objective primary winning criterion** are off-topic, as they make it impossible to indisputably decide which entry should win. Closed 7 years ago. [Improve this quest...
[Question] [ **Note that this challenge requires no handling or understanding of complex numbers.** Given a non-empty square matrix where every element is a two-element (Re,Im) integer list, determine (giving any truthy/falsy values or any two consistent values) whether this represents a Hermitian matrix. Note that...
[Question] [ Your task is to display the below letter "E" shaped ASCII art, given five inputs. Examples: Input: `7,2,+,|,-` (Note: You don't have to follow this exact input format, and if you don't use it, then you must explain how your own input format works) Explanation: * `7` *total width, including the left and...
[Question] [ # About the Series First off, you may treat this like any other code golf challenge, and answer it without worrying about the series at all. However, there is a leaderboard across all challenges. You can find the leaderboard along with some more information about the series [in the first post](https://...
[Question] [ Given an integer n, output the following ASCII art to n rows: ``` 1+1=2 1+2=3 2+3=5 3+5=8 5+8=13 ``` Essentially, the first row is `1+1=2` and the nth row (1-indexed) is \$f\_n + f\_{n+1} = f\_{n+2}\$ where \$f\$ is the Fibonacci sequence, padded so the numbers line up with the prev...
[Question] [ Consider a non-empty binary matrix **M** and a natural number *n*. For the purposes of this challenge, **M** is said to have blockiness *n* if it can be built using adjacent square blocks of size *n*, where each block has equal entries; and it cannot be formed using square blocks of any larger size. In...
[Question] [ ## Challenge Given daily arrival and departure times of every train that reaches a railway station, find the minimum number of platforms required for the railway station so that no train waits. In other words, find the maximal number of trains simultaneously present in the station. ## Input * a pair of...
[Question] [ You're given a rectangular grid of the characters `.` and `#`, like this: ``` .......... ..#....... ....#..#.. ...#...... .......... ``` Your task is to fill the entire axis-aligned bounding box of the `#` with further `#`: ``` .......... ..######.. ..######.. ..######.. .......... ``` The axis-aligned...
[Question] [ **TLDR:** Sort your input according to a new English alphabet somewhat based on Chinese stroke count methods. **Background:** In a Chinese glossary/index, finding terms that are contained within the book is different from English because Chinese doesn't have an alphabet like English, instead they are s...
[Question] [ # Task Given an integer matrix `M` and a modulus `m`, find an inverse of `M` modulo `m`. If the matrix `M` is not invertible modulo `m`, the behaviour is left unspecified. # Matrix inverse If `M` is a square matrix, its inverse exists if and only if its determinant is not 0. Similarly, when we are talk...
[Question] [ ## Introduction Today we're gonna take care of the bane of first-year linear algebra students: matrix definiteness! Apparently this doesn't yet have a challenge so here we go: ## Input * A \$n\times n\$ [symmetric](https://en.wikipedia.org/wiki/Symmetric_matrix) Matrix \$A\$ in any convenient format (y...
[Question] [ In my language [Pyramid Scheme](https://github.com/ConorOBrien-Foxx/Pyramid-Scheme), there is a slightly funny construct: the empty triangle: ``` ^ - ``` When given no arguments, it returns `0`. To generate `1` using this construct, we could use this: ``` ^ /!\ ^--- - ``` This simply passes `0` ...
[Question] [ # Background ## The 1-2-3-Tribonacci Sequence Imagine for a second that you could make a fibonacci sequence by replacing the standard iteration formula with the following: ![tribonacci](https://latex.codecogs.com/gif.download?x_n%20%3D%20x_%7Bn-1%7D%20+%20x_%7Bn-2%7D%20+%20x_%7Bn-3%7D) Basically, inste...
[Question] [ # Challenge Create the shortest program that meets the requirements ## Requirements 1. The code must generate a 5x5 grid of 0s, like so: ``` 00000 00000 00000 00000 00000 ``` 2. The code must accept an input (column, row, character). The grid must change accordingly: Start: ``` 00000 00000 00000 00000 ...
[Question] [ 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...
[Question] [ [Alienese](https://futurama.fandom.com/wiki/Alienese) refers to two "languages" in the show [*Futurama*](https://en.wikipedia.org/wiki/Futurama). In actuality, they are two ciphers of English text with a pictographic alphabet. The first is a simple substitution cipher, but the second is slightly more c...
[Question] [ [Cubically](//git.io/Cubically) is too tedious to manually write any code in. Your challenge is to translate ASCII text into Cubically source code. # Cubically This is just a quick run-down of Cubically; the [repository](//git.io/Cubically) has a more complete guide and details. Cubically is an esolang...
[Question] [ In mathematics, matrix multiplication or the matrix product is a binary operation that produces a matrix from two matrices. The definition is motivated by linear equations and linear transformations on vectors, which have numerous applications in applied mathematics, physics, and engineering. In more d...
[Question] [ # Task Write a program/function that when given 3 positive integers \$a, b\$ and \$m\$ as input outputs a positive integer \$x\$ such that \$a^x\equiv b\ (\text{mod}\ m)\$ or that no such \$x\$ exists. A reference implementation can be found [here](https://tio.run/##bZDRboQgEEXf@Yp5ExNqFHBXm9hP6Bc0adyK...
[Question] [ ## Challenge: Given a matrix input, determine the amount of diagonals and anti-diagonals with duplicated numbers. So if we have a matrix like this: ``` [[aa,ab,ac,ad,ae,af], [ba,bb,bc,bd,be,bf], [ca,cb,cc,cd,ce,cf], [da,db,dc,dd,de,df]] ``` All diagonals and anti-diagonals would be: ``` [[aa],[ab,...
[Question] [ A *pandigital number* is an integer which contains every digit from 0 to 9 at least once. 1234567890, 1902837465000000, and 9023289761326634265 are all pandigital. For the purposes of this challenge, numbers such as 123456789 are not pandigital, since they do not contain a 0, even though 123456789 = 01...
[Question] [ Let `A` be an `m` by `n` rectangular matrix of **positive** integers, where `m` and `n` are also **positive** integers. We are interested in RoD ('Right-or-Down') paths from the upper-left cell of `A` to the lower right cell; in an RoD path, each successive cell of the path is either one cell to the Ri...
[Question] [ In mathematics, a *cyclic quadrilateral* is one whose vertices all lie on the same circle. In other words, every vertex is on the circumcircle of the other three. For more information, see the [MathWorld article](http://mathworld.wolfram.com/CyclicQuadrilateral.html). ### Examples These quadrilaterals ...
[Question] [ My boss\* does not understand why her programmers react negatively to users changing program requirements. Help her understand! On every answer, create a new requirement. Then, write a program/function that solves that requirement and all prior requirements, while in a new programming language. # Examp...
[Question] [ Over on <http://meta.stackoverflow.com>, we have a few memes of our own. One of them is Freehand Red Circles. See [this post](https://meta.stackexchange.com/a/19775/180276): [![](https://i.stack.imgur.com/qXOY3.png)](https://meta.stackexchange.com/a/19775/180276) So, the challenge is, ## can you draw f...
[Question] [ ## Background For the purpose of this challenge, all numbers and their string representations are assumed to be in *decimal* (base 10). I tried to find proper terminology for this challenge, but I do not think there is any, so I made it up. A self-replicating number is a number that appears as a substr...
[Question] [ # The 21 Hairstyles of the Apocalypse Given a a list of numbers between 1 and 21 (or 0 and 20) output a "stitched together" drawing of the following faces (***see rules for stitching information***): ``` ___ ,,, ooo === +++ ### -*~*- ...
[Question] [ Piet is an interesting programming language for a number of reasons. Today we will focus on one reason: the [roll](https://twoguysarguing.wordpress.com/2010/03/15/piet-roll-command/) command. The roll command was originally from PostScript and is a powerful way to manipulate the stack. The roll command...
[Question] [ Create a program that computes the [hamming weight](http://en.wikipedia.org/wiki/Hamming_weight) of a string. Winner is the program with the lowest hamming weight. Rules: * Hamming weight for an ASCII character is defined as the total number of bits set to `1` in its binary representation. * Assume inp...
[Question] [ [Robber's challenge](https://codegolf.stackexchange.com/q/248189/66833) This [cops-and-robbers](/questions/tagged/cops-and-robbers "show questions tagged '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, whe...
[Question] [ My PIN number is [1077](https://www.youtube.com/watch?v=Bq2F4aFOoYc), but that's too difficult to remember. I know from muscle memory that it's a digit, followed by a different digit, then followed by two of the same digit, which is different to the other two digits before it. As a pattern, we can say ...
[Question] [ CGCC hasn't always had MathJax. Back in the dark ages, it would have been necessary to write \$x^2\$ as `x²` (the horror!). In this challenge, you will be given some math which may include superscripts, and you should convert it to MathJax. **Input:** Input will consist of one or more letters `a` to `z...
[Question] [ Well, everyone loves **[Polyglots](https://codegolf.stackexchange.com/tags/polyglot/info)**. You will be given two integers, in any standard form of input (no hardcoding). Your task is to write a **polyglot** which finds the minimum value in a language and the maximum value between the two numbers in t...
[Question] [ Let's use augmented reality to hunt small creatures hidden in source-code. Write a quine program that outputs its own code source, except for 5 consecutive characters that will be modified and that will display a *PCG-mon* : `(^_^)` The 5 consecutive characters can be positioned anywhere in the source ...
[Question] [ **Background**: > > You have been given an assignment to convert base 10 numbers to base 2 without using any premade base conversion functions. You can't use any imported libraries either. > > > **Problem**: Convert an input string from base 10 (decimal) to base 2 (binary). You may not use any prem...
[Question] [ # Task Haskell's and Scala's standard libraries have an `unfold` function that builds a list from an initial state `s` and a function `f`. This is done with the following steps (explained in an imperative way to be simpler): 1. Apply `f` to `s`. 2. If the result * is empty, we're done building the lis...
[Question] [ The [gravitational binding energy](https://en.m.wikipedia.org/wiki/Gravitational_binding_energy) of a planet is the amount of energy required to separate every tiny piece of it so that no piece will orbit or collide with another piece. For a uniform sphere, Wikipedia gives this formula: $$E = \frac{3GM...
[Question] [ Your task is to create a program that, when run, returns itself as output (this is known as a quine). However, this quine must, when it is copied `n` times, returns the quine, but with each of its characters duplicated in place `n` times, where `n` is a positive integer. If your original program is `De...
[Question] [ *The shortest code to generate the correct times on the clocks wins.* You are a seasoned time traveler and have been known to stop at many planets during your journies. Each planet rotates at a different rate and because of this, the length of a day is different than our usual 24-hour day. As a result,...
[Question] [ *While implementing polynomial multiplication in [Itr](https://github.com/bsoelch/OneChar.js/blob/main/ItrLang.md) I found the following interesting operation on strings* To compute the convolution of two strings (for instance `Hello` and `World`) first combine all pairs of letters with indices that ad...
[Question] [ [Prefix normal words](https://arxiv.org/abs/1805.12405) arise in the context of binary jumbled pattern matching. A binary word \$w\$ consisting of \$0\$s and \$1\$s is said to be *prefix normal* \* if, among all of its substrings, none contains more \$1\$s than the prefix of \$w\$ of the same length do...
[Question] [ [Euler's numerus idoneus](https://en.wikipedia.org/wiki/Idoneal_number), or idoneal numbers, are a finite set of numbers whose exact number is unknown, as it depends on whether or not the [Generalized Riemann hypothesis](https://en.wikipedia.org/wiki/Generalized_Riemann_hypothesis) holds or not. If it ...