text
stringlengths
180
608k
[Question] [ Write a **`Notes and Crosses`** application. User interface is optional. You can output the computers move in text: eg `1x1` (meaning center square) The computer must play an intelligent (extra marks for optimal) game. Apart from its first move which should be random. Player computer take turns a...
[Question] [ [What does "jelly" mean in the title?](https://www.cyberdefinitions.com/definitions/JELLY.html). [Cop's thread](https://codegolf.stackexchange.com/q/222477/66833) Robbers, you are to choose an uncracked Cop answer, and attempt to find a Jelly program which is: * shorter than the Cop's answer * solves...
[Question] [ Every so often I have a function of type `a -> b` and a function of type `b -> b -> c` and I would like a function of type `a -> a -> c`. For example if I wanted to check the second element of each two tuples were equal ``` snd :: (a , b) -> b (==) :: Eq a => a -> a -> Bool ``` And I want something o...
[Question] [ # Can this container hold this much liquid? ### Challenge Synopsis As you most likely know, [liquids](https://en.wikipedia.org/wiki/Liquid) have an indefinite shape and a definite volume. As such, they always take the shape of their container. They cannot, however, expand to fill their container. You...
[Question] [ # Introduction Write a program to calculate the partial derivative of a polynomial (possibly multivariate) with respect to a variable. # Challenge Derivatives are very important mathematical tools that has been widely applied in physics, chemistry, biology, economics, psychology and more to handle al...
[Question] [ [This challenge](https://codegolf.stackexchange.com/q/139034/47581) posed an algorithm for encoding an integer `n` as another integer `r`. What follows is a succinct explanation of that algorithm, using `n=60` as an example. **The original algorithm** * First, we encode the number as a string of brac...
[Question] [ The game of Ghost is played between two players who alternate saying a letter on each turn. At each point, the letters so far must start some valid English word. The loser is the player to complete a full word first. So, for example, if the letters so far are E-A-G-L, then the only valid next letter ...
[Question] [ Let's say we have a **n × n** lattice; we can then divide the lattice into two sections by drawing a line through the lattice. Everything to one side of the line is in one set and everything else in another. How many ways can we divide the lattice in the manner? For example lets take a **2 × 2** latt...
[Question] [ Do you have any [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") tips for writing in [SOGL](https://github.com/dzaima/SOGL), a golfing language created by [dzaima](https://codegolf.stackexchange.com/users/59183/dzaima)? Your tips should be at least somewhat specific to [SO...
[Question] [ Write a program or function that alters the file at a user-specified filename via replacing all instances of UNIX line endings with Windows line endings and vice versa. Clarifications: * For the purposes of this problem, a UNIX line ending consists of the octet `0A` in hexadecimal, except when it is ...
[Question] [ # Introduction The four basic math operators (+, -, \*, /) can be reduced to just two, due to the fact that: ``` x + y = x - (-y) x * y = x / (1/y), y != 0 x * 0 = 0/x ``` # Challenge The challenge is to take input as a "string" containing: * Numbers * Single character variables ("x", "y") * The four...
[Question] [ You have to write an interpreter for a cool language called [Chicken](https://esolangs.org/wiki/Chicken)! You should read a Chicken program from a file, standard input, program or function arguments, or whatever is most convenient for your language, as well as input to the program. You should print ...
[Question] [ Resistors and other electronic components are typically manufactured with values that conform to one of the [E-series](https://en.wikipedia.org/wiki/Preferred_number#E_series) of [preferred numbers](https://en.wikipedia.org/wiki/Preferred_number). IEC 60063 defines the following E-series: > > ### E6...
[Question] [ While there are only a few users of the [Vitsy programming language](https://github.com/VTCAKAVSMoACE/Vitsy) right now, I wish to create a place for tips for golfing in Vitsy. What general tips do you have for golfing in [Vitsy](https://github.com/VTCAKAVSMoACE/Vitsy)? I'm looking for ideas that can ...
[Question] [ **Objective** The black pawn wants revenge. Plot out its last attack. **Rules** The black pawn (`L`) starts at the top row and moves downwards to the bottom row. Maximise points taken, indicating the path with `X`. Pawns (`P`) are 1, bishops (`B`) and knights (`N`) 3, rooks (`R`) 5, and queens (`Q`) ...
[Question] [ **Introduction** This challenge is about three (bad) sorting algorithms: [`Bogosort`](http://en.wikipedia.org/wiki/Bogosort), and two others variants that I came up with (but have probably been thought of by others at some point in time): `Bogoswap` (AKA Bozosort) and `Bogosmart`. `Bogosort` works b...
[Question] [ # Now with BONUS for run-time placement. Write a program to fill a text box with the identifiers used in your program while keeping your program small. With all the identifiers you have used (excluding those *you* created) in your program, fill a 12x6 box with as many as you can. You get extra point...
[Question] [ # Bricks and Stability Defined *This question uses the same definition of bricks and stability as [Is the brick structure stable?](https://codegolf.stackexchange.com/questions/38548/is-the-brick-structure-stable)* Let `[__]` represent a [masonry brick](http://en.wikipedia.org/wiki/Brick) and ``` ...
[Question] [ ## Problem I've got a GREAT new program that will change the way we think about math in computing, taking in strings of algebraic functions and doing AMAZING things with them! The only problem, is that I am only able to parse specific algebra, otherwise the universe folds into itself, which is bad. F...
[Question] [ The challenge is a follow-up to [Filter a large file quickly](https://codegolf.stackexchange.com/questions/26643/filter-a-large-file-quickly) which had two submissions where were as fast as wc! This time the difficulty is that RAM is severely restricted which means that new methods will have to be us...
[Question] [ Write a program, which, upon gazing at a chess table, can say whether there is a check or a checkmate. **Input**: a chess table in text form, the last line of the input being the first rank (the starting line of White) The starting position in this input would look like this (space is an empty square...
[Question] [ Goal is to write the shortest possible C89 and C99-compliant single-module C program which will compute and print out a single-line string whose sort order will correspond with the date given by the predefined `__DATE__` macro (in other words, later dates will yield later-sorting strings). The progra...
[Question] [ ## Challenge Write a program which, given a 2-dimensional boolean array (equivalently, a monochromatic bitmap), outputs a series of polygons that describe the outline of the region that is “true” (1). The input is provided as a sequence of `'#'` (hash), `' '` (space) and `\n` (newline) characters. Li...
[Question] [ Earlier I asked about this problem on stackoverflow ([link](https://stackoverflow.com/questions/77856631)), but now I also want to see the golfiest solutions ## Problem: Given an array of arbitrary numbers, what is the longest subarray that is repeated (appears more than once)? In case there are mult...
[Question] [ [Level-index](https://en.wikipedia.org/wiki/Symmetric_level-index_arithmetic) is a system of representing numbers which has been proposed as an alternative to floating-point formats. It claims to virtually eliminate overflow (and underflow, in its symmetric form) from the vast majority of computation...
[Question] [ A polyiamond of size \$n\$ is a contiguous shape formed by joining \$n\$ equilateral triangles side by side. Your output should consist of two distinct characters, plus whitespace as necessary (▲ and ▼ work great!). Trailing whitespace is acceptable. You may use any other characters - but you may cou...
[Question] [ There is a 3x3 square block made of 1x1 square blocks, with coins in each 1x1 block, starting from top left block you want to collect all the coins and return to top left block again, if possible provide instructions to achieve this. Rules * From block \$(x,y)\$ in one step you can move right(R) to \...
[Question] [ *Caves and Cliffs edition* [Part 1](https://codegolf.stackexchange.com/questions/241136/is-this-continuous-terrain), [Very related](https://codegolf.stackexchange.com/questions/181708/would-this-string-work-as-string?noredirect=1&lq=1) You're given a piece of ASCII art representing a piece of land, l...
[Question] [ # Introduction Formula One is a complex sport and as with complex sports, strategy is very important.Some teams will manage better strategy than others and those teams will often win the races. After last weekends' amazing German GP, which saw last years Champion Lewis Hamilton pit 6 times (in compar...
[Question] [ In this challenge, your bot has landed on an island with the stereotypical knights and knaves. Knights always tell the truth, and knaves always lie. The objective is to find the correct 32 digit hexadecimal string before anyone else, by asking knights and knaves and trying to trick other bots into gi...
[Question] [ Inspired by both the [challenge "Unique is Cheap"](https://codegolf.stackexchange.com/questions/127261/unique-is-cheap) by [*@Laikoni*](https://codegolf.stackexchange.com/users/56433/laikoni), where the score is based on the challenge itself, as well as the [JavaScript (ES6) answer](https://codegolf....
[Question] [ ## Challenge Given any positive integer supported by your language: 1. Take the input and divide it into two halves. For all divisions in this program, if the input is odd, round one half up and one half down (ex: `7 -> 3,4`, not `7 -> 3.5,3.5`). 2. Divide either number in half, then take the larger ...
[Question] [ *Inspired by [this.](https://chat.stackexchange.com/transcript/message/39743330#39743330)* Given a string as input consisting of only upper and lowercase alphabet characters, **wicka-wub** it. ### How do I wicka-wub a string? The example text used is "DJMcMayhem". Split the string before each capital...
[Question] [ *This is the cops' post. The robbers' is [here](https://codegolf.stackexchange.com/q/140862/58826).* You make a program and a regex. For most inputs, one of the following happens: * the regex doesn't match, and the program returns a falsey value * the regex doesn't match, and the program returns a tr...
[Question] [ This challenge is adapted from the [British Informatics Olympiad](https://www.olympiad.org.uk/). --- ## Dice game Two players are playing a dice game where they each roll a pair of dice, and the highest sum wins. The pairs of dice have the same number of sides, but do not have to have the same values...
[Question] [ We have a Brainf\*\*\* to TinyBF converter, but not the other way around, so here's one. ## Rules: * Your interpreter must take a valid TinyBF program, on one line, and it must output the corresponding BrainF\*\*\* program, on one line, with optional trailing whitespace/newline. No leading whitespace...
[Question] [ User quartata posted [this challenge](https://codegolf.stackexchange.com/q/60147/7416), but he neglected the fact that, for whatever reason, he's not able to play MIDI files on his computer. Let's help him out by writing a full program that reads a song in RTTTL format from the standard input, prints...
[Question] [ # Zig-zag strings Given a string and a positive integer, output the string in a zig-zag wave pattern with a peak amplitude and character spacing equal to the integer. This is similar to this [question](https://codegolf.stackexchange.com/questions/35257) but also includes character spacing. ## Input ...
[Question] [ The [Library of Babel](https://en.wikipedia.org/wiki/The_Library_of_Babel) is defined as > > a universe in the form of a vast library containing all possible > 410-page books of a certain format and character set. > > > For the purposes of this question, each page of the book contains 40 lines ...
[Question] [ # Introduction *Jim* and *Bob* are playing badminton doubles against two other players, but mid-game they face a dilemma: After a fast-paced rally they have no idea who has to serve next and where they have to stand for the next serve. Bad enough they only know the scores in order. ## Rules: To h...
[Question] [ # The problem Through a terrible procastination accident you are reborn as Scrooge McDuck for a day. To make the most out of the situation you decide to give away food to the poor. Since you also are a mathematician you store the food in a vector `v(1,2,3)`. You want to give each family approximatel...
[Question] [ # Background Imagine, you have a big array `A`, which is mostly zeroes, but contains a short subarray `B` which has only strictly positive entries. For instance: ``` | A | [0 0 0 0 1 2 3 0] | B | ``` Now say, we split the array `A` into ...
[Question] [ WinAli is a model assembler for Windows. It emulates a real CPU and is meant to help students learning and understanding the Assembly language. German Wikipedia article: <http://de.wikipedia.org/wiki/WinAli> (there is no english article at the moment) In case you want to test your produced output: [L...
[Question] [ The goal of a Rosetta Stone Challenge is to write solutions in as many languages as possible. Show off your programming multilingualism! ## The Challenge We've done run-length encoding [be](https://codegolf.stackexchange.com/q/1015/8478)[fore](https://codegolf.stackexchange.com/q/7320/8478) but only ...
[Question] [ You have found the [path through the forest](https://codegolf.stackexchange.com/questions/36404/the-forest-path) and now plan on travelling along it. However, just before you start on your journey, the ground turns into lava. You manage to scurry up the nearest tree (the trees have inexplicably not ...
[Question] [ I want to compactly code positive integers `x` into bits, in a manner allowing decoding back into the original integers for a stateless decoder knowing the maximum value `m` of each `x`; it shall be possible to uniquely decode the concatenation of encodings, as is the case in Huffman coding. [The a...
[Question] [ The type 4 GUID is described by Wikipedia, quoth: > > Version 4 UUIDs use a scheme relying only on random numbers. This algorithm sets the version number (4 bits) as well as two reserved bits. All other bits (the remaining 122 bits) are set using a random or pseudorandom data source. Version 4 UUIDs...
[Question] [ (Better known as [3D Tic Tac Toe](http://en.m.wikipedia.org/wiki/3-D_Tic-Tac-Toe); I just made up a name that sounded catchy ;-[) )](http://xkcd.com/541/) Let two people play this game against each other. Specifications: * Output + the easiest way of explaining this will be with an example: `...
[Question] [ An [illegal prime](https://en.wikipedia.org/wiki/Illegal_prime) is a prime number which encodes information that is illegal to possess - specifically, in one case, a gzip file of the [source code of DeCSS](https://en.wikipedia.org/wiki/File%3aDeCSS.PNG), a piece of software to decrypt copy-protected ...
[Question] [ This is a challenge that was originally a tas for the German *Bundeswettbewerb Informatik* (federal competition of computer science [?]), a competition for highschool students. As opposed to the original question, where you have to find a good solution and write some documentation, I want you to golf...
[Question] [ You are given *n* (200 ≤ *n* < 250) as a command line argument. Print 10 prime numbers with *n* digits. Your program should run under 1s and must be shorter than 5000 bytes (excluding). Sum the digits of all your 500 primes. Program with the largest sum wins. An example (more [here](http://primes.ut...
[Question] [ Write the shortest program you can in any language that reads a context-free grammar from and the number of sentences to produce from `stdin`, and generates that many random sentences from the grammar. **Input** Input will come in the following format: ``` n <START> {"<A>":["as<A>df","0<A>","<B><C>"...
[Question] [ Given a positive integer \$N >= 4\$, output an RSA key pair (both the private and the public key) whose key length is \$N\$ bits. The RSA key generation algorithm is as follows: 1. Choose an \$N\$-bit semiprime \$n\$. Let the prime factors of \$n\$ be \$p\$ and \$q\$. 2. Compute \$\lambda(n) = LCM(p-...
[Question] [ ~~[This question asking us to make a "Cyclic Levenquine"](https://codegolf.stackexchange.com/questions/116189/cyclic-levenquine) has gone unanswered~~. So today we will ask a slightly simpler version. In this challenge we will define a **K**-Levenquine to be a program whose output is Levenshtein dist...
[Question] [ In this challenge you have to make an ascii pulsing heart with rhythm problems (Heart arrhythmia) and then measure the pulse.Don't worry it's easy! **Making the heart** The heart alternates between these 2 states: ***state 1*** ``` ,d88b.d88b, 88888888888 `Y8888888Y' `Y888Y' ...
[Question] [ # This is not an invitation for you to downvote everything I've posted. Just sayin' ;) # Challenge Figure out how I can get myself back down to 1 reputation. Details will follow input format, then followed by output. # Input Input will consist of the my current reputation, the number of questions I h...
[Question] [ I am trying to use C# to find the index of the first 1 (right to left) in the binary representation of a number. For example, since 100 in binary is: ``` 0b1100100 ``` The first 1 is in the third position from the right, so it should yield 3. 234 should yield 2, 0 should yield 0, etc. Here is my curr...
[Question] [ ## Background The language BrainF\*\*\* (or simply BF), is an extremely minimal programming language. We're going to strip it back even further by eliminating IO operations; only the sub-langage defined by the operations `+-<>[]`, henceforth referred to as BF-subset, shall be used. The BF variant con...
[Question] [ # Challenge description Let's define an `W` x `H` **grid** as a two-dimensional array of length `H` whose each subarray is of length `W`. Example: a 2x3 grid (`.` character used as a blank): ``` .. .. .. ``` A **unit** is a single point of a grid. A **block** is either a single unit or a set of conti...
[Question] [ ``` This is Markov. Markov's golf ball rolls around randomly. Markov's ball will hole however he strikes it. Markov is smart. Be like Markov. ``` And this: [![enter image description here](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b2/Indian_Harvester_Ant_Nest.JPG/160px-Indian_Harvester...
[Question] [ ### Introduction Right now I'm participating a chess tournament. I got inspired by the tournament schedule. Right now, I'm in a competition with three other players. That means with the four of us, we are playing 3 rounds. The schedule goes as following: ``` Round 1: 1-4 3-2 Round 2: 3-4 2-1 Round 3:...
[Question] [ A fun programming exercise is to write a program that quizzes the user from a set list of questions and answers. However, this task goes a level beyond that. ## Your task * Write a program/func/etc. that takes two lists: A list of questions and a list of answers. * Output a program that quizzes the u...
[Question] [ This serves as a catalog for tips related to golfing in [Burlesque](http://esolangs.org/wiki/Burlesque). Burlesque is a lazy, esoteric programming language. It's mostly used on anarchy golf while popularity on Codegolf is not as high. However, this catalog is intended to be used by people golfing on ...
[Question] [ **This question already has answers here**: [Polynomial Laplace transform](/questions/216880/polynomial-laplace-transform) (18 answers) Closed 3 years ago. Your goal is to write a program that will print out the Laplace transform of a polynomial function with integer coefficients \$f(x)\$. The...
[Question] [ The challenge is about finding an optimal solution on how to place a number of given shapes. It is oriented on the principle of Tetris, where it is optimal to pack the given pieces as tight as possible. An optimal solution means that all shapes could be placed in one rectangle block filling the width...
[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 9 years ag...
[Question] [ A bit of an unusual one, but hey, why not? :) **The objective:** Write a functioning IRC daemon in your language of choice that provides barebones functionality, in as few characters as possible. As long as it fulfills the criteria below, it does *not* have to fully comply with the IRC RFCs (this wou...
[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 1 year ago...
[Question] [ Using any programming language that supports functions, have the function ``` is_enough(strArr) ``` that take `strArr` which will be an an array consisting of the following elements: * `N` which will be the number of gas stations in a circular route * and each subsequent element will be the string ...
[Question] [ In this challenge, you will recieve a comma-separated list of weights as input, such as ``` 1,3,4,7,8,11 ``` And you must output the smallest amount of weights that can add to that set. For example, the output for this set would be ``` 1,3,7 ``` Because you could represent all of those weights with j...
[Question] [ Your task is to write a program that will take input like this: ``` a + b * c + a / 2 ``` and will *generate the source code for a program* that takes user input and then evaluates the expression. The expression can contain the operators `+`,`-`,`*`,`/`; single-letter lowercase variables; and intege...
[Question] [ ## Introduction In Android Studio and other IDEs there are code completions to assist efficient code insertion (especially when the names of the classes or methods are so verbose), like the one in the image below. [![enter image description here](https://i.stack.imgur.com/5sGzc.png)](https://i.stack....
[Question] [ Reversible computation refers to computation in which little or no information is deleted. Reversible computation a major component of quantum computation, and reversible computation is potentially many times more energy efficient than conventional computation. I want to know how easy it is to comput...
[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/163290/edit). Closed 5 years ago. [Improve this question](/posts/163290/edi...
[Question] [ Given a stream of bits, output the shortest possible [Hamming code](https://en.wikipedia.org/wiki/Hamming_code) that encodes it. The steps to generate the Hamming code are as follows, although your submission does not necessarily have to conform to them as long as it produces identical output. The in...
[Question] [ I saw this recent Puzzling question: ### [Add parentheses to make this true](https://puzzling.stackexchange.com/questions/51818/add-parentheses-to-make-this-true) And saw that [one answer used a Python script to try all possibilities](https://puzzling.stackexchange.com/a/51855). Your challenge is, g...
[Question] [ ## Background By expanding and cancelling terms, it is easy to show the following identity: [![enter image description here](https://i.stack.imgur.com/hgKDi.gif)](https://i.stack.imgur.com/hgKDi.gif) However, it is an open problem whether all 1/n-by-1/(n+1) rectangles can tile the unit square. ## The...
[Question] [ Your task is to, with an input number `p`, find the smallest positive cannonball number of order `p` that is NOT 1. ### Definition A cannonball number (of order `p`) is a number which is both: * An `p`-gonal number ([See this page](https://en.wikipedia.org/wiki/Polygonal_number)). * and an `p`-gonal ...
[Question] [ Everyone knows what run-length encoding is. It has been the subject of many code-golf challenges already. We'll be looking at a certain variation. ### Example ``` Normal: 11222222222222222222233333111111111112333322 Run-length: 112(19)3(5)1(11)2333322 ``` The number in parentheses specifies the numbe...
[Question] [ # The Challenge Given an arbitrary amount of rectangles, output the total count of intersections of those when drawn in a 2D plane. An intersection here is defined as a point `P` which is crossed by two lines which are orthogonal to each other and are both not ending in `P`. ### Example Each rectangl...
[Question] [ Write a program or function that extracts a word from a wordsearch using its start and end coordinates. # The Input Your program or function should accept three parameters: the *start coordinate*, the *end coordinate*, and a *wordsearch* from which to extract the word. * The *start coordinate* can be...
[Question] [ [CleverBot](http://www.cleverbot.com/) is a conversational AI that works fundamentally by repeating responses from real humans it has heard previously. It starts off pretty dumb, but once the database becomes *(a lot)* larger it begins sounding more like an actual person! ## How your program should w...
[Question] [ The Method of Finite Differences is a technique used to find the next term in a sequence of numbers, given that the sequence is governed by consecutive values of a certain polynomial. Given a list of `n` terms, the Method will be able to determine the degree of the polynomial, which is a maximum of `...
[Question] [ Tony Stark is, as we know [*Ironman*](https://en.wikipedia.org/wiki/Iron_Man) (that super awesome guy in metal suit and loads of weapons). However, without the metal suit, he can't claim that title. Tony Stark, having a great ego, wants to finish [Norseman](https://en.wikipedia.org/wiki/Norseman_tria...
[Question] [ There are many types of binary operations, which can be categorized by their associative properties and their commutative properties. * A binary operation `()` is *associative* if the order of operations between operands does not affect the result — i.e. if `(a(bc)) = ((ab)c)`. * A binary operation `...
[Question] [ ![enter image description here](https://i.stack.imgur.com/o8Ogz.png) **Challenge** A Pixel World is a PNG image where gravitational, electromagnetic, and nuclear forces no longer exist. Special forces known as "pixel forces" are all that remain. We define this force as > > Fp->q = a \* (p \* q) / (r...
[Question] [ With a window similar to the one pictured below, you are given a list of strings, which you want to put in alphabetical order. ![Sort order dialog](https://i.stack.imgur.com/Tn4JU.png) As shown, you have five operations: * Move up [U] - moves the selected string up one place * Move down [D] - move...
[Question] [ Write the shortest program possible that traps the mouse cursor inside an upward pointing equilateral triangle with a side length of 274 pixels and a centroid at the exact middle of the screen. (Triangle because of cheese wedges.) While your program is running, the tip of the cursor should never be...
[Question] [ Flux is very similar to the [Fifteen Puzzle](https://codegolf.stackexchange.com/questions/6884/solve-the-15-puzzle-the-tile-sliding-puzzle). However, instead of numbers, the squares are colors. * There are 4 colors: Red, Yellow, Blue, and Gray. + There are *exactly* 4 red squares, 4 yellow squares, ...
[Question] [ Most of you have probably heard of the famous Turtle Graphics program, initially made popular by Logo. This challenge is to implement a Turtle Graphics program in your language of choice. Rules: 1. The floor must be a diagonal with dimensions input by the user through std-in in the form `x/y`, repres...
[Question] [ An ionic compound is named like so: `(metal name) (non-metal suffixed with -ide)`. Here is a list of all the suffixes that need to be replaced with `-ide`: ``` -on -ogen -ygen -ine -orus -ur -ic -ium ``` The number of atoms of each element in the compound is not used in naming ionic compounds. Ignore...
[Question] [ Your [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") challenge is to find all occurences of a word in the 3d matrix. There is no restriction on I/O format. In the samples below, the word is presented, then a blank line, then the 2-dimensional layers from top to bottom, an...
[Question] [ Normally, I'd open with some flavor text here about being bored and/or lazy but looking through the [stack-exchange-api](/questions/tagged/stack-exchange-api "show questions tagged 'stack-exchange-api'") questions that would be *far* from original. So instead I'm going to open with a meta and self-re...
[Question] [ # Counting Gems ## Background My jewel box just fell down! There're too many gems of different shape on the ground. And your task is to count number of a certain type of gem. ## I/O * Your code should take two inputs `S` and `G`, which could be a string with newlines, an array of lines, a two-dimensi...
[Question] [ The original "Blue Eyes" puzzle is given [here](http://www.xkcd.com/blue_eyes.html) (and below). > > A group of people with assorted eye colors live on an island. They are > all perfect logicians -- if a conclusion can be logically deduced, > they will do it instantly. No one knows the color of th...
[Question] [ Valve's KV file format is as follows (in pseudo-EBNF): ``` <pair> ::= <text> <value> <value> ::= <text> | <block> <text> ::= "\"" <char>* "\"" <block> ::= "{" <pair>* "}" ``` The parsing starts on `<pair>` state. Whitespace is allowed anywhere, but is only required between two consecutive `<text>` to...
[Question] [ # Goal Sometimes dinner menus can have long winded names. It's much easier for the waiter to write an abbreviation that unambiguously identifies the dish. For example, given this list: ``` beef burger chicken burger chicken nuggets ``` The abbreviation `c n` matches `chicken nuggets`. The abbreviat...
[Question] [ Have you heard about trees? When performing DFS on a binary tree, you can traverse it in 3 possible orders. * Root, left node, right node (Pre-order) * Left node, Root, right node (In-order) * Left node, right node, root (Post-order) Check [wikipedia](https://en.wikipedia.org/wiki/Tree_traversal) to...
[Question] [ # aBOTcalypse Design a bot to compete in a King-of-the-Hill challenge! [Here's a replay of a default bot game.](http://gfycat.com/AnnualBestBrontosaurus) The board is 2D, like a side-scrolling video game (but without any scrolling). A valid bot must accept a multiline string representation of the reg...
[Question] [ This is the target language-relaxed version of [Generate a self-extractor application](https://codegolf.stackexchange.com/questions/17417/generate-a-self-extractor-application) Create a program in *any* language, that takes an arbitrary binary input, and generates a valid program (also in *any* langu...