text
stringlengths
180
608k
[Question] [ ## The Challenge You are to write a complete program that takes seven numbers from STDIN, and prints the two dimensional history of the cellular automaton (CA) to STDOUT. This is code golf. **Input Formatting** The input will be seven integers/strings separated by commas. The first number is the number...
[Question] [ Let's define a simple function \$f\$ which takes an integer and produces a list: \$ f(n) = [g(1),g(2),\dots,g(n)] \\ g(n) = [f(0),f(1),\dots,f(n-1)] \$ We can then calculate the first couple of values for \$f(n)\$: ``` 0 -> [] 1 -> [[[]]] 2 -> [[[]],[[],[[[]]]]] 3 -> [[[]],[[],[[[]]]],[[],[[[]]],[[...
[Question] [ Related Challenge: [Single Digit Representations of Natural Numbers](https://codegolf.stackexchange.com/questions/200185/single-digit-representations-of-natural-numbers) # Task Write a program/function that when given a non-negative integer \$n \le 100000\$ outputs an expression which uses all the digi...
[Question] [ Most people are familiar with Pascal's triangle. ``` 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 ``` Pascal's triangle is an automaton where the value of a cell is the sum of the cells to the upper left and upper right. Now we are going to define a similar triangle. Instead of just taking the cells to the ...
[Question] [ # Prelude: This challenge is different from "another cat program". There's literal tons of different twists, why can't I have my own, people? Unique things: * It isn't reading direct input to output. * It is manipulating the string in a way that for sure isn't a straight-up cat. # Challenge: Given...
[Question] [ What are your tips for code golfing using Clojure? The aim of this question is to collect a list of techniques that are specific to Clojure and can be used in general code-golfing problems. [Answer] Use reader syntax for lambdas. So use ``` #(+ % %2 %3) ``` instead of ``` (fn [x y z] (+ x y z)) ...
[Question] [ Write a program that, for any \$n\$, generates a triangle made of hexagons as shown, \$2^n\$ to a side. The colors are to be determined as follows. We may give the triangle barycentric coordinates so that every hexagon is described by a triple \$(x,y,z)\$ with \$x+y+z=2^n-1\$. (The three corners will b...
[Question] [ In this challenge, Turing machines operate on a zero-initialized binary tape that is infinite in both directions. You are given an integer \$N\$, where \$1 \le N \le 20000\$. Your program has to output a Turing machine that takes exactly \$N\$ steps to halt, including the final step. Alternatively, you...
[Question] [ *(a paradox, a paradox, a most ingenious paradox)* This is the first part of a multipart series inspired by different R functions. # The Task Given a dataset \$D\$ of positive integers, I need you to compute the [5 number summary](https://en.wikipedia.org/wiki/Five-number_summary) of \$D\$. However, I'...
[Question] [ **The Challenge:** For an input of one letter X (upper or lower case from A to Z) and one digit N (0-9) print the corresponding letter X made of N \* X. The letter has to be from this list: ``` AAA BBBB CCCC DDDD EEEEE FFFFF GGG H H A A B B C D ...
[Question] [ ## Background **Sudoku** is a number puzzle where, given an \$ n \times n \$ grid divided into boxes of size \$ n \$, each number of \$ 1 \$ to \$ n \$ should appear exactly once in each row, column and box. In the game of Chess, the **King** can move to any of (at most) 8 adjacent cells in a turn. "Ad...
[Question] [ ## Introduction This is a log of length 5: ``` ##### ``` I want to pile a bunch of these logs on top of each other. How I do this is that I slide a new log onto the topmost one from the right, and stop sliding when their left or right ends align (don't ask why). If the new log is longer, it slides all ...
[Question] [ What general tips do you have for golfing in [///](https://esolangs.org/wiki////)? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to /// (e.g. "remove unnecessary whitespace" is not an answer). Tips for [itflabtijtslwi](https://esolangs.or...
[Question] [ When code-golfing there will be times where you need a Hex Dump of your code, usually because you've used unprintable characters. So, why not make a program that Hex Dumps itself? ## The Challenge This challenge is to, given no input, output a Hex Dump of your source code in the following formatting: `...
[Question] [ *~~Inspired by~~ Copied from [this question](https://stackoverflow.com/q/35516378/2586922) at Stack Overflow.* Given a matrix `A`, create a matrix `B` such that the columns of `A` are arranged in a block-diagonal fashion. For example, given ``` 1 2 3 4 5 6 ``` the output would be ``` 1 0 0 4 0 0 0 2 0 ...
[Question] [ # The Challenge Create a function that, when given an input of ASCII art (directing a path that may eventually loop), outputs the length of the loop (if there is one) and the length of the "tail" leading into the loop in one of the forms below. --- # Input Your input must be passed to a function. Below...
[Question] [ You are given a string and two characters. You have to print the string between these characters from the string. # Input Input will first contain a string (not empty or `null`). In the next line, there will be two characters separated by a space. # Challenge Return the string between the two character...
[Question] [ You should write a program or function which outputs or returns as much of [Chapter I of The Little Prince](http://pastebin.com/raw.php?i=5RBHAM08) as it can. Your program or function has to be an M-by-N block of code containing only printable ascii characters (codepoint from 32 to 126) and newlines at...
[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 2 years ago. [Improve this quest...
[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/464/edit). Closed 3 years ago. [Improve this question](/posts/464/edit) Crea...
[Question] [ Given a string \$X\$ we will say two strings, \$a\$ and \$b\$, are **building blocks** of \$X\$ if \$X\$ can be made by concatenating some \$n\$ \$a\$s with \$m\$ \$b\$s in any order. For example the string `tomato` has building blocks `to` and `ma`: ``` to ++ ma ++ to ``` We will say that the **finene...
[Question] [ *A Knight in chess moves two squares vertically and one square horizontally, or two squares horizontally and one square vertically (with both forming the shape of a capital L)* --- Given a Knight current square in a chess board and an array of unavailable squares, calculate the minimum number of **vali...
[Question] [ If we have a finite list of elements we can determine the probability of any one element being drawn at random as the number of times it occurs divided by the total number of elements in the list. For example if the list is `[2,3,2,4]` the probability of drawing `2` is \$\frac 1 2\$ since there are \$2...
[Question] [ The **edit distance** between two strings is the minimum number of single character insertions, deletions and substitutions needed to transform one string into the other. This task is simply to write code that determines if two strings have edit distance exactly 2 from each other. The twist is that you...
[Question] [ [Related](https://codegolf.stackexchange.com/questions/55197/magic-the-gathering-combat-golf) # Goal: Given two creatures with optional combat abilities, return unique but consistent values that represent which creatures died, if any. # Input: ``` #Longest form: [[P,T, "<abilities>"], [P,T, "<abilities...
[Question] [ This is a [quine](/questions/tagged/quine "show questions tagged 'quine'") variation. ## Introduction We all write short code, because [some obscure reasons](https://i.stack.imgur.com/0DDnF.png), but whatever we do, the'll take up at least 144 pixels/byte (with a 12px font). But what would happen, if w...
[Question] [ # Challenge ¬°We're going to give exclamation and question marks inverted buddies! Given a body of text containing sentences ending in `.`, `?`, or `!`, prepend inverted question marks, `¬ø`, to interrogative sentences (sentences ending in `?`) and inverted exclamation marks, `¬°`, to exclamatory (sent...
[Question] [ ## The challenge This challenge is very straightforward. Given four 3-dimensional points, calculate the surface area of the tetrahedron that they form. This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest code wins. Standard loopholes apply, with the added s...
[Question] [ Given a maze on stdin and an entry point, write a program that prints a path to the exit on stdout. Any path is acceptable, as long as your program does not generate the trivial path (passing through every point in the maze) for every maze. In the input, walls are marked by a `#` and the entry point by...
[Question] [ *The shortest code to pass all possibilities wins* Many grid based games have been made that start off with a grid of lights that are switched on. Pressing any of the lights causes that light and the four lights adjacent to it to be toggled. When a light is toggled, it is turned off or turned on, depen...
[Question] [ Implement polynomial long division, an algorithm that divides two polynomials and gets the quotient and remainder: (12x^3 - 5x^2 + 3x - 1) / (x^2 - 5) = 12x - 5 R 63x - 26 In your programs, you will represent polynomials as an array, with the constant term on the tail. for example, x^5 - 3x^4 + 2x^2 - ...
[Question] [ # 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. [![a labeled 7-segment display](https://i.stack.imgur.com/s39bwm.png)](https://i.stack.imgur.com/s39bwm.png) This display will only show the numbers from 0 to 9 as u...
[Question] [ ## Challenge: Given a list of non-negative integers, determine by how much you should increase each item to create the closest binary box with the resulting integer-list. **What is a binary box?** A binary box is where the first and last rows consists of `1`-bits; the first and last columns consist of ...
[Question] [ Just over seven years ago, [everybody suddenly stopped talking about the Maya people](https://www.xkcd.com/998/). It is time to rectify that! For clarification, I am talking about the [Mesoamerican Long Count Calendar](https://en.wikipedia.org/wiki/Mesoamerican_Long_Count_calendar). Your program will h...
[Question] [ A Hamiltonian path in a graph is a path that visits each vertex exactly once; a Hamiltonian cycle is a Hamiltonian path that is a cycle – the path forms a simple closed loop. In this challenge the graph will be a `n x n` grid, where n is an even number greater than 2. Here is an example of a Hamiltonia...
[Question] [ Given a list of date ranges `r` as input, output or return any ranges not found in `r`. For the sake of this example, input will be in `YYYY-MM-DD` format. Let's say you have three date ranges: ``` [2019-01-01, 2019-02-01] [2019-02-02, 2019-04-05] [2019-06-01, 2019-07-01] ``` You can see that there is ...
[Question] [ In this challenge I will ask you to find a QR decomposition of a square matrix. The QR decomposition of matrix **A** is two Matrices **Q** and **R** such that **A = QR**. In particular we are looking for **Q** to be an orthogonal matrix (that is **QTQ=QQT=I** where **I** is the multiplicative identity ...
[Question] [ You probably know the rhetorical question of whether [a glass is half full or half empty](https://en.wikipedia.org/wiki/Is_the_glass_half_empty_or_half_full%3F). I'm getting a little tired of the phrase, so I decided that it's time to eliminate this confusion about glass fullness or emptiness programma...
[Question] [ As you all know, today is election day! Your task today is to print out a ballot, given an input. If the input is `Hillary Clinton`, print: ``` Hillary Clinton ===-----===> Donald Trump === ===> ____________ === ===> ``` However, if the input is `Donald Trump`, print: ``` Hillary Cl...
[Question] [ Given a positive integer `k > 1` and a non-negative integer `i`, generate a `k`-tuple (or `k`-dimensional vector) of non-negative integers. For every `k`, the map from ℕ to ℕk, **must be bijective**. That is, every input `i` should produce a different tuple, and every possible tuple must be produced by...
[Question] [ Write a [*GOLF*](https://github.com/orlp/golf-cpu) assembly program that given a 64-bit unsigned integer in register `n` puts a non-zero value into register `s` if `n` is a square, otherwise `0` into `s`. **Your *GOLF* binary (after assembling) must fit in 4096 bytes.** --- Your program will be scored ...
[Question] [ # Background Many moons ago, in a galaxy much like our own, a young BrainSteel attempted to invent a board game. He believed that he, too, could find an amazingly simple set of rules that would generate wonderfully strategic gameplay. He drew up the first set of rules--it looked promising. He played wi...
[Question] [ It's the ending of another well played chess game. You're the white player, and you still have a rook and your king. Your opponent only has his king left. Since you're white, it's your turn. Create a program to play this chess match. Its output can be a sequence of moves, a gif animation, ASCII art or ...
[Question] [ Simplified version of ["Signpost"](https://www.chiark.greenend.org.uk/%7Esgtatham/puzzles/js/signpost.html) puzzle from [Simon Tatham's Portable Puzzle Collection](https://www.chiark.greenend.org.uk/%7Esgtatham/puzzles/). ### How the puzzle is created We pick up randomly positive integer `N` and one of...
[Question] [ A [super prime](https://en.wikipedia.org/wiki/Super-prime) is a prime whose index in the list of primes is also a prime: ``` 3, 5, 11, 17, 31, 41, 59, 67, 83, 109, 127, 157, 179, 191, 211, 241, 277, 283, 331, 353, 367, 401, 431, 461, 509, 547, 563, 587, 599, 617, 709, 739, 773, 797, 859, 877, 919, 967,...
[Question] [ One thing that is constantly frustrating when golfing ARM Thumb-2 code is generating constants. Since Thumb only has 16-bit and 32-bit instructions, it is impossible to encode every immediate 32-bit value into a single instruction. Additionally, since it is a variable length instruction set, some metho...
[Question] [ *NOTE: Since I'm Dutch myself, all dates are in the Dutch `dd-MM-yyyy` format in the challenge description and test cases.* ## Challenge: **Inputs:** Start date \$s\$; End date \$e\$; Digit \$n\$ **Outputs:** All dates within the range \$[s,e]\$ (including on both sides), which contain \$n\$ amount...
[Question] [ ## Introduction *(may be ignored)* Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all positive numbers. This is the fifth challenge in this series (links to the [first](https://codegolf...
[Question] [ # Goal In light of the World Series being around the corner, I need a program that can read the box scores and tell me what inning it is. This is complicated slightly because baseball uses an odd method to record the score. They don't write down the at-bat team's score for the inning until they've scor...
[Question] [ *(Despite 60+ questions tagged [chess](/questions/tagged/chess "show questions tagged 'chess'"), we don't have a simple n-queens challenge.)* In chess, the [N-Queens Puzzle](https://en.wikipedia.org/wiki/Eight_queens_puzzle) is described as follows: Given an `n x n` chessboard and `n` queens, arrange t...
[Question] [ # Find the outcome of a game of War When I was in elementary school, there was a "Rock-Paper-Scissors"-ish game we'd play during assemblies, when waiting for our teacher, at recess etc. We called it "War". After some searching however, it turns out this is a much simpler variant of the ["Shotgun Game" ...
[Question] [ Given an integer `n`, output the first `n` sloping binary numbers, either 0- or 1-indexed. They are called this because of how they are generated: Write numbers in binary under each other (right-justified): ``` ........0 ........1 .......10 .......11 ......100 ......101 ......110 ......111 .....1000 .....
[Question] [ [Inspired by this CR question](https://codereview.stackexchange.com/questions/121708/randomly-generate-spelling-mistake-in-string) (please don't kill me for browsing CR) ## Spec The probabilities of misspelling a word are: * 1/3 of the time don't change the output * 1/3 of the time remove a random char...
[Question] [ The [split-complex numbers](https://en.wikipedia.org/wiki/Split-complex_number), also known as "perplex numbers" are similar to the complex numbers. Instead of `i^2 = -1`, however, we have **`j^2 = 1; j != +/-1`**. Each number takes the form of `z = x + j*y`. In one attempt to limit the complexity of t...
[Question] [ What makes the ideal question? Perhaps it is merely the abstraction of a profound thought and the initialization of a dream, a hope, a thought, a (… *5,024.2 characters omitted*). Therefore, I propose that we find such a factor to quantify questions. I propose also that this factor be called ***Q****F*...
[Question] [ Your goal is to write a perfect player for the game of [Wythoff's Nim](http://en.wikipedia.org/wiki/Wythoff's_game). ## Rules of Wythoff's Nim Wythoff's Nim is a deterministic two-player game played with two piles of identical counters. Players alternate turns, in which they do one of these: 1. Remove ...
[Question] [ # Your task .. is to do what Brian Fantana apparently couldn't do, and solve the 2x2x2 Rubik's Cube. ![pocket cube - anchorman](https://i.stack.imgur.com/F0XXz.jpg) ## The Layout ``` - - A B - - - - - - C D - - - - E F G H I J K L M N O P Q R S T - - U V - - - - - - W X ...
[Question] [ ## Background For the purposes of this challenge, we'll define a "perfect nontransitive set" to be a set \$A\$ with some [irreflexive](https://en.wikipedia.org/wiki/Irreflexive_relation), [antisymmetric](https://en.wikipedia.org/wiki/Antisymmetric_relation) relation \$<\$, such that for all \$a \in A\$...
[Question] [ The point of this challenge is to find the smallest positive integer that uses up *at least* all of the digits supplied in the input after it is squared and cubed. So, when provided an input such as `0123456789` (i.e. a number that finds the result): ``` 69² = 4761 69³ = 328509 ``` It means that `69` i...
[Question] [ ## Introduction *(may be ignored)* Putting all positive numbers in its regular order (1, 2, 3, ...) is a bit boring, isn't it? So here is a series of challenges around permutations (reshuffelings) of all positive numbers. This is the third challenge in this series (links to the [first](https://codegolf...
[Question] [ In the game of chess, there is piece called the queen that may attack any other piece that is on the same row, column or diagonal. In chess there are typically two sides, black and white, with each piece belonging to one of the teams. Pieces may not attack pieces belong to the same team. Your goal is ...
[Question] [ The [treewidth](https://en.wikipedia.org/wiki/Treewidth) of an undirected graph is a very important concept in Graph Theory. Tons of graph algorithms have been invented which run fast if you have a decomposition of the graph with small treewidth. The treewidth is often defined in terms of tree decompos...
[Question] [ ## Introduction: Let's take a look at a standard Calculator in Windows: [![enter image description here](https://i.stack.imgur.com/DLmi6.png)](https://i.stack.imgur.com/DLmi6.png) For this challenge, we'll only look at the following buttons, and ignore everything else: ``` 7 8 9 / 4 5 6 * 1 2 3 - 0...
[Question] [ ## Challenge: Create a program that takes input of a positive non-zero integer and outputs the 4 next numbers in the sequence described below. *Note: Checking if the input is actually a positive non-zero integer is not necessary* ## Sequence: Every number in this sequence (apart from the first, which i...
[Question] [ In this challenge you'll be building a program that grows as it traverses through the ages… Until it's 2017. ## Challenge Whenever this challenge description says “program”, you can also read “function”. Your submission, when executed, will output a program that is `THE LENGTH OF YOUR SUBMISSION` + `1`...
[Question] [ ## Introduction and credit Assume you're a bartender. You have many happy people in your bar at most times, but many only ever drink the very same drink and too few for your taste and you want to change that. So you introduce a system where the price of a drink is variable, depending on how many have a...
[Question] [ ## Challenge You've given a map to a friend that looks a bit like this: ``` | / | / | \ | \ D ``` A simple map that starts at the top and ends at the bottom. Sadly, your friend doesn't get it. Can you decode the map so that he can read it? ## Input The inpu...
[Question] [ There are 16 distinct [boolean functions](http://mathworld.wolfram.com/BooleanFunction.html) for two binary variables, A and B: ``` A B | F0 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | F13 | F14 | F15 ---------------------------------------------------------------------------------...
[Question] [ You work at a virtual, old-fashioned printing press. To help you arrange your monospace letters faster, you decide to make the shortest program possible to help you. Given a string of text and a page size, generate and output each page of the text. ## Examples For example, with a page width of 14, heig...
[Question] [ [Inspiration.](https://chat.stackexchange.com/transcript/message/39052298#39052298) [Inverse.](https://codegolf.stackexchange.com/questions/84162/convert-an-expression-to-panfix-notation) Evaluate a given omnifix expression. Omnifix is like normal mathematics' infix notation, but with additional copies...
[Question] [ In this question each answer will get a "toolbox" that can be used to construct a program/function. The toolbox will consist of two things: * a list of programming languages * a list of valid characters You must write a valid program/function in one of the languages provided using only the characters i...
[Question] [ Are there any functional programming languages designed for code golfing? I know that golfscript and CJam fulfill the same category for stack based, but I couldn't find a functional code golfing language. [Answer] # [Husk](https://github.com/barbuz/Husk) Husk is a pure functional golfing language ...
[Question] [ A binary convolution is described by a number `M`, and is applied to a number `N`. For each bit in the binary representation of `M`, if the bit is set (`1`), the corresponding bit in the output is given by XORing the two bits adjacent to the corresponding bit in `N` (wrapping around when necessary). If...
[Question] [ ***[Read this yng Nghymraeg](https://notehub.org/lbb69)*** ## Challenge Given a word in Welsh, output all of the possible mutated forms of the word. ## Mutations A mutation is a change of the first letter of a word when following certain words or in certain grammatical contexts. In Welsh, the following...
[Question] [ ## Explanation [Befunge](https://esolangs.org/wiki/Befunge) is a two-dimensional program that uses [stacks](https://en.wikipedia.org/wiki/Stack_%28abstract_data_type%29). That means, to do 5 + 6, you write `56+`, meaning: ``` 56+ 5 push 5 into stack 6 push 6 into stack + pop the first two item...
[Question] [ ## Introduction Some ASCII characters are just so expensive these days... To save money you've decided to write a program that encodes expensive characters using inexpensive ones. However, character prices change frequently and you don't want to modify your program every time you need to encode or deco...
[Question] [ Another [XKCD](https://codegolf.stackexchange.com/search?q=XKCD+is%3Aquestion) inspired competition. This one is based on [Keyboard Mash](http://xkcd.com/1530/). Given a input string, identify the anomalous characters, assuming that the majority have been typed on a single row of the [standard US QWERT...
[Question] [ # Introduction Suppose that you are handed a random permutation of `n` objects. The permutation is sealed in a box, so you have no idea which of the `n!` possible ones it is. If you managed to apply the permutation to `n` distinct objects, you could immediately deduce its identity. However, you are onl...
[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 9 years ago. [Improve this quest...
[Question] [ In prefix notation, the operator comes before the arguments, so you can kind of imagine that the operator calls `next()` which is recursively called. In infix notation, the operator goes between the arguments, so you can imagine it simply as a parse tree. In postfix notation, the operator comes after t...
[Question] [ ASCII boxes look like this: ``` ++ +---+ +------+ +---+ +---+ ++ | | | | | | | | | | | | | | | | +-+ | | | | | | | | +-+ | | | | | | +---+ +---+ | | | | +--+ | | |...
[Question] [ Your task is make program that do following: 1. You should take number. (Positive, negative, fraction is possible input) 2. If it is negative, you reverse the quine. and negate that number (Become positive) 3. Then you repeat <integer part of the input number> times and print first <floor(fraction part...
[Question] [ You need to build a pyramid from cubes. Cubes can be viewed from 2 angles: ``` _____ _____ /\ \ / /\ / \____\ /____/ \ \ / / \ \ / \/____/ \____\/ ``` This is an example for 2-size cubes from the 2 possible angles. The height of the cubes is `$size` slashes (o...
[Question] [ You don't want to pay money for the expensive architectural program, so you decide to roll your own. You decide to use ASCII to design your buildings. Your program will take in a single string formatted in a specific way, and the program will output the building. ## Input Input consists of a single lin...
[Question] [ Your goal is to write a program that creates a random 10x10 map using `0`, `1`, and `2`, and finds the shortest path from top-left to bottom-right, assuming that: **0** represents a grass field: anyone can walk on it; **1** represents a wall: you cannot cross it; **2** represents a portal: when ent...
[Question] [ Consider a zero-sum game with 2 contestants. Each round, each contestant chooses, independently of each other, one of \$n \ge 2\$ different choices. Depending on the two chosen choices, one player is awarded an amount from the other player's pot. For example, the following table shows the gains (positi...
[Question] [ It's a well-known fact that [Fermat's Last Theorem](https://en.wikipedia.org/wiki/Fermat%27s_Last_Theorem) is true. More specifically, that for any integer \$n \gt 2\$, there are no three integers \$a, b, c\$ such that $$a^n + b^n = c^n$$ However, there are a number of near misses. For example, $$6^3 +...
[Question] [ You are to write a program that, when given an integer between 1 and 5 (or 0 and 4 if you wish to use 0-indexing), outputs one of `Code`, `Golf`, `and`, `Coding` or `Challenges`. Each input can map to any of the five outputs. However, the mapping must be one to one (each input goes to a different outpu...
[Question] [ **Challenge** The challenge is simple: Taking no inputs and output the following message: ``` _ __ __ | | | | | |_ |__| | | ``` A number of times equal to the number of hours before or after midnight UTC on 31st Dec 2016. **Examples** For example if it is 19:01 UTC dec 31st you sho...
[Question] [ Given a rectangular grid of text, line up the diagonals that go from the upper-left to the bottom-right into columns such that the lowest-rightmost characters of all diagonals are on a level. Use spaces for indentation. For example, if the input grid of text is ``` abcd 1234 WXYZ ``` then you'd line up...
[Question] [ *Inspired by [this](https://i.stack.imgur.com/womc0.png). No avocados were harmed in the making of this challenge.* Hello I have challenge I need help juic an avocado so I need program to tell me how long to juic avocad for Observe this ASCII art avocado: ``` ###### # # # #### # # # ...
[Question] [ You have `n` coins which each weigh either -1 or 1. Each is labelled from `0` to `n-1` so you can tell the coins apart. You have one (magic) weighing device as well. At the first turn you can put as many coins as you like on the weighing device which is able to measure both negative and positive weight...
[Question] [ [This tweet](https://twitter.com/seanposting/status/1054136447362629637) lists the possible orders for Wings of a Chinese restaurant1: [![Wings menu](https://i.stack.imgur.com/gkvx6.jpg)](https://i.stack.imgur.com/gkvx6.jpg) When ordering Pizza I usually calculate what size gives me the best Pizza-pric...
[Question] [ Given a String and an Array as input, your task is to output the text the input String will print when typed on a typical Mobile Keypad. In a Mobile Keypad, a letter is typed by pressing a button n times, where n is the position of where the letter is at on the button's label. So, `22` should output `b...
[Question] [ # Challenge description Let's call a two-dimentional, rectangular array (meaning its every subarray has the same length), a **grid**. Every unit of a grid is either an **empty space** or a **border**. In a grid of characters, empty space is represented by a single whitespace; any other character is tre...
[Question] [ Inspired by [this question](https://puzzling.stackexchange.com/questions/33263/correct-way-to-add-22-to-4-to-get-82) which was further inspired by [this one](https://puzzling.stackexchange.com/questions/33204/correct-way-to-add-22-to-4-to-get-given-value), write a program which takes two integers and a...
[Question] [ Consider three number sequences, \$A\$, \$B\$ and \$C\$: * \$A\$: A sequence based on recurrence relations, \$f(n) = f(n-1)+f(n-2)\$, starting with \$f(1) = 3, f(2) = 4\$. So, the sequence begins like this: \$3, 4, 7, 11, 18, 29, 47, 76, ...\$ * \$B\$: The [composite numbers](https://oeis.org/A002808),...
[Question] [ # Challenge Find the shortest regex that 1. validates, i.e. matches, every possible date in the [*Proleptic*](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar) Gregorian calendar (which also applies to all dates before its first adoption in 1582) and 2. does not match any invalid date. ## Ou...
[Question] [ ## Background An [L-system](http://en.wikipedia.org/wiki/L-system) (or Lindenmayer system) is a parallel rewriting system that, among other things, can be easily used to model fractals. This question concerns **deterministic, context-free L-systems**. These consists of an alphabet of symbols, an initia...
[Question] [ Your goal is to output an ASCII art pie chart. This is code-golf, so the shortest program (counting the bytes of the source code, not the characters) wins. No external softwares or APIs are allowed. Only the native ones of each language. The starting angle and the direction (clockwise/anticlockwise) of...