text
stringlengths
180
608k
[Question] [ Given `a, b, c` the length of the three sides of a triangle, say if the triangle is **right-angled** (i.e. has one angle equal to 90 degrees) or not. ## Input Three **positive** integer values **in any order** ## Output Either a specific true output (`true`, `1`, `yes`, ...) or a specific false output ...
[Question] [ Inspired by [this SO question](https://stackoverflow.com/q/34041614) As input you will be given a non-empty list of integers, where the first value is guaranteed to be non-zero. To construct the output, walk from the start of the list, outputting each non-zero value along the way. When you encounter a ...
[Question] [ ## The challenge: Write a very short program that, when compiled, creates the most amount of compiler warnings and errors. It can be written in any programming language. ## Scoring: The score is determined by this equation: `errors_and_warnings_length/code_length`. Highest score wins. ## Example: The C...
[Question] [ Your task, if you wish to accept it, is to write a program that outputs a positive integer (higher than 0). If the source code is duplicated the output must remain the same. The tricky part is that if the source code is typed three times **(triplicated?)** the output will be multiplied by 3. # Rules * ...
[Question] [ I noticed that there's no such question, so here it is: Do you have general tips for golfing in x86/x64 machine code? If the tip only applies to a certain environment or calling convention, please specify that in your answer. > > Please only one tip per answer (see [here](https://codegolf.meta.stackex...
[Question] [ # Do While False At work today one of my colleagues was describing the use-case for do while(false). The person he was talking to thought that this was silly and that simple if statements would be much better. We then proceeded to waste half of our day discussing the best manner to write something equi...
[Question] [ Anyone remember [Boaty](https://en.wikipedia.org/wiki/Boaty_McBoatface)? You could totally make any old word, right? * Write a function to turn a string into Somethingy McSomethingface. * It should accept one string as input. Ignore the case of the input. * If the word ends in 'y', your function should...
[Question] [ # Task Given a String as input, your task is to output `42` **only** if the input String happens to be *exactly* the following : ``` abbcccddddeeeeeffffffggggggghhhhhhhhiiiiiiiiijjjjjjjjjjkkkkkkkkkkkllllllllllllmmmmmmmmmmmmmnnnnnnnnnnnnnnoooooooooooooooppppppppppppppppqqqqqqqqqqqqqqqqqrrrrrrrrrrrrrrrrr...
[Question] [ This [king-of-the-hill](/questions/tagged/king-of-the-hill "show questions tagged 'king-of-the-hill'") challenge is based off of the game show, [Weakest Link](https://en.wikipedia.org/wiki/Weakest_Link). For those unfamiliar with the show, **the crux of this challenge deals with who you vote off**: * I...
[Question] [ The text of the children's book [*Polar Bear, Polar Bear, What Do You Hear?*](http://www.eric-carle.com/ECbooks.html#anchor009) has a very simple pattern. You might use the text to teach introductory programming concepts. My son was quickly bored by this idea, so I decided to play some golf with it ins...
[Question] [ The challenge is to write an interpreter for the [untyped lambda calculus](http://en.wikipedia.org/wiki/Lambda_calculus) in as few characters as possible. We define the untyped lambda calculus as follows: # Syntax There are the following three kinds of expressions: * A lambda expression has the form `(...
[Question] [ *This is [Calvin](https://codegolf.stackexchange.com/users/26997/calvins-hobbies). Just trying to get 20 rep so this user can chat in the [PPCG Minecraft Server chatroom](https://chat.stackexchange.com/rooms/24544/ppcg-minecraft-server).* Write a program or function that takes in a positive integer. If...
[Question] [ A [zip bomb](https://en.wikipedia.org/wiki/Zip_bomb) is a compressed file, designed so that unpacking it yields the biggest file possible. These are fairly well known, and there are examples of 42 KB files which expand into multiple petabytes of data. In this challenge, the goal is reversed. Instead of...
[Question] [ > > There's a [500 rep unofficial bounty](https://codegolf.meta.stackexchange.com/a/17479/20260) for beating the [current best answer](https://codegolf.stackexchange.com/a/41314/20260). > > > **Goal** Your goal is to multiply two numbers using only a very limited set of arithmetic operations and v...
[Question] [ This challenge is to lift the spirits of our mod [Alex A.](https://codegolf.stackexchange.com/users/20469/alex-a), who is usually [wrong](http://meta.codegolf.stackexchange.com/a/7202/26997). --- Suppose you have a friend named Alex who needs help with basic logic and math, specifically [mathematical e...
[Question] [ MS Paint was always a great time waster, but it was shunned by most graphic designers. Perhaps people lost interest because of the jarring color palette, or because of limited undo levels. Regardless, it's still possible to generate beautiful images with just the standard brush and default color palett...
[Question] [ Consider the positive integer powers of five in decimal. Here are the first 25, right aligned: ``` X 5^X 1 5 2 25 3 125 4 625 5 3125 6 15625 7 78125 8 390625 9 ...
[Question] [ The task is taken from an MIT lecture by Prof. Devadas called [You can read minds](https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-s095-programming-for-the-puzzled-january-iap-2018/puzzle-3-you-can-read-minds/). A detailed explanation of the trick can be found in the linked vi...
[Question] [ Drawing the Sierpinski triangle [has been](https://codegolf.stackexchange.com/q/38516/8478) [done to](https://codegolf.stackexchange.com/q/6281/8478) [death](https://codegolf.stackexchange.com/q/62859/8478). There's other interesting things we can do with it though. If we squint hard enough at the tria...
[Question] [ ### Introduction You have the misfortune of being stuck in a runaway car on an obstacle course. All of the car's features are non-responsive, save for the steering system, which is damaged. It can drive straight, or it can turn right. Can the car be guided to safety? ### Mechanics Your car begins in th...
[Question] [ Cut a boolean matrix in 4x2 blocks and render them as Braille characters `U+2800`...`U+28FF`. ``` [[0,1,0,0,1,0], [1,0,0,0,0,0], [1,0,0,0,1,0], [1,1,1,1,0,0]] ⣎⣀⠅ ``` Pad with 0-s if dimensions are not multiples of 4 and 2. ``` [[0,1,0], [1,0,0], [1,1,1]] ⠮⠄ ``` Usual golfing rules apply, flexible...
[Question] [ ## Background In typography, [*rivers*](http://en.wikipedia.org/wiki/River_(typography)) are visual gaps in a block of text, which occur due to coincidental alignment of spaces. These are particularly annoying since your brain seems to pick them up more easily in peripheral vision, which constantly dis...
[Question] [ ![enter image description here](https://i.stack.imgur.com/6dfRm.png) > > Your life could depend on this. Don't blink. Don't even blink. Blink and you're dead. They are fast. Faster than you can believe. Don't turn your back, don't look away, and don't blink! **Good luck.** > > > [Weeping Angels](ht...
[Question] [ You've recently made an account on a dodgy gambling site, where for a fee of 25 dollars, they will pay you back a random amount between 0 and 50 dollars. After getting around 5 dollars twice, you decide to prove the site is a scam. After accessing their external firewall with the default password, you ...
[Question] [ In [this question](https://codereview.stackexchange.com/q/245978/105327) at Code Review they tried to find the fastest way to return the unique element in an array where all the elements are the same except one. But what is the shortest code that accomplish the same thing? ### Goal Find the unique elem...
[Question] [ This challenge, while probably trivial in most "standard" languages, is addressed to those languages which are so esoteric, low-level, and/or difficult to use that are very rarely seen on this site. It should provide an interesting problem to solve, so this is your occasion to try that weird language y...
[Question] [ ### Your Programs: You'll write two programs (both in the same language). The storage program takes a string from STDIN and stores it somewhere *persistent* (see below) and then exits without error. The retrieval program takes no input, retrieves the string that was stored, and prints it to STDOUT. ###...
[Question] [ We live in a wonderful age of technology where we can have beautifully detailed 8K screens on our TVs, and even 2K displays on our phones for our mobile browsing pleasure. We've come a long way in recent years in terms of screen technology. One of the products of this is a term that was made popular b...
[Question] [ Everyone knows the Fibonacci sequence: You take a square, attach an equal square to it, then repeatedly attach a square whose side length is equal to the largest side length of the resulting rectangle. The result is a beautiful spiral of squares whose sequence of numbers is the *Fibonacci sequence*...
[Question] [ An [*Abundant number*](https://en.wikipedia.org/wiki/Abundant_number) is any number where the sum of its proper divisors is greater than the original number. For example, the proper divisors of 12 are: ``` 1, 2, 3, 4, 6 ``` And summing these results in 16. Since 16 is larger than 12, 12 is abundant. No...
[Question] [ In some nations there are recommendations or laws on how to form emergency corridors on streets that have multiple lanes per direction. (In the following we only consider the lanes going in the direction we are travelling.) These are the rules that hold in Germany: * If there is only one lane, everyone...
[Question] [ I've always liked screens full of randomly colored pixels. They're interesting to look at and the programs that draw them are fun to watch. # The challenge Fill your screen, or a graphical window, with colored pixels. # The rules * Your program must have an even chance of picking **all colors** (i.e in...
[Question] [ Former US Secretary of Defense, Donald Rumsfeld, [famously](https://en.wikipedia.org/wiki/There_are_known_knowns) popularized the phrase "known knowns." Here we're going to distill his remarks into a four-line stanza. Specifically, output this text: ``` known knowns known unknowns unknown knowns unknow...
[Question] [ Given an integer `n > 0`, output the length of the longest contiguous sequence of `0` or `1` in its binary representation. **Examples** * `6` is written `110` in binary; the longest sequence is `11`, so we should return `2` * `16` → `10000` → `4` * `893` → `1101111101` → `5` * `1337371` → `101000110100...
[Question] [ Whilst trying (and failing) have persuade my infant son to eat his dinner, I tried singing to him. Mid way through this song I realised the formulaic structure might lend itself well to code golfing! The task is to write a program or function which accepts no input and produces the following text: ``` ...
[Question] [ Inspired by [We had a unit test once which only failed on Sundays](https://qntm.org/unit), write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day. ### Rules: * No using input or showing output through the [usual IO methods](https://codeg...
[Question] [ The [Devil's Staircase](https://en.wikipedia.org/wiki/Cantor_function) is a fractal-like function related to the Cantor set. ![enter image description here](https://i.stack.imgur.com/Nwv4B.png) Your task is to replicate this funky function — in ASCII art! # Input A single integer `n >= 0`, indicating t...
[Question] [ **Closed**. This question needs to be more [focused](/help/closed-questions). It is not currently accepting answers. Closed 8 years ago. **Locked**. This question and its answers are [locked](/help/locked-posts) because the question is off-topic but has historical significance. It is not currently ...
[Question] [ This challenge is in tribute to the winner of Best Picture at the Oscars 2017, [~~La La Land~~ Moonlight!](http://www.independent.co.uk/a7598151.html) --- Your challenge is to print the text ``` La La Land ``` pause one second, then change the text to show ``` ~~La La Land~~ Moonlight ``` The origin...
[Question] [ [Pyth](https://github.com/isaacg1/pyth) is a Python-inspired procedural programming language, created by PPCG user [isaacg](https://codegolf.stackexchange.com/users/20080/isaacg). What general tips do you have for golfing in Pyth? I'm looking for ideas that can be applied to code golf problems in gener...
[Question] [ A shape is [chiral](https://en.wikipedia.org/wiki/Chirality) if no amount of rotation can make it look like it's mirror image. In this puzzle we will be writing chiral computer programs. For this puzzle we will think of a program as a rectangular matrix of characters. As such all solutions to this chal...
[Question] [ Your task is to make a program that measures how fast you can type the letters of the English alphabet. * The program shall only accept lowercase letters `a` to `z` in alphabetical order. * Each letter is echoed as typed on the same line (without new line or any other separators between letters). * If ...
[Question] [ Given an array a that contains only numbers in the range from 1 to a.length, find the first duplicate number for which the second occurrence has the minimal index. In other words, if there are more than 1 duplicated numbers, return the number for which the second occurrence has a smaller index than the...
[Question] [ For today's challenge, you must write a program or function that alternates the case of a string. However, you must ignore non-alphabetic characters. This means that every alphabetic character must have a different case than the preceding *and* following alphabetic character. This is slightly more comp...
[Question] [ What general tips do you have for golfing in The Shakespeare Programming Language? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to SPL (e.g. "remove comments" is not an answer). Please post one tip per answer. [Answer] (Well... sinc...
[Question] [ You'll be given the name of one of the 20 biggest objects in the Solar System. Your task is to return an approximation of its radius, expressed in kilometers. This is a [code-challenge](/questions/tagged/code-challenge "show questions tagged 'code-challenge'") where your score consists of the length of...
[Question] [ *I found this sequence while working on [Evolution of OEIS](https://codegolf.stackexchange.com/q/49223/8478), but never got around to posting it as an answer. After writing a reference implementation in Mathematica, I thought this is a fun exercise to do as a separate challenge though, so here we go.* ...
[Question] [ You must evaluate a string written in [Reverse Polish notation](http://en.wikipedia.org/wiki/Reverse_Polish_notation) and output the result. The program must accept an input and return the output. For programming languages that do not have functions to receive input/output, you can assume functions lik...
[Question] [ # Challenge Write a non-empty program/function `p` that, given a non-empty input string `s`, outputs the position of the **first occurrence** of each character of `s` in the source code of `p`. For example, if your program is ``` main() { cout << magic << cin } ^0 ^5 ^10 ^15 ^20 ^25 ``` and it ...
[Question] [ Given a palindrome generated according to [this challenge](https://codegolf.stackexchange.com/questions/98325/palindromize-this-string), depalindromize it. ### Test cases ``` abcdedcba -> abcde johncenanecnhoj -> johncena ppapapp -> ppap codegolflogedoc -> codegolf ``` As this is about depalindromizing...
[Question] [ [We already now how to strip a string from its spaces.](https://codegolf.stackexchange.com/q/50510/71426) However, as proper gentlemen/ladies, we should rather *undress* it. --- Undressing a string is the same as stripping it, only more delicate. Instead of removing all leading and trailing spaces at o...
[Question] [ # Input A list of nonnegative integers. # Output The largest nonnegative integer `h` such that at least `h` of the numbers in the list are greater than or equal to `h`. # Test Cases ``` [0,0,0,0] -> 0 [12,312,33,12] -> 4 [1,2,3,4,5,6,7] -> 4 [22,33,1,2,4] -> 3 [1000,2,2,2] -> 2 [23,42,12,92,39,46,23,56...
[Question] [ The paint on the walls in my room has a random, almost fractal-like, 3-dimensional texture: ![Image A](https://i.stack.imgur.com/fQkU9.png) In this challenge you will write a program that generates random images that look like they could be part of my walls. Below I've collected 10 images of different ...
[Question] [ Given an Integer array: 1. Start from the first number 2. Jump forward n positions where n is the value of the current position 3. Delete the current position, making what was the next position the current position. 4. Goto step 2 until there is one number remaining 5. Print that number **Rules** The a...
[Question] [ # Challenge Given a tic-tac-toe board in any format, determine if it is valid or not. If a board can be the result of a tic-tac-toe game, then it is valid. For example, this board is valid: ``` X O X O X O X O X ``` On the contrary, this board is invalid: ``` X X X X X O O O O ``` # Input * A full (9/9...
[Question] [ Shifty-eyes ASCII guys like to shift ASCII `Ii`'s: ``` >_> <_< >_< <_> ``` Given a string of shifty-guys, spaced apart or separate lines, shift the `Ii`'s side to side, left the wall and right the skies: ``` Ii ``` The shortest shifter wins the prize. # Say What? Write a program or function that takes ...
[Question] [ Given an input of a list of words, output the words with their letters arranged diagonally: ``` p r o p g u r z a a z m n l m d e i c s n o g d g e o l f ``` (The above should be the output for the input `programming puzzles and code golf`.) To be precise, each w...
[Question] [ Given a string `s`, return the smallest contiguous substring you can remove to create a palindrome. --- # Examples: ``` 800233008 -> 2 racecarFOOL -> FOOL abcdedcba -> (empty string) ngryL Myrgn -> "L " (or " M") 123456789 -> 12345678 (or 23456789) aabcdbaa -> c (or d) [[]] -> [[ (or ]]...
[Question] [ How well do you know the site? Let's find out. This is a [cops-and-robbers](/questions/tagged/cops-and-robbers "show questions tagged 'cops-and-robbers'") challenge. [Robber's thread.](https://codegolf.stackexchange.com/questions/100358/ppcg-jeopardy-robbers) As a cop, you need to: 1. Find a non-delete...
[Question] [ With the big crash of the universal economy also the demand for custom made planets plunged. The Magratheans had to look after more steady revenues also from a broader class of customers. Therefore, they invented the have-your-own chain of mountain (or short havoc-o-mountains) for people with smaller b...
[Question] [ **Closed**. This question needs to be more [focused](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Update the question so it focuses on one problem only by [editing this post](/posts/16587/edit). Closed 1 year ago. [Improve this question](/po...
[Question] [ A current internet meme is to type 2spooky4me, with a second person typing 3spooky5me, following the `(n)spooky(n+2)me` pattern. Your mission is to implement this pattern in your chosen language. You should write a program or function that takes a value `n` (from standard input, as a function argument,...
[Question] [ The challenge is very simple. Given an integer input `n`, output the `n x n` identity matrix. The identity matrix is one that has `1`s spanning from the top left down to the bottom right. You will write a program or a function that will return or output the identity matrix you constructed. Your output ...
[Question] [ Given a string consisting of **printable ASCII chars**, produce an output consisting of its **unique chars in the original order**. In other words, the output is the same as the input except that a char is removed if it has appeared previously. **No built-ins** for finding unique elements in an array c...
[Question] [ I can't believe we don't have this already.. It's one of the most important data-structures in programming, yet still simple enough to implement it in a [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"): ## Challenge Your task is to implement a stack that allows pushing and p...
[Question] [ **Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers. --- This question does not appear to be about code golf or coding challenges within the scope defined in the [help center](https://codegolf.stackexchange.com/help/on-topic). Closed 7 years ago....
[Question] [ Write a program or function that prints or returns a string of the alphanumeric characters plus underscore, **in any order**. To be precise, the following characters need to be output, **and no more**: ``` abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_ ``` When printing to stdout, an o...
[Question] [ (Just open 50 tabs in Google Chrome :D (just kidding, no you can't)) Shortest code for infinite disk I/O any language, C# example: ``` using System.IO; namespace FileApp { static class Program { public static void Main() { do { File.WriteAllText("a", "a"); ...
[Question] [ This challenge is a simple [ascii-art](/questions/tagged/ascii-art "show questions tagged 'ascii-art'") one. Given two inputs, describing the height and width of a Lego piece, you have print an ASCII art representation of it. Here is how the Lego pieces are supposed to look: ``` (4, 2) ___________ | o ...
[Question] [ Given a length N string of less-than and greater-than signs (`<`, `>`), insert the integers 0 through N at the start and end and in between each pair of signs such that all the inequalities are satisfied. Output the resulting string. If there are multiple valid outputs, output any one (and just one) of...
[Question] [ ### Challenge: Take a string of upper or lower case letters as input (optional), and calculate the score that string would get in a game of [Scrabble](https://en.wikipedia.org/wiki/Scrabble) in English. ### Rules: The score of each letter is as follows (use this even if there are other versions of the ...
[Question] [ ## Introduction [OEIS sequence A127421](https://oeis.org/A127421 "OEIS sequence A127421") is the sequence of numbers whose decimal expansion is a concatenation of 2 consecutive increasing non-negative numbers. Put simply, every number in the sequence is formed by putting together *n* with *n+1* for som...
[Question] [ > > [This reminds me when a few years ago someone uploaded a torrent "Hacker tool: complete list of all IP addresses". This was, of course, just a generated list of the ~4 billion IPv4 addresses, but thousands of "h4xx0rz" downloaded it. Look mum, imahacker!](https://meta.stackoverflow.com/questions/3...
[Question] [ Output the Nth term of the Van Eck Sequence. Van Eck Sequence is defined as: * Starts with 0. * If the last term is the first occurrence of that term the next term is 0. * If the last term has occurred previously the next term is how many steps back was the most recent occurrence. <https://oeis.org/A18...
[Question] [ Last time when I tried to come up with something easy that wasn't a duplicate, it ended up being way too hard.. So hopefully this time it's indeed something newcomers can try as well. **Input:** An array/list with integers/decimals. (Or a string representing an array with integers/decimals.) **Output:*...
[Question] [ [IUPAC](https://en.wikipedia.org/wiki/International_Union_of_Pure_and_Applied_Chemistry) in their insufferable wisdom have created a [systematic element name](https://en.wikipedia.org/wiki/Systematic_element_name) for any newly created element. This is the temporary name of an element until they finall...
[Question] [ In this challenge fake marquee text is text that is shown part by part, in a scrolling-like fashion. Some examples: ``` testing 4 t te tes test esti stin ting ing ng g hello 2 h he el ll lo o foobarz 3 f fo foo oob oba bar arz rz z Something a bit longer 10 S So Som ...
[Question] [ [Hodor](http://gameofthrones.wikia.com/wiki/Hodor) is a slow-minded but endearing character on the show [Game of Thrones](http://en.wikipedia.org/wiki/Game_of_Thrones) ([he's](http://awoiaf.westeros.org/index.php/Hodor) in [the books](http://en.wikipedia.org/wiki/A_Song_of_Ice_and_Fire) as well of cour...
[Question] [ The Ackermann function is notable for being the one of the simplest examples of a total, computable function that isn't primitive recursive. We will use the definition of \$A(m,n)\$ taking in two nonnegative integers where $$\begin{align} A(0,n) & = n+1 \\ A(m,0) & = A(m-1,1) \\ A(m,n) & = A(m-1,A(m,n-...
[Question] [ Write a rectangular block of text that when arranged into a [Sierpinski carpet](http://en.wikipedia.org/wiki/Sierpinski_carpet), using same-sized blocks of spaces for the empty portions, creates a program that outputs the iteration number of the carpet. For example, if your text block is ``` TXT BLK ``...
[Question] [ Since 2009, Android's version code names have been confectionery-themed. Android 1.5 is Cupcake, Android 1.6 is Donut, Android 2.0 is Eclair, etc.. In fact, the version names are alphabetical! ``` C -> Cupcake D -> Donut E -> Eclair F -> Froyo G -> Gingerbread H -> Honeycomb I -> Ice Cream Sandwich J -...
[Question] [ **Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers. --- This question does not appear to be about code golf or coding challenges within the scope defined in the [help center](https://codegolf.stackexchange.com/help/on-topic). Closed 7 years ago....
[Question] [ # Introduction Aron Nimzowitsch was a leading chess master and a influential chess writer. In his book 'My System', the first chapter deals about the importance of the center and why you should dominate it. The simple reason is that your pieces have more possible direct next moves when being in the cen...
[Question] [ Do you have any tips for [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'")ing in [05AB1E](https://github.com/Adriandmen/05AB1E), a golfing language created by [Adnan](https://codegolf.stackexchange.com/users/34388/adnan)? Your tips should be at least somewhat specific to 05AB...
[Question] [ For any positive integer \$k\$, let \$d(k)\$ denote the number of divisors of \$k\$. For example, \$d(6)\$ is \$4\$, because \$6\$ has \$4\$ divisors (namely \$1, 2, 3, 6\$). Given a positive integer \$N\$, display a "skyline" in ASCII art using a fixed character, such that the height of the "building"...
[Question] [ Consider a piece of string (as in "rope", not as in "a bunch of characters"), which is folded back and forth on the real line. We can describe the shape of the string with a list of points it passes through (in order). For simplicity, we'll assume all of those points are integers. Take as an example `...
[Question] [ ## Challenge Given a non-empty array of integers, e.g.: ``` [5, 2, 7, 6, 4, 1, 3] ``` First sever it into arrays where no item is larger than the previous (i.e. non-ascending arrays): ``` [5, 2] [7, 6, 4, 1] [3] ``` Next, reverse each array: ``` [2, 5] [1, 4, 6, 7] [3] ``` Finally, concatenate them all...
[Question] [ In [Wordle](https://powerlanguage.co.uk/wordle/), you try to guess a secret word, and some letters in your guess are highlighted to give you hints. If you guess a letter which matches the letter in the same position in the secret word, the letter will be highlighted green. For example, if the secret wo...
[Question] [ Out of all the years I've been making this challenge, 2017 is the first year that's been a prime number. So the question will be about prime numbers and their properties. Your task is to produce a program or function that will take an arbitrarily large positive integer as input, and output or return wh...
[Question] [ Lots of people on this site use [esoteric languages](https://esolangs.org/wiki/Main_Page), and since these languages are unusual and hard to understand, they will frequently write an explanation in a certain format. For example, if the code was ``` abcdefghijklmnop ``` And this languages uses `#` for c...
[Question] [ As part of its compression algorithm, the JPEG standard unrolls a matrix into a vector along antidiagonals of alternating direction: [![enter image description here](https://i.stack.imgur.com/I8Pu2.png)](https://i.stack.imgur.com/I8Pu2.png) Your task is to take a matrix (not necessarily square) and ret...
[Question] [ ## Introduction We all know the cool S (also known as Superman S, Stüssy S, Super S, Skater S, Pointy S, Graffiti S etc. etc.): billions of schoolchildren around the world drew this S and immediately felt proud of themselves. In case you've forgotten or had a *completely uncool childhood*, here is an i...
[Question] [ This challenge is inspired by [Fortran](https://gcc.gnu.org/fortran/)'s idiosyncratic implicit typing rules. Your task will be to determine the data type of the object `GOD` according to the implicit typing rules explained below. ## Background Fortran 77 has six data types: `CHARACTER`, `COMPLEX`, `DOU...
[Question] [ There are quite a large number of prime generating functions. Pretty much all of them are constructed and are based on the sieve of Eratosthenes, the Möbius function or the Wilson's theorem and are generally infeasible to compute in practice. But there are also generators, that have a very easy structu...
[Question] [ # The Challenge Write a program that can break down an input chemical formula (see below), and output its respective atoms in the form `element: atom-count`. --- # Input Sample input: ``` H2O ``` Your input will always contain at least one element, but no more than ten. Your program should accept input...
[Question] [ Write a single line program two or more characters long that contains no [line terminators](https://en.wikipedia.org/wiki/Newline#Unicode) and takes no input. For example, your program might be: ``` MyProgram ``` When your program is arranged into the shapes a clock's hands make at 12, 3, 6, and 9 o'cl...
[Question] [ # Single moves The board is an infinite 2 dimensional square grid, like a limitless chess board. A piece with value N (an ***N-mover***) can move to any square that is a distance of exactly the square root of N from its current square (Euclidean distance measured centre to centre). For example: * A 1-m...
[Question] [ Implement the Fast Fourier Transform in the fewest possible characters. Rules: * Shortest solution wins * It can be assumed that the input is a 1D array whose length is a power of two. * You may use the algorithm of your choice, but the solution must actually be a Fast Fourier Transform, not just a nai...
[Question] [ *(based on [this](https://codegolf.meta.stackexchange.com/a/12146/42963) post and the [ensuing discussion](http://chat.stackexchange.com/transcript/message/36815472#36815472) on chat -- also, much thanks to Dennis for TIO!)* ## The Challenge Choose a language that's currently available on the [TryItOnl...
[Question] [ In many fonts (specifically in the [Consolas font](https://en.wikipedia.org/wiki/Consolas)), 5 out of the 10 decimal digits have "holes" in them. We will call these holy digits: ``` 46890 ``` The 5 unholy digits are thus: ``` 12357 ``` An integer may thus be classified as "holy" if it only contains hol...