text
stringlengths
180
608k
[Question] [ Your task is to print this exact text: ``` az za abyz zyba abcxyz zyxcba abcdwxyz zyxwdcba abcdevwxyz zyxwvedcba ...
[Question] [ You must write a program or function that creates a "stair-ified" string. Here is how you "stair-ify" a string: For each character in the string: * If the character is an upper or lowercase vowel, not including 'y', output it then move the rest of the string *up* a column. * If the character is a space...
[Question] [ Consider a 1-dimensional, real-valued vector *x* that represents observations of some process measured at equally spaced intervals over time. We call *x* a [**time series**](https://en.wikipedia.org/wiki/Time_series). Let *n* denote the length of *x* and *x̄* denote the arithmetic mean of *x*. The **s...
[Question] [ Given a regular N-gon with all diagonals drawn, how many regions do the diagonals form? For example, a regular triangle has exactly 1, a square has exactly 4, pentagon has exactly 11, and a hexagon has 24. * score is inversely proportional to number of bytes in solution * small fudge factors may be add...
[Question] [ The aim of this challenge is to create the shortest code (in characters) that successfully do the following: **Specifications**: * Must create a `5x5x5 labyrinth` with exactly `1 possible solution` (no more, no less) * ~~The labyrinth must be created `randomly`~~ It must be able to generate every exist...
[Question] [ I just got a job as a postman and I need your help to keep it. I have to order a lot of mails before I go out to deliver them. Streets are numbered strictly sequentially, starting with 1 at the start of the street, and continuing in order skipping no numbers until the end, with odd numbers on the left ...
[Question] [ The Simplest N-Dimensional shape one can create for any dimension is a [Simplex](https://en.wikipedia.org/wiki/Simplex), and this is a set of N+1 points that are all equal distance away from eachother. For 2 dimensions, this is an equilateral triangle, for 3 dimensions, this is an regular tetrahedron, ...
[Question] [ > > [The Levenshtein edit distance between two strings](https://en.wikipedia.org/wiki/Levenshtein_distance) is the minimum possible number of insertions, deletions, or substitutions to convert one word into another word. In this case, each insertion, deletion and substitution has a cost of 1. > > > ...
[Question] [ Your goal is to output the strictly increasing sequence of consecutive, identical digits of pi (π). Each term in the sequence must be one digit longer than the previous. So `3` (0th digit of pi) is the first time a run of digits occurs (length 1). The next to occur is `33` (digits 24 and 25 of pi). Of ...
[Question] [ Your program must take an input (`n` for the purpose of description) and output all permutations of a number that is `n` digits long with no repeating digits, where each of the digits preceding and including its index are divisible by the place in the number that it falls. You can read about magic numb...
[Question] [ I have a specific number in mind, but it's part of a challenge I'm doing, and I don't want people to do (all) the work for me. Here is a number which has the same digits, but shuffled: ``` 5713167915926167134578399473447223554460066674314639815391281352328315313091488448321843 8892917486601064146636679...
[Question] [ Given an input `n` where `3 <= n <= 25`, perform the following steps, starting with a single `n`-sided die (faces in the range `[1, n]`, inclusive): 1. Print the result of rolling the current `n`-sided dice in play, in the form `kdn: X` (where `X` is the result and `k` is the number of dice in play). 2...
[Question] [ Your task to to solve the SLCSC problem, which consists in finding the shortest possible code to solve the [Longest Common Subsequence problem](https://en.wikipedia.org/wiki/Longest_common_subsequence_problem). A valid solution to the LCS problem for two or more strings **S1, … Sn** is any string **T**...
[Question] [ Sometimes, when I'm really bored (*really* bored), I like to draw a line segment and draw points on it. First, I draw a line segment of a certain size, which is 2^N for some value of N. The line will be represented by a series of `.` characters. ``` ................ ``` Then, I plot a point at the left...
[Question] [ Given a string of unsorted alphanumeric characters, *e.g.* ``` ABC321STPpJqZZr0 ``` output a ", "-separated list of character ranges, sorted by ASCII value, ignoring case and removing duplicates (*i.e.* outputting only uppercase and numeric characters), *e.g.* ``` 0-3, A-C, J, P-T, Z ``` ### Rules * Th...
[Question] [ For each of the 13 rows of a [Yahtzee scoresheet](http://yahtzeerules.com/images/score.jpg) you are given (from stdin) a space separated list of 5 numbers (dice). Your task is to calculate the score for each line and **output the Grand Total** of the game. ## Example [Input](http://pastebin.com/raw.php...
[Question] [ You are given one-quarter of a map that is symmetrical over the x- and y-axes as input. The program should print the complete map. The map can contain the following characters: `-+/\|.`, and they should be turned as expected. The in data is always rectangular and small. ## Example ``` $ cat in +--- |./...
[Question] [ *Inpired by recent [Stand-up Maths' video](https://www.youtube.com/watch?v=dET2l8l3upU).* ## Task Wrapping a list `x` can be seen as inserting "line-breaks" into `x` every `n`-th element, or forming a matrix from `x` with `n` columns (feeding rows first). To be perfectly rigorous in the definition of `...
[Question] [ ### Introduction A function that adds months to a date (without overflowing ends of months) is implemented in many languages/packages. In Teradata SQL it's [ADD\_MONTHS](https://docs.teradata.com/r/1DcoER_KpnGTfgPinRAFUw/1ufuNocPef2Qwb7j3mSwZg), here are some examples: ``` ADD_MONTHS('2021-01-31', 1) ...
[Question] [ Seven countries lay official claims to parts of Antarctica: Argentina, Australia, Chile, France, New Zealand, Norway, and the United Kingdom. We will focus only on the claims of the main Antarctic landmass south of 60° S, which are: * Chile: between 90° W and 53° W * United Kingdom: between 80° W and 2...
[Question] [ ## Background A little while ago, someone posted an [interesting puzzle](https://math.stackexchange.com/q/3873941/773859) on Math.SE: > > What is the smallest digraph (directed graph) G where the following eight graphs are all distinct: > > > * G, the original graph > * Reflexive closure of G > * Sy...
[Question] [ [Part 1 of the task is here](https://codegolf.stackexchange.com/questions/196123/flag-mashup-generator) [Flags Mashup Bot](https://twitter.com/flagsmashupbot) is a small Twitter bot that generates a new country name based on two random country names and tweets the result every couple of minutes. ## Ta...
[Question] [ ### Introduction: *Inspired by both [Perfect License Plates](https://codegolf.stackexchange.com/questions/115007/perfect-license-plates) and [How many points does my license plate give?](https://codegolf.stackexchange.com/questions/141646/how-many-points-does-my-license-plate-give)* Just like in the ch...
[Question] [ # Goal: A tree can be represented as a nested list: the list elements represent nodes, and a node is a pair of the node name and node children. Your program takes as [input](http://meta.codegolf.stackexchange.com/q/2447/3480) a nested list of pairs, and should output a pretty tree. # Examples: Here ar...
[Question] [ Seems like we do not have this one yet, so here we go: # The Challenge Write a program or function that takes a date as input and outputs the day number of the year. You may not use any builtins for that! # Rules * As usual you may write a full program or a function. * The format of the input is up to ...
[Question] [ Quining has a long history - if you haven't heard of it, click the tag and read up a little on it. ## Your Task Output an infinite series of `1`s (with no other spacing [newlines, spaces, etc.]) UNTIL SIGINT (typically CTRL-C) is called. When it is called, output the program source. ## Rules * It must ...
[Question] [ *This is a new kind of challenge inspired by the [Recover the mutated source code](https://codegolf.stackexchange.com/questions/42910/recover-the-mutated-source-code) problem.* You should write two programs or functions both in the same language. The first one should solve Task #1 and the second one sh...
[Question] [ This challenge will behave more or less like a traditional [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"). The only difference is that instead of scoring answers by their number of characters or bytes, users will assign *weights* to different characters in the comments and...
[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/19914/edit). Closed 6 years ago. [Improve this question](/posts/19914/edit) ...
[Question] [ Given a string of `1` and `2` of any length, write some code (doesn't have to be a **function** anymore, everything will be just fine) that calculates how many steps does it need to shrink the string to a final form, following this criterion: If your string is `112112`, this means that you have to prin...
[Question] [ **This question already has answers here**: [Encode a program with the fewest distinct characters possible](/questions/11690/encode-a-program-with-the-fewest-distinct-characters-possible) (10 answers) Closed 6 years ago. The proof of the set of characters is that there is a translator which take...
[Question] [ Given an arithmetic expression, which can include parentheses (`()`), exponents (`^`), division (`/`) and multiplication (`*`), addition (`+`) and subtraction (`-`) (in that order of operation), such as ``` a ^ (2 / 3) * 9 * 3 - 4 * 6 ``` output the same expression in prefix notation. ``` (- (* (* (^ a...
[Question] [ We're going to turn ascii art versions of polygons into their equivalent GeoJSON. # The ASCII shape language The input ASCII language only has 3 possible characters: * `*` signifies a vertex * `-` signifies a horizontal line * `|` signifies a vertical line A `*` will never be directly adjacent to anoth...
[Question] [ ## Introduction: Pete likes doing word search puzzles. Despite that, he has trouble searching for words vertically, (anti-)diagonally, or reversed. Because of that, he'll always search for the words left-to-right, and rotates the entire puzzle in increments of 45 degrees clockwise. In addition to tha...
[Question] [ Related: [Boustrophedonise](https://codegolf.stackexchange.com/q/150117/78410), [Output the Euler Numbers](https://codegolf.stackexchange.com/q/107558/78410) (Maybe a new golfing opportunity?) ## Background Boustrophedon transform ([OEIS Wiki](https://oeis.org/wiki/Boustrophedon_transform)) is a kind o...
[Question] [ The primorial \$p\_n\#\$ is the product of the first \$n\$ primes. The sequence begins \$2, 6, 30, 210, 2310\$. A [Fortunate number](https://en.wikipedia.org/wiki/Fortunate_number), \$F\_n\$, is the smallest integer \$m > 1\$ such that \$p\_n\# + m\$ is prime. For example \$F\_7 = 19\$ as: $$p\_7\# = 2...
[Question] [ The incenter of a triangle is the intersection of the triangle's angle bisectors. This is somewhat complicated, but the coordinate formula for incenter is pretty simple ([reference](https://www.mathopenref.com/coordincenter.html)). The specifics of the formula do not matter much for this challenge. The...
[Question] [ ## Task Given a matrix of numbers \$M\$ with \$r\$ rows and \$c\$ columns, and the magnification factor \$n\$, build the matrix with \$rn\$ rows and \$cn\$ columns where the original elements are spaced \$n\$ units apart and the gaps are filled by piecewise linear interpolation: $$ \begin{bmatrix} a\...
[Question] [ I started a CodeWars kata in Python, just two days ago, related to code golf. Task: Given two congruent circles *a* and *b* of radius *r*, return the area of their intersection rounded down to the nearest integer, in less than 128 chars. * Has to be a one-liner. * Version: Python 3.6 * External librari...
[Question] [ [Stuttering](https://en.wikipedia.org/wiki/Stuttering) is a problem which many of us might have experienced or at least seen it. Although most of famous speech recognition softwares have serious issues with stuttered speaking, let's imagine a software which understands stuttering, but cannot fix them a...
[Question] [ Given a positive integer **n > 1** determine how many numbers can be made by adding integers greater than 1 whose product is **n**. For example if **n = 24** we can express **n** as a product in the following ways ``` 24 = 24 -> 24 = 24 24 = 12 * 2 -> 12 + 2 = 14 2...
[Question] [ Your task is to write a program or function which: * When run for the first time, outputs its source code. * On subsequent executions, it should output what it output previously, but with one random character change (defined below). It does not have to be a uniformly random change, but every possible c...
[Question] [ An [orthogonal matrix](https://en.wikipedia.org/wiki/Orthogonal_matrix) is a square matrix with real entries whose columns and rows are orthogonal unit vectors (i.e., orthonormal vectors). This means that M^T M = I, where I is the identity matrix and ^T signifies matrix transposition. Note that this i...
[Question] [ ## Question We are captured by robot army on their space station. Our space ship pilot is in the prison which is in level 1. There is only one way how to escape and it's rescuing your space ship pilot. It mean's moving from level N to level 1. However because it's very risky you need to get to the pris...
[Question] [ Write code to figure out whether a run of Tetris pieces could be generated by the official Tetris algorithm. Fewest bytes wins. --- [Official Tetris games](http://tetris.wikia.com/wiki/Tetris_Guideline) generate the sequence of falling pieces in a special way. The seven pieces `IJLOSTZ` are dropped in ...
[Question] [ This question is an extension of [Check if words are isomorphs](https://codegolf.stackexchange.com/questions/50472/check-if-words-are-isomorphs) and copies the first part of it to give the definition of an isomorph. Two words are *[isomorphs](http://www.questrel.com/records.html#spelling_structure_enti...
[Question] [ I think everyone is familiar with the game of darts. For those that don't understand the scores, [here](http://www.darts.org.nz/scoring.html) is a useful link. ### The board A dartboard can be compared to a pie cut in 20 pieces. Each piece is divided in 4 sections. * a small outer ring called "double...
[Question] [ What general tips do you have for golfing in [Io](http://iolanguage.org/)? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Io (e.g. "remove comments" is not an answer). Please post one tip per answer. [Answer] ## Higher-level functi...
[Question] [ Write a program to play [the name game](http://www.youtube.com/watch?v=5MJLi5_dyn0). **Input** Your program should accept a single name as input from the user in some way (e.g read from standard input or as a command-line argument). You can assume that the name is a single word consisting of an upper c...
[Question] [ ## Input A single-character string containing an uppercase or a lowercase letter from the English alphabet. Alternatively, you may handle only uppercase or only lowercase letters as input. ## Output [![enter image description here](https://i.stack.imgur.com/JP6XT.png)](https://i.stack.imgur.com/JP6XT.p...
[Question] [ [Bitshift Variations in C Minor by Robert Miles](https://soundcloud.com/robertskmiles/bitshift-variations-in-c-minor) is a Code Golf music piece written in C (with some additional bash commands). It was originally presented in a 2016 Computerphile video [Code Golf & the Bitshift Variations](https://you...
[Question] [ Your task is to create a program or function, that when given an input list of nonnegative integers of length \$l \ge 2\$ and a nonnegative integer \$c\$ where \$2 \le c \le l\$, group the list into \$c\$ "clusters." What this means is, the average (population) [variance](https://en.wikipedia.org/wiki/...
[Question] [ A doubly linked list is a data structure in which each node has a `value` as well as "links" to both the `previous` and next `nodes` in the list. For example, consider the following nodes with values 12, 99, and 37: [![](https://i.stack.imgur.com/pOb9x.png)](https://i.stack.imgur.com/pOb9x.png) Here, t...
[Question] [ *Note: This is related to a variation of the game [Rummikub](https://en.wikipedia.org/wiki/Rummikub)* --- # Background & Rules *Rummikub* is a tile-based game. There are four colors: red, orange, blue and black. For each color there are 13 tiles (labeled from 1 to 13), and there are also 2 Jokers which...
[Question] [ ## Goal: Write a complete program or function which takes a formula in [propositional logic](https://en.wikipedia.org/wiki/Propositional_calculus) (henceforth referred to as a *logical expression* or *expression*) and outputs that formula in [conjunctive normal form](https://en.wikipedia.org/wiki/Conju...
[Question] [ A [counterstring](http://www.satisfice.com/blog/archives/22) is some sort of self-describing test data that is used in software testing. Not sure it was actually invented by [James Bach](http://www.satisfice.com/blog/), but I know it from there. The idea is as follows: the test data contains many aster...
[Question] [ The goal of this challenge is given a finite [directed acyclic graph](https://en.wikipedia.org/wiki/Directed_acyclic_graph) (DAG), determine if the graph is a [transitive reduction](https://en.wikipedia.org/wiki/Transitive_reduction). A brief explanation of what a DAG and transitive reductions are: A D...
[Question] [ Write a program or function that accepts an integer in the range 1..3999 as input and returns the number of line segments required to express that integer in standard Roman numerals (so you would use XL but not VM). Examples: ``` 1 -> 1 4 -> 3 5 -> 2 9 -> 3 10 -> 2 40 -> 4 50 -> 2 9...
[Question] [ The task is simple: write assembly that computes the order of magnitude of an integer using as few clock cycles as possible. * Order of magnitude is defined as `log10`, not `log2`. * The range of valid input is `0` to `1012`, inclusive. Behaviour for input outside that range is undefined. * Values shou...
[Question] [ The challenge is to make a program that sorts a list of words, only that the words need to be in the order of a random given alphabet. Your program will accept a string of comma-separated words and a new alphabet. Your program will output every word in the same way in the new sorted order. ## Example...
[Question] [ **Input**: An RGBA hex color `c` (ex. `FFFF00FF`) and an integer > 0 and < 1000 `n` (ex. `200`). **Output**: Raw bytes of a PNG file such that when the output is saved to a file and opened in an image viewer, an `n` by `n` image filled with the color `c` is displayed. **Specification**: Your program sh...
[Question] [ Write the shortest program to solve a quartic equation. A quartic equation is a polynomial equation of the form: \$ax^4 + bx^3 + cx^2 + dx + e=0\$ A solution for \$x\$ is a number such that the above evaluates to 0. --- **Rules** * The program must take in the 5 floating point coefficients of the equat...
[Question] [ <http://en.wikipedia.org/wiki/Dissociated_press> Dissociated Press is an algorithm that generates random text from an existing text. > > The algorithm starts by printing any N consecutive words (or letters) in the text. Then at every step it searches for any random occurrence in the original text of t...
[Question] [ **This question already has answers here**: [Find ranges of True values in a list](/questions/69156/find-ranges-of-true-values-in-a-list) (36 answers) Closed 1 year ago. Suppose you have an array with some known set of values (e.g. a string of \$0\$ and \$1\$) and you want to get all the locatio...
[Question] [ This task builds on: [Find all reflexicons using roman numerals](https://codegolf.stackexchange.com/questions/239815/find-all-reflexicons-using-roman-numerals) An autogram is a sentence that lists the count of its own letters. Below is one of the first documented autograms found by Lee Sallows in 1983:...
[Question] [ Given a sequence of integers and an integer `N`, output the number of contiguous subsequences that contain at least `N` distinct integers. Each integer in the sequence is non-negative and will not be larger than the size of the sequence. For example, with the sequence `1,2,2,3` and `N=2`, there a...
[Question] [ The challenge given to me is comparatively easy, and specific to MySQL *only*. I'm given a table `expressions` which have mathematical calculations done by a kid. Basically, I've to `select` all the right calculations! The table have the following properties, * `a` : an integer, *the left operand*. * `...
[Question] [ Identify each letter of the English alphabet with the number denoting its position in the alphabet, that is, `a = 1, b = 2, c = 3, ..., z = 26` (no distinction between lower and upper case letters is made). Every other character is identified with `0`. The "sum" of a word is the sum of its characters...
[Question] [ # Background MQTT (Message Queuing Telemetry Transport) is an ISO standard publish-subscribe-based messaging protocol ([Wikipedia](https://en.wikipedia.org/wiki/MQTT)). Each message has a topic, such as the following examples: * `myhome/groundfloor/livingroom/temperature` * `USA/California/San Francisc...
[Question] [ Given some positive integer `n`, design a protractor with the fewest number of marks that lets you measure all angles that are an integral multiple of `2π/n` (each in a single measurement). ### Details As an output, you may output a list of integers in the range `0` to `n-1` (or `1` to `n`) that repres...
[Question] [ As we saw in [this question](https://codegolf.stackexchange.com/questions/154265/hexcellent-minesweeping) complex logical statements can be expressed in terms of the simple connectives of generalized Minesweeper. However Generalized minesweeper still has redundancies. In order to avoid these redundanci...
[Question] [ ## Introduction You have gotten a job as the minister of finance in your made-up country in your back yard. You have decided to make your own bank in your country for you and your less trustworthy friends. Since you don't trust your friends, you have decided to write a program to validate all transacti...
[Question] [ It's my friend's birthday soon and since he is a programmer and ASCII art lover, I thought I'd make him some ASCII cake! Sadly, I keep forgetting his current age, so I would like to have a program for my ASCII oven, that bakes a cake with a specified number of candles, so I don't have to do it myself a...
[Question] [ # Concept Remembering numbers can be difficult. Remembering a word may be easier. In order to memorize big numbers, I created a way to pronounce them in a leetspeak-like way. # Rules Each digit is first replaced by its corresponding letter: ``` 0 => O 1 => I 2 => R 3 => E 4 => A 5 => S 6 => G 7 => T 8 ...
[Question] [ This dear StackExchange site has so many challenges, and so many good answers. But what about the challenges that were [never answered](https://codegolf.stackexchange.com/unanswered)? ## Task Write a program or a function that will print a pseudo-random open unanswered (as in, a question with exactly z...
[Question] [ An Armstrong number (AKA Plus Perfect number, or narcissistic number) is a number which is equal to its sum of `n`-th power of the digits, where `n` is the number of digits of the number. For example, `153` has `3` digits, and `153 = 1^3 + 5^3 + 3^3`, so `153` is an Armstrong number. For example, `8208...
[Question] [ **This question already has answers here**: [Print element from the periodic table [duplicate]](/questions/11816/print-element-from-the-periodic-table) (3 answers) Closed 8 years ago. # Background You are sitting in chemistry class and your friend keep sending you these strange letters. It is yo...
[Question] [ Most of us LOST fans out there remember the computer that Desmond had to type the characters "4 8 15 16 23 42" in every 108 minutes or the world would end (or would it?). The challenge here is to create a program that would do the same thing by requiring that every 108 seconds the input `4 8 15 16 23 4...
[Question] [ Just about every store nowadays uses [Universal Product Code](https://en.wikipedia.org/wiki/Universal_Product_Code) (UPC) barcodes to simplify the checking out process. If the name doesn't mean anything to you, you will surely recognize what they look like: ![Sample UPC-A barcode](https://i.stack.imgur...
[Question] [ [Pazaak](https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0CB8QFjAAahUKEwjQtb29jZLGAhUHlQ0KHchPAAo&url=http%3A%2F%2Fstarwars.wikia.com%2Fwiki%2FPazaak&ei=aPt-VdDhHoeqNsifgVA&usg=AFQjCNHZGRiZnM3gcHDj9cpNpYJU1k4_tQ&bvm=bv.95515949,d.eXY) is a card game from the Star Wars...
[Question] [ This is a game of capture the flag, heavily inspired and based off of [Red vs. Blue - Pixel Team Battlebots](https://codegolf.stackexchange.com/questions/48353/red-vs-blue-pixel-team-battlebots). That was an awesome question (thank you very much Calvin'sHobbies; I hope you don't mind that I shamelessly...
[Question] [ Your task is, given a square grid of digits (`0-9`), output one of the ways that the digits can be grouped such that: 1. Each digit is part of exactly one group 2. All groups have the same number of digits 3. All groups are bounded by one polygon-like shape (this means that every digit in the group is ...
[Question] [ A *bit-counting comparator* (BCC) is a logic circuit that takes some number of counting inputs `A1, A2, A3, ..., An` as well as inputs `B1, B2, B4, B8, ...` representing a number. It then returns `1` if the total number of `A` inputs that are on is greater than the number represented in binary by the `...
[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/24316/edit). Closed 2 years ago. [Improve this question](/posts/24316/edit) ...
[Question] [ The well-known Urinal Protocol states that each person that takes a urinal will take the one furthest from any other taken urinal. But this fails to account for short urinals; in many cases, a person would prioritize taking a taller urinal in addition to distance. In the real world, you might struggle ...
[Question] [ A polyomino with \$n\$ cells is a shape consisting of \$n\$ equal squares connected edge to edge. No *free* polyomino is the rotation, translation or reflection (or a combination of these transformations, i.e. an isometry) of another (they're equal). The sequence of free polyominoes with \$n\$ cell...
[Question] [ I was trying to write a short MIPS32 code for computing the median of three registers. The rules: * Assume that some values are pre-loaded into `$t0`, `$t1`, `$t2`. * The median of the three values should be placed in `$t0`. * No branches are allowed, but otherwise any instruction is okay. * You may ar...
[Question] [ # Challenge This coding challenge is to figure out how many rounds the cat can live. In a \$4\times4\$ matrix, there are a number of mice and exactly 1 cat. Example: $$ \begin{array} {|r|r|}\hline 🐭 & 🐭 & 🐭 & ⬜ \\ \hline ⬜ & 🐭 & ⬜ & ⬜ \\ \hline ⬜ & ⬜ & 🐱⬜ & 🐭 \\ \hli...
[Question] [ Adapted from [tips for restricted-source in Python](https://codegolf.stackexchange.com/q/209734) Just like [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), [restricted-source](/questions/tagged/restricted-source "show questions tagged 'restricted-source'") pushes one to exp...
[Question] [ ## Background **Tents and Trees** (try [here](https://www.brainbashers.com/tents.asp)) is a puzzle played on a square (or rectangular) grid, where the objective is to place tents horizontally or vertically adjacent to each of the trees, so that no two tents touch each other in 8 directions (horizontall...
[Question] [ Here is a relatively simple two dimensional array challenge. Imagine a battlefield of 625 foot soldiers. You command the ***odd*** troops, but unfortunately the strength of the ***even*** troops overwhelms you. Thankfully, your soldiers have a secret power: If the power of each odd troop and the fellow...
[Question] [ Doing my history reading and note-taking, I can't help but get tired of writing out all these long dates –– 1784 is six entire pencil lifts! jǝǝz! As you can see, I –– like most challenge posters on this site –– am lazy when it comes to writing stuff. Thus, I ask you to please help me shorten some date...
[Question] [ Everybody loves nested lists! However, sometimes it's hard to make a nested list. You have to decide if you want to nest it deeper, or if you need to nest it shallower. So for your challenge, you must "Autonest" a list. To autonest a list, compare every pair of items in the list. * If the second item i...
[Question] [ So in 1st grade math, you learn the names of polygons. Three sides is a triangle, 4 is a square, and 5 is a pentagon. However, in 1st grade honors, you go a bit further. ## Your challenge There is a naming system for polygons above a few sides, so arbitrarily large polygons have a name. Your task is to...
[Question] [ Given an input of a [Pig](http://esolangs.org/wiki/Pig), [SickPig](http://esolangs.org/wiki/SickPig), [DeadPig](http://esolangs.org/wiki/DeadPig), [QuinePig](http://esolangs.org/wiki/QuinePig), or [DeafPig](http://esolangs.org/wiki/DeafPig) program, choose one of those "languages" randomly and interpre...
[Question] [ *Heavily inspired by [Programming a Pristine World](https://codegolf.stackexchange.com/q/63433/42545). Also closely related to [this challenge](https://codegolf.stackexchange.com/q/41648/31625).* --- Let's define a *pristine prime* as a number which is itself prime, but will no longer be prime if you r...
[Question] [ You should write a program or function which takes a non-negative integer `k` and a sorted integer list `L`as input and outputs or returns a smoothed list `M`. `M` is created from the ascending list `L` by inserting at most `k` integer elements while keeping the list sorted. The inserted integers shoul...
[Question] [ Everyone always wants to implement Conway's Game of Life. That's boring! Let's do cops and robbers instead! You'll have two teams: the cops and the robbers. Each team has 5 members with 50 health each. The program will loop continuously. Each iteration, the following will occur: * For each team, print ...
[Question] [ [This question](https://codegolf.stackexchange.com/questions/42220/implement-t9-like-functionality) asks for a T9 dictionary matching functionality which is a very interesting problem. But T9 has another way of typing and that is typing character-by-character. You would NOT need a dictionary to impleme...
[Question] [ Your task is to implement a program similar to the `nl` command-line tool from the GNU core utilities. [Standard loopholes](http://meta.codegolf.stackexchange.com/q/1061/16402) are banned. You may not use any built-in or external function, program or utility for numbering the lines of a file or string,...