text
stringlengths
180
608k
[Question] [ # Introduction In the video [the best way to count](https://www.youtube.com/watch?v=rDDaEVcwIJM), binary is proposed as the best system of counting numbers. Along with this argument is a proposal on how to say numbers in this system. First, we give names to each "double power of two", \$2^{2^n}\$ for e...
[Question] [ You are a package handler for Big CompanyTM and your job is to load boxes into a truck. These are special, stretchy trucks: their length can be adjusted at will. But stretching trucks are expensive, so keep the truck lengths as short as possible! # The Challenge Write a full program or function that, w...
[Question] [ ### Sequence Definition Construct a sequence of positive integers `a(n)` as follows: 1. `a(0) = 4` 2. Each term `a(n)`, other than the first, is the smallest number that satisfies the following: a) `a(n)` is a composite number, b) `a(n) > a(n-1)`, and c) `a(n) + a(k) + 1` is a composite number f...
[Question] [ Today in my statistics class, I found that some factorials can be simplified when multiplied together! For example: `5! * 3! = 5! *3*2 = 5! *6 = 6!` ## Your job: Given a string containing only Arabic numbers and exclamation points, simplify my factorial to its shortest possible string, in the least amo...
[Question] [ Don't you hate it when you can't remember how to craft something in Minecraft? Well, time to remedy that! # Task Your task is to take an input, either as a 1D or 2D list and output what item is a result of the crafting table! # Input You may take input as either a string or a list of length `9` or a 2D...
[Question] [ **Closed**. This question is [opinion-based](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Update the question so it can be answered with facts and citations by [editing this post](/posts/130434/edit). Closed 6 years ago. [Improve this questi...
[Question] [ You're with your best bud, Jim, at the amusement park and as your favorite ride comes into view, you and Jim exchange glances. Naturally you race to get in line. Unfortunately he wins because you're a golfer and he plays a real sport (sorry friends). In fact, you're so far behind that you and Jim are s...
[Question] [ The formatting order of dates is one of the most complex and divisive issues the world faces today. Some of us vehemently argue that Month/Day/Year is appropriate, considering that's how we say dates out loud. Others loudly proclaim that Day/Month/Year is best, because it puts the terms in ascending or...
[Question] [ # The Setup Suppose you're given *n* fuses, with 1 ≤ *n* ≤ 5, each of which is a meter long, and where each fuse has an associated burn rate of *N* meters per *D* hours. A fuse can be lit at one or both ends, subsequently extinguished at one or both ends, relit, re-extinguished, etc., as many times as ...
[Question] [ This challenge consists in coding an interpreter for a [Mondrian](http://en.wikipedia.org/wiki/Piet_Mondrian) painting description language (MPDL). ## Language definition The language operates on a stack of rectangles. A rectangle is defined by its upper left coordinate and lower right coordinate. Coor...
[Question] [ A [minifloat](https://en.wikipedia.org/wiki/Minifloat) is a binary representation of a floating-point number that has very few bits. The minifloat in this question will be defined as an 6-bit number `m`, which has the following representation: * 1 bit to repesent the sign of the number. This bit will b...
[Question] [ # Background Mu Torere is a game that is one of only two known to be played by the Maori people of New Zealand before European influence. This makes it a very unique game in that it has an "objective winning criterion" and rules of play that are different from most other games in existence. Gameplay: ...
[Question] [ ## Challenge Given a matrix of digits (0-9), find the smallest (in terms of area) rectangular matrix of digits where one or more copies of itself, possibly rotated, can tile the original matrix. Reflection is not allowed (think of a collection of tiles on a wall or floor). Input can be taken in any rea...
[Question] [ ## Background This challenge is about [A004001](https://oeis.org/A004001), a.k.a. **Hofstadter-Conway $10000 sequence**: $$ a\_1 = a\_2 = 1, \quad a\_n = a\_{a\_{n-1}} + a\_{n-a\_{n-1}} $$ which starts with ``` 1, 1, 2, 2, 3, 4, 4, 4, 5, 6, 7, 7, 8, 8, 8, 8, 9, 10, 11, 12, 12, 13, 14, 14, 15, 15, 15, 1...
[Question] [ Roman numerals can be (mostly) written in a one column format, because each letter intersects the top and the bottom of the line. For example: `I`, or 1 intersects both the top and bottom of the line, and `V` or 5 intersects the bottom and top lines, the top twice and the bottom at one place. The value...
[Question] [ Who doesn't like to chill on a Sunday morning in summer with a chilled beer and TV or in winter playing badminton or ultimate with friends? I always think knowing how many days you have to chill in a month keeps you well-informed and helps you plan what you want to do. Be it sitting in front of your pc...
[Question] [ A program is ***bit primed*** if bits in prime positions must alternate between zero and one, starting with one. For example, this is a template for a bit primed program with [0..47] bits. ``` ..10.1.0 ...1.0.. .1.0...1 .....0.1 .....0.. .1.0...1 01234567 89012345 67890123 45678901 23456789 01234567 ``...
[Question] [ There's a river and there are wolves and chickens on one side of the river. They have a raft and they all need to get to the other side. However, the raft cannot travel on its own. The raft will sink if more than two animals are on it. None of the animals want to get wet because the river's cold and di...
[Question] [ # History My company sends out a weekly newsletter to everyone within the company. Included in these newsletters is a riddle, along with a shoutout to whomever in the company was the first to email/provide a solution to last week's riddle. Most of these riddles are quite trivial, and honestly pretty du...
[Question] [ ## Introduction A *pointer array* is an array `L` of nonzero integers where `0 ≤ L[i]+i < len(L)` holds for all indices `i` (assuming 0-based indexing). We say that the index `i` *points* to the index `L[i]+i`. A pointer array is a *loop* if the indices form a single cycle of length `len(L)`. Here are ...
[Question] [ I've been doing word searches recently, and I thought it would be *so* much easier if all of the words read left-to-right. But rewriting all the lines takes a lot of effort! So I'm enlisting code golfers to help. (Disclaimer: The above story may or may not be remotely accurate.) Your code will take a r...
[Question] [ # The Challenge Given a `n x n` matrix of integers with `n >= 2` ``` 1 2 3 4 ``` and a list of integers with exactly `2n`elements ``` [1,2,-3,-1] ``` output the rotated matrix. This matrix is contructed in the following way: * Take the first integer in the list and rotate the first row to the right by ...
[Question] [ This challenge is inspired by this Oliver Sacks quote: > > “At 11, I could say ‘I am sodium’ (Element 11), and now at 79, I am > gold.” ― Oliver Sacks > > > I want you you find numbers in a string and replace them with their corresponding elements' symbols. (1 is H, 2 is He, 3 is Li, etc.) There a...
[Question] [ Recently at Puzzling.SE, there was a problem that I wrote about determining which two bottles out of a larger number are poisoned when the poison only activates if both components are drunk. It ended up being quite the ordeal, with most people managing to get it down to 18 or 19 prisoners using complet...
[Question] [ The [Kolmogorov complexity](http://en.wikipedia.org/wiki/Kolmogorov_complexity) of a string *S* is the length of the shortest program *P*, written in some programming language *L*, whose output is exactly *S*. (Yes, the real definition is more formal but this will suffice for the challenge.) Your tas...
[Question] [ Some positive integers can be shown to have a property called *Chain divisibility.* For a number to be chain-divisible by *n*, it must fulfil three requirements: 1. > > Each digit divides the number formed by the *n*  digits that follow it. > > > For example, the number 7143 is chain-divisible by 2...
[Question] [ # Challenge Write a calculator that takes input in a verbal form (as one might speak an equation) and also outputs in a verbal form (as one might speak a number). # Rules The calculator should be able to: * add, subtract, multiply and divide * handle operands between negative one million and one millio...
[Question] [ It is a well-known fact that you can colour a two-dimensional map with four colours in such a way that two countries with a common border always have different colours. There have already been enough challenges on this topic. However, the prerequisite for this is that there must be no enclaves, i.e. no...
[Question] [ # Santa's Shortest Path Problem Trying to be as time-efficient as possible Santa needs to plan his trips carefully. Given a 5X5 grid representing a map of villages it is your task to be Santa's flight controller. Show santa the shortest and therefor fastest route to fly his sleigh and give him a list o...
[Question] [ ## Background [Combinatory logic](https://en.wikipedia.org/wiki/Combinatory_logic) is a system where a term is written using a finite set of combinators and function application between terms, and reduction rules are defined for each combinator. The well-known S and K combinators have the following red...
[Question] [ Implement a function \$f\$ (as a function or complete program), such that \$ \displaystyle\lim\_{n\rightarrow \infty} f(n) \$ converges to a number which is *not* a [computable number](https://en.wikipedia.org/wiki/Computable_number). Answers will be scored in bytes with fewer bytes being better. # IO ...
[Question] [ Inspired by *Flow Fit: Sudoku*, a brand-new mobile puzzle game (as of Nov 2019). ## Background A [**Latin square**](https://en.wikipedia.org/wiki/Latin_square) is a square grid of side length \$ n \$ filled with \$ n \$ different symbols, where each row and column contains each symbol exactly once. Let...
[Question] [ This challenge is a prize for [ais523](https://codegolf.stackexchange.com/users/62131/ais523) for [winning](https://codegolf.meta.stackexchange.com/questions/11186/cast-your-vote-for-best-of-ppcg-2016/11191#comment37192_11191) the "[Rookie of the Year](https://codegolf.meta.stackexchange.com/a/11191/26...
[Question] [ A string whose length is a positive [triangular number](https://en.wikipedia.org/wiki/Triangular_number) (1, 3, 6, 10, 15...) can be arranged into an "equilateral text triangle" by adding some spaces and newlines (and keeping it in the same reading order). For example, the length 10 string `ABCDEFGHIJ`...
[Question] [ Given an input of an integer *n* and a list of positive integers *m1*, *m2*, ..., output a list of integers *m1'*, *m2'*, ... where *mx'* is defined as the average of *mx-n* through *mx+n*. When calculating these averages, ignore indices that are out of bounds (and adjust what you are dividing the sum ...
[Question] [ I've been working on *another* stack-based golfing language called [Stackgoat](https://github.com/vihanb/Stackgoat). In this challenge you'll be writing a Tokenizer for Stackgoat (or really any general stack-based languages). ## Examples ``` "PPCG"23+ ["PPCG", '23', '+'] 'a "bc" + ['"a"', '"bc"', '+'] ...
[Question] [ **If you haven't played golf before, here's a list of golf-related terms I use in this question** * *Shot*, also called a *stroke*: Every time the ball is hit, this is a shot. * *Hole*: A golf course is split into holes, in which the goal is to hit a ball from one designated location to another in as f...
[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 3 years ago. [Improve this quest...
[Question] [ In this challenge, we consider an encoding from positive integers (up to a limit) to binary sequences. Some examples: ``` A. 1 -> 00, 2 -> 01, 3 -> 10, 4 -> 11 B. 1 -> 0, 2 -> 1, 3 -> 01 C. 1 -> (empty sequence) ``` A [prefix code](https://en.wikipedia.org/wiki/Prefix_code) is a coding where no code is...
[Question] [ This problem is based on, [A337517](https://oeis.org/A337517), the most recent OEIS sequence with the keyword "nice". > > \$a(n)\$ is the number of distinct resistances that can be produced from a circuit with exactly \$n\$ unit resistors. > > > The sequence begins `1, 2, 4, 9, 23, 57, 151, 427, 12...
[Question] [ (This challenge exists to extend sequence [A276272](http://oeis.org/A276272) in the On-Line Encyclopedia of Integer Sequences, and perhaps create a new OEIS sequence1.) This is a [code-challenge](/questions/tagged/code-challenge "show questions tagged 'code-challenge'"), which will have you write code ...
[Question] [ In [@Adám's](https://codegolf.stackexchange.com/users/43319/ad%C3%A1m) [Dyalog APL Extended](https://github.com/abrudz/dyalog-apl-extended), the `⍢` (under) operator means conjugation: apply one function, then a second function, then the inverse of the first. It's fun to think of real-life actions in t...
[Question] [ Let's define a simple language that operates on a single 8-bit value. It defines three bitwise operations (code explanation assumes 8-bit `value` variable): * `!` Negate the least significant bit (`value ^= 1`) * `<` Wrapping left-shift (`value = value << 1 | value >> 7`) * `>` wrapping right-shift (`v...
[Question] [ ## Introduction Sometimes I get bored and there are no new questions on PPCG, so I want you to dig a random question from PPCG's past. ## Challenge Given a user's PPCG ID as input (e.g. my ID is *30525*), output the URL of a randomly chosen PPCG question. If the question does not meet the following cri...
[Question] [ # Introduction Here in Germany the ruling on work times is very strict. If you work 6 or more hours a day, you have to take at least a 30 minute break. If you work 9 or more hours, you need to take a 45 minute break. If you work less than 6 hours, you don't have to take any breaks. Of course you can sp...
[Question] [ (massive thanks to El'endia Starman and Sp3000 for helping me design test cases for this!) Given a positive integer `n` and a list of positive integer rotational periods for a number of clock hands (in seconds), output the smallest positive integer `x` where `x` seconds after starting the clock with al...
[Question] [ Given the number of vertices `n ≥ 3` and the "step size" `1 ≤ m < n/2` (indicating the distance between two connected vertices), output a graphical representation of the corresponding [regular polygram](https://en.wikipedia.org/wiki/Polygram_(geometry)). If the polygram consist of multiple closed loops...
[Question] [ ## Background There are two people, Bill and John. One of them is a knight, which always tells the truth, and the other is a knave, which always tells a lie. You don't know who is the knight and who is the knave. Each person then says several statements about who is the knave and who is the knight. Usi...
[Question] [ In this challenge you must write a computer program that creates a stack of a thousand identical \$1 \times 1\$ frictionless homogeneous blocks such that each block is supported and the stack is stable under gravity when placed on the edge of a table which spans from \$x = -\infty\$ to \$0\$ horizontal...
[Question] [ As the title says, you are to create a pristine program in as many languages as possible. A pristine program, taken from [here](https://codegolf.stackexchange.com/q/63433/66833), is: > > Let's define a *pristine program* as a program that does not have any errors itself but will error if you modify it...
[Question] [ # Satisfying Rounding You know when you're in science class, and asked to round to 2 sig figs, but your answer is `5.2501...`? You should round to `5.3`, but that's just so unsatisfying! By rounding to `5.3`, you're off by a whole 0.05, which is a large amount compared to 0.1 (the place value you're ro...
[Question] [ **Given, in any way and order,** * dimensions (in whichever order you want) * a probability (in whatever format you want) * number of iterations (you may choose whether to count the initial state or not) **do *one* of the following:** * animate, or * output each step of, or * return a list of states of...
[Question] [ Given a non-negative integer `N`, output the smallest odd positive integer that is a strong pseudoprime to all of the first `N` prime bases. This is OEIS sequence [A014233](https://oeis.org/A014233). ## Test Cases (one-indexed) ``` 1 2047 2 1373653 3 25326001 4 3215031751 5 ...
[Question] [ **Example run added 4/11** **Rules Clarification 4/8: All submissions will be competing in one giant free-for-all tournament consisting of as many matches as my computer can perform in 48 hours.** Anyone who's spent any time watching streams on Twitch is aware of the prevalence of [DeepBot](http://deep...
[Question] [ Referencing [xkcd 1688](https://xkcd.com/1688/): [![guide](https://i.stack.imgur.com/xYMpp.png "Does the screeching chill your blood and herald death? If yes, banshee. If no, seagull.")](https://i.stack.imgur.com/xYMpp.png "Does the screeching chill your blood and herald death? If yes, banshee. If no, ...
[Question] [ This is essentially the same thing as [this](https://codegolf.stackexchange.com/questions/76893/optimal-solution-to-go-to-opposite-corner-of-a-rectangle) question, except harder. You are again to write a program that gets from the lower-left corner of a rectangle to the upper-right corner. **However, t...
[Question] [ # Bounties *No. 1 (**awarded**)* > > I'll throw in 50 rep for the first valid answer > > > *No. 2 (**awarded**)* > > I'll throw in another 100 rep for the shortest valid answer. > > > *No. 3 (**open for submissions**)* > > I'll throw in 200 rep for the first one with a significant shorter vali...
[Question] [ # Express a number Back in the 60s, the French invented the TV game show "Des Chiffres et des Lettres" (Digits & Letters). The goal of the Digits-part of the show was to come as close as you can to a certain 3-digit target number, using some semi-randomly selected numbers. The contestants could use the...
[Question] [ The [MU puzzle](https://en.wikipedia.org/wiki/MU_puzzle) is a puzzle in which you find out whether you can turn `MI` into `MU` given the following operations: 1. If your string ends in `I`, you may add a `U` to the end. (e.g. `MI -> MIU`) 2. If your string begins with `M`, you may append a copy of the ...
[Question] [ Write a program that prints the following 80-character line: > > This program from codegolf.stackexchange.com permutes itself to encode a string. > > > then accepts one line of input, then prints its source code with its [code points](//en.wikipedia.org/wiki/Code_point) possibly reordered (none add...
[Question] [ # Notation and definitions Let \$[n] = \{1, 2, ..., n\}\$ denote the set of the first \$n\$ positive integers. A [polygonal chain](https://en.wikipedia.org/wiki/Polygonal_chain) is a collection of connected line segments. The *corner set* of a polygonal chain is a collection of points which are the e...
[Question] [ You're a farmer and your flock of sheep has escaped! Oh no! Round up those sheep by building fences to contain them. As a farmer on a budget you want to use the least amount of fence possible. Luckily for you though, they aren't the smartest sheep in the world and don't bother moving after having escap...
[Question] [ ## Rules The program should receive a string/array of words as input. For each word in the string/array, it will reconstruct the word by taking characters in alternating fashion from the front and back of the word. 12345 678 9 -> 15243 687 9. It will then rearrange the words in an alternating fashion b...
[Question] [ > > **Note**: As per [consensus on Meta](http://meta.codegolf.stackexchange.com/questions/8897/should-questions-about-challenge-writing-be-on-topic/8906#8906), [challenge-writing](/questions/tagged/challenge-writing "show questions tagged 'challenge-writing'") questions are on topic here. > > > In ...
[Question] [ This is a challenge inspired by [Chebyshev Rotation](https://codegolf.stackexchange.com/questions/96410/chebyshev-rotation). I suggest looking at answers there to get inspiration for this challenge. Given a point on the plane there is a unique square (a rectangle with equal sides) that is centered on t...
[Question] [ Take a 2D region of space divided into axis aligned unit square elements with their centers aligned at integer intervals. An edge is said to be internal if it is shared by two elements, otherwise it is an external edge. Your goal is to find the minimum number of neighboring elements which must be trave...
[Question] [ The [Alternating Harmonic Series](https://en.wikipedia.org/wiki/Harmonic_series_(mathematics)#Alternating_harmonic_series) is a well known convergent series. ![1/1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + ...](https://latex.codecogs.com/gif.latex?%5Cdpi%7B120%7D&space;%5Clarge&space;%5Cfrac%7B1%7D%7B1%7D-%5Cfra...
[Question] [ Cluck cluck. No one knows why the chicken crossed the road, maybe there was a good looking rooster on the other side. But we can figure out how. Write a program, that, left to right, crosses this (or any) "road". ``` 1356 | 1738 3822 | 1424 3527 3718 9809 | 5926 0261 | 1947 7188 4717 6624 | 9836 40...
[Question] [ *I want to try a new form of code golf here. Similar to bonuses, not all parts of the challenge have to be completed, but each answer has to implement a subset of certain size (and there is a core that every answer has to implement). So besides the golfing this challenge also involves choosing a set of...
[Question] [ You are given a board position for a [Go game](http://en.wikipedia.org/wiki/Go_%28game%29) and a move to play. You need to output whether the move is legal or not, and the new board position if it is legal. A brief explanation of Go moves: the game consists of alternatively placing black and white piec...
[Question] [ This is a [code-challenge](/questions/tagged/code-challenge "show questions tagged 'code-challenge'") with a custom scoring system, where **the lowest score wins.** ## Introduction Many smartphones allow to enter text by [swiping](https://youtu.be/-zWowDurQyo?t=6s) your finger across the 2D virtual key...
[Question] [ A [primitive element](https://en.wikipedia.org/wiki/Primitive_element_(finite_field)) of a finite field is a generator of the multiplicative group of the field. In other words, `alpha` in `F(q)` is called a primitive element if it is a primitive `q−1`th root of unity in `F(q)`. This means that all the ...
[Question] [ Some text-based rogue-likes don't let you walk into walls, and give you your move back if you try to. Why do that when you can make the player move in the closest valid direction? ## The challenge Write a program of function that, given a direction and a 3 by 3 grid of characters, outputs the same grid...
[Question] [ Here are five images of pears and a [steel](http://chat.stackexchange.com/transcript/message/21980433#21980433) [chute](http://chat.stackexchange.com/transcript/message/21980333#21980333): > > **A:**[![pears A](https://i.stack.imgur.com/E8CYus.png)](https://i.stack.imgur.com/E8CYu.png) **B:**[![pears ...
[Question] [ # Easter Egg Hunt Bot find egg before bunny find egg. Bot happy. ## Overview This is a [king-of-the-hill](/questions/tagged/king-of-the-hill "show questions tagged 'king-of-the-hill'") challenge in honor of Easter and the Easter egg hunting tradition! Your bot has a vision of two spaces in every direct...
[Question] [ The [flick input method](https://en.wikipedia.org/wiki/Japanese_input_method#Flick_input) is a way of inputting Japanese kana on a modern smartphone. It is arranged in a 12-key layout, with the following labels: ``` あかさ たなは まやら 小わ、 ``` When a key is tapped, it produces its respective kana. However, whe...
[Question] [ Given a string, your task is to collapse it into a zigzag-like structure as described below. ## Folding into a Zigzag We'll take the string `"Mississippi"` as an example: 1. First, output the longest prefix consisting of unique characters only: ``` Mis ``` 2. When you reach the first duplicate charact...
[Question] [ # Description Let a permutation of the integers `{1, 2, ..., n}` be called *minimally interpolable* if no set of `k+2` points (together with their indices) fall on a polynomial of degree `k`. That is, 1. No two points fall on a horizontal line (0-degree polynomial) 2. No three points fall on a line (...
[Question] [ # Challenge: I have thousands of songs in my music collection, and luckily for me, my favorite player has a search function. I also have a great memory—I can remember the title of every song in my collection. However, I'm very lazy and don't like to type—each extra keystroke is a chore! * What is the s...
[Question] [ We've all heard of the [Knight's Tour](https://en.wikipedia.org/wiki/Knight%27s_tour) puzzle: find a route for a knight that passes through all the squares on a chess board. But let's be honest, it's a little bit boring. So, let's give the knight a bit of a challenge. ## Task Write a program that takes...
[Question] [ Given an input date, your entry will output the full list of supported versions of the [Ubuntu Linux distro](http://www.ubuntu.com/) on that date. The [full list of all releases](https://en.wikipedia.org/wiki/List_of_Ubuntu_releases#Table_of_versions) is as follows: ``` Version Code name Rel...
[Question] [ You should write a program or function which given a starting order of distinct one-digit positive integers and the length of the track as input outputs or returns the finish order of the numbers. The input `[5,1,2,6,7] and 14` defines the following race: ``` -------------- 76215 -> -------------- ``` ...
[Question] [ Working on something in probability theory, I stumbled across another combinatorical exercise. These are always fun to solve, searching for intelligent approaches. Of course, one can use brute force for the following task, but this challenge is restricted complexity, so this is not allowed. ## Task Giv...
[Question] [ Your task is, given a family tree, to calculate the Coefficient of Inbreeding for a given person in it. ## Definition The Coefficient of Inbreeding is equal to the Coefficient of Relationship of the parents. The Coefficient of Relationship between two people is defined as weighed sum over all common an...
[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/102385/edit). Closed 7 years ago. [Improve this question](/posts/102385/edit)...
[Question] [ There's quite a lot of work that's been done in the world of chess. For example, there is a standardized file format, [`.pgn`](https://en.wikipedia.org/wiki/Portable_Game_Notation), that describes a chess game, including the list of moves. Additionally, there's another file format [`.fen`](https://en.w...
[Question] [ Given a pattern representing a list of lengths, and a string representing those lengths, do they match? For those interested, this is question equivalent to verifying if a row or column of a [Nonogram](https://en.wikipedia.org/wiki/Nonogram) may be correct. However, I have omitted all language relating...
[Question] [ This is an endgame board of Settlers of Catan: ![Catan board](https://i.stack.imgur.com/KaDsA.jpg) # Background: The roads (the long stick pieces) and the settlements (and cities) are rendered by the little huts. We encode the placement of these pieces by using the following scheme: From the top, we ha...
[Question] [ A theorem in [this paper](https://www.sciencedirect.com/science/article/pii/0024379594905096)1 states that every integral n-by-n matrix **M** over the integers with **trace M = 0** is a *commutator*, that means there are two integral matrices **A,B** of the same size as **M** such that **M = AB - BA**....
[Question] [ For my CS class, my instructor has given us the assignment of creating a rectangle made of asterisks with diagonal lines drawn through it in Java. He also told us to write it in as few bytes as possible. I've gotten it down to 190 bytes, but I need to find a few to simplify this code even more to decre...
[Question] [ What could be more polar opposites than chess and [demolition derby](https://en.wikipedia.org/wiki/Demolition_derby). You would think that no one who enjoys one would enjoy the other... until today. # Rules The starting position is a standard chess board: ``` RNBQKBNR PPPPPPPP PPPPPPPP RNBQKBNR ``` L...
[Question] [ We've had a lot of challenges on differentiation and integration, but none on just solving related rates problems. So in this challenge, you will get a bunch of derivatives (They will be numeric, not in terms of any variables) and have to find another derivative. The input will come in a newline separa...
[Question] [ Here is a list of some common [ligatures](https://en.wikipedia.org/wiki/Typographic_ligature) in Unicode (the ones I could create with my Compose key on Debian): ``` Orig Ascii Lig ae [ae] æ AE [AE] Æ oe [oe] œ OE [OE] Œ ij [ij] ij IJ [IJ] IJ ff [ff] ff fi [fi] fi ...
[Question] [ # This is what I thought [this question](https://codegolf.stackexchange.com/q/55574/7416) was going to be, before I fully read it. A group of code golfers walk into The Nineteenth Bite Pizzeria and order a pizza. It comes in an irregular shape, made of unit squares. Your task is to help them cut it in...
[Question] [ > > **Austin:** "Who sent you?" > > > **Mustafa:** "You have to kill me!" > > > **Austin:** "Who sent you?" > > > **Mustafa:** "Kiss my ass, Powers!" > > > **Austin:** "Who sent you?" > > > **Mustafa:** "Dr. Evil." > > > (...) > > > **Mustafa:** "I can't stand to be asked the same quest...
[Question] [ Given an array of \$n\$ positive integers we will say its *self-sum order* is the number of ways to add elements from it to make \$n\$. We will count ways as distinct up to associativity. So \$1+(2+3)\$ and \$(1+2)+3\$ are not counted as separate ways to make 6, but \$2+4\$ and \$4+2\$ are counted as s...
[Question] [ ## The task A string `S` is constructed with the following process: 1. Start with `S` being the empty string. 2. Insert at some position of `S` a string of the form `ds`, where `d` is a nonzero digit and `s` is a string of `d` lowercase ASCII letters. We say `ds` is a *constituent* of `S`. 3. Go to ste...
[Question] [ Prime numbers have always fascinated people. 2300 years ago Euclid wrote in his "Elements" > > A prime number is that which is measured by a unit alone. > > > which means that a prime is only divisible by `1` (or by itself). People have always looked for relations between prime numbers, and have co...
[Question] [ *"Let's face it, aligned images are like little gifts from Heaven. Welcome, but unexpected."* - Geobits +10000 reputation to whoever wins this challenge. # Rules: 1) You are to generate a program. 2) Input will be an image, however whether it is passed as a file or a list of numbers is up to you. 3) Ou...
[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....