instruction
stringlengths
34
53.1k
Note: This challenge is now closed. Any future cops' submission will not be considered for the accepted answer. This is to ensure that no one can post a very simple regex in the future that only remains uncracked because no one is interested in the challenge any more. The Cops' Challenge You are to write a short, obf...
Your task is to take as input an English noun and output its plural. To win the challenge you must trade off code length against accuracy. Entries will be scored according to this comma-separated list of 95642 English nouns and their plurals. Your score is the length of your code in bytes, plus the number of nouns in t...
Emulate the Professor's typing Background Unfortunately, the Professor is not able to use his keyboard properly: whenever he is meant to use the Shift key, he presses Caps Lock once before typing, and doesn't bother to correct himself. If there are two or more keys in a row that require Shift, he presses Caps Lock befo...
Find Hole 1 here. Make a quine that, when run, outputs its own source code block multiple times. In fact, it must output it n times, where n in the next prime number. I think an example shows it best. [MY QUINE][MY QUINE] [MY QUINE][MY QUINE][MY QUINE] [MY QUINE][MY QUINE][MY QUINE][MY QUINE][MY QUINE] [MY QUINE][MY QU...
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 of the playground....
Idea thanks to @MartinBüttner from a discussion in chat Mahjong is a tile game that is immensely popular in Asia. It is typically played with four players, and the goal of the game is to be the first person to complete a valid hand using the tiles. For this challenge, we will consider a simplified version of the game —...
it's a-me! Today's task is simple: write a program, or a function that displays the idle small Mario sprite, from Super Mario Bros, on NES, over a blue background. Any kind of entry is valid as long as it displays those 12 * 16 pixels anywhere on the screen / window / browser. (EDIT: the displayed image can be scaled u...
I'm pretty new to code golfing, so I gave one of my first shots to a space invader clone called "Invas!on". It's a little less than 500 bytes, fully ASCII generated, and covers moving around and shooting at the aliens. There is also a little point system. My specific question is about generating enemy patterns. I want ...
A magic square is a square array of numbers with side n consisting of the distinct positive integers 1, 2, ..., n² arranged such that the sum of the n numbers in any horizontal, vertical, or main diagonal line is always the same number, which is known as the magic constant. Your program must input, through std-in, a nu...
There's something wrong with your keyboard. The Shift key has a mind of its own. Every time you type a character you have no idea whether it will come out shifted or not (though it is 50-50). Besides the standard character keys, nothing on the keyboard is functional. There is no mouse or other means of input. Somehow y...
Given a number n, you must output a golden spiral with the number of quarter turns being n. The spiral must be completely black and the background must be completely white. This must be output as a φ⌊n/4⌋*4 by φ⌊n/4⌋*4 PNG file (you may output a PPM and convert it later). The shortest code wins. The radius of the small...
Consider a square block of text, N characters wide by N tall, for some odd integer N greater than 1. As an example let N = 5 and the text be: MLKJI NWVUH OXYTG PQRSF ABCDE Notice that this is the alphabet (besides Z) spiraled around counter-clockwise from the lower left corner. It's kind of like a rolled up carpet. "...
Last challenge (Pixel-art, episode 1: display Super Mario) was just a training... (and you completed it in amazing ways, thanks!) This time, you have to work a little bit more. You have to display all the first overworld map of Super Mario bros on NES, without enemies, and without Mario. Your program or function must d...
Let the characters 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ represent the particles of 36 immiscible fluids, each more dense than the last. So the 0 fluid is the least dense and floats on all the others, while Z is the densest and always sinks. Let # represent a solid particle that cannot move at all.. Consider a rectangul...
This is my head: \ /-- -| / -\ | | | \ \ \ \ | --\ | \ | | / |--| / / | /|- //--| / | | | || //\ | | \ /| // \ | It consists of exactly eight hairs. My hair is too long. Please cut each individual strand to a length I specify. Input The main attraction in this section is the act...
What general tips do you have for golfing in BBC BASIC? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to BBC BASIC (e.g. "remove comments" is not an answer).
Pyth is a Python-inspired procedural programming language, created by PPCG user 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 general that are at least somewhat specific to Pyth. One tip per answer, please.
When I stumbled upon this question I remembered that I had also once seen precise rules for the construction of the South Korean flag. And this is quite a different construction. Source: Wikipedia So you're to draw an exact construction of this one now! Specification You can render the flag to file or screen using vec...
Hole #1 Joe the snake is hungry. He eats pictures, one pixel at a time. He really likes bright pixels. The Challenge Program Joe to eat the most bright pixels he can find, given that he can only move up, down, left or right. Specifications Joe must start at the upper left pixel of the image. Joe can only move horizont...
Stack Snippets were recently added to PPCG! Reminiscent of JSFiddle, Stack Snippets allow HTML, CSS, and JavaScript to be run directly in posts! Here is a very simple Stack Snippet: alert('This is JavaScript') h3 { color: red } /* This is CSS */ <h3>This is HTML</h3> This feature of Stack Exchange would be very us...
So a colleaque came with this problem lately and I want to challange you to solve the problem in the code-golf style, shortest solution in any language wins. The Problem: Given is a random set of values, where the values themselfs are not the concern, but the amount (which is random as well)of values. To keep the post...
Are there any tricks to shorten defined function names like setInterval, onkeydown, onkeyup, createLinearGradient or even return? When using it more than once it's nice to put it as a string into a variable and reuse it afterwards but most functions I only need once. I know that ES6 has arrowed functions - maybe there ...
(spoilers on decade-old TV show below) In the HBO show "The Wire", the dealers use a system of encoding phone numbers where they "jump the 5" on the number pad. +-----------+ | 1 | 2 | 3 | +-----------+ | 4 | 5 | 6 | +-----------+ | 7 | 8 | 9 | +-----------+ | # | 0 | * | +-----------+ A "1" becomes a "9", "4" becom...
Who doesn't love a good fractal? The Sierpinski Carpet is a classic example of a fractal. To complete this task, you will be required to generate a carpet of type \$n\$ and print the resulting image to the stdout (see example below for formatting) \$n\$, representing the level carpet. Steps can be found on this Wikiped...
The task here is to print the text below, using as few characters as possible in your code. You can't use any external resource. (file, stdin, network) To be, or not to be: that is the question: Whether 'tis nobler in the mind to suffer The slings and arrows of outrageous fortune, Or to take arms against a sea of troub...
Deadfish is one of the best known non Turing-complete programming languages. It has only one accumulator (which starts at 0) to store data, and only four commands: i - Increment the accumulator s - Square the accumulator d - Decrement the accumulator o - Output the accumulator A Deadfish program may look like: iiisdo ...
In traditional Tetris, there are 7 distinct tetromino bricks, each denoted by a letter similar to its shape. # # # # # ## # # ### ## ## # ## ## ## # ## ## I O L J T Z S Consider the arrangements of these bricks that can make a solid W×H rectangle, for some positive in...
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-1)) \end{align}$$...
You have a matrix of size m x n. Each cell in the matrix has a uniformly random integer value v, where 0 ≤ v < i, and i ≤ (m x n). (Meaning, the matrix contains a maximum of m x n distinct values, but it may have fewer.) 1) Write a function that accepts input values of m, n, i, and returns a matrix that meets the crite...
This is the companion question to Jumblers vs Rebuilders: Coding with Tetris Bricks where Rebuilders can post their solutions. As argued in Where should we put robbers? it allows more formatting freedom for robbers and lets them gain rep. Only answer this question if you have cracked a yet uncracked answer to Jumblers ...
Your task is to write a program that finds the largest radius that N circles can have and still fit inside of a rectangle that is X by Y pixels large. (similar to this wikipedia article) Your program must find the largest possible radius and optimal position of these N circles so that No two circles overlap All of th...
Introduction Bad news guys - you got detention. Your English teacher doesn't understand this site and wants you to "stop doing math on your digital dohickeys, this is English class!" She sentenced you to write her favorite saying on the blackboard 25 times, which will give a total of 100 lines on the blackboard. The ei...
There's an old story about a stonecutter who was never satisfied with what he was. He wished he could become the sun, and so he was. Blocked by the clouds, he wished to be - and became - a cloud. When the wind blew, he wished himself into being the wind. Stopped by the mountain, he wished to be a mountain, and thus bec...
When stacking books you usually want to put the largest ones at the bottom and the smallest ones at the top. However, my latent OCD makes me feel very uneasy if I've got two books where one is shorter (in height) but wider than the other. No matter which order I place them in, the top book will extend beyond the bottom...
You are given as input two strings representing positive integers in base 10, such as "12345" and "42". Your task is to output a string containing their product, "518490" in this case. The twist is that you may not use any numerical types in your code. No ints, floats, unsigned longs, etc., no built-in complex number t...
From Erich Friedman's Math Magic, (problem #2 on that page) your challenge is to find the edge elimination number of a connected graph. A single edge elimination is the removal of an edge from a graph, without disconnecting the graph, except for creating lone vertices. For instance, in the graph below, the two leftmos...
A cyclic tag system is a tiny, Turing-complete computational model consisting of a two-symbol alphabet (I'll use {0,1}), a finite, nonempty cyclic list of productions that consist of those two symbols, and an unbounded word which also consists of those two symbols. At each step: the first element in the word is remov...
This is a cops-and-robbers challenge. Answer here if you are a cop (crossword maker), answer the companion question if you are a robber (crossword solver). You may take on both roles. Cops (Puzzlers) Your task is to write a 10×10 crossword puzzle where, instead of words or phrases, snippets of code are the solutions to...
This is the companion question for Code Crosswords. Robber answers go here. See Where should we put robbers? for meta-info.
The goal of this challenge is to write a program which takes a string (of any length) as input and displays anagrams (see these examples of anagrams) of this string, made by taking words in a dictionary (either individually or in pairs), but the anagrams don't need to be perfect. An anagram is the result of a rearrange...
The Four color theorem States that no more than four colors are required to color the regions of a map. The challenge Given a list of State borders assign each state ID a color so that no two adjacent states have the same color. The output Should be a CSS stylesheet assigning the color to the state's 2 letter ID code. ...
You are the captain of a battleship. The engineering department's been cutting corners with designs this year, so the ship you're on takes the shape of a simple triangle. You walk out onto the deck and enjoy the sea breeze... though not for long. An enemy has fired at you! — but will the shot hit? Input You may write e...
Quite a few people here are probably avid XKCD readers. So, I figure I'd challenge you guys to do something that Megan can do easily: make a script that generates thousands of reassuring parables about what computers can never do. Your script Can be written in any language Must be code-golfed Must take an input (on ...
You a sequence of numbers like this one given to you as a string: "1 2 3 4 8 11 19 33 59 154 196 260" Create a program (any language) that calculates the smallest outcome you can't get by adding two of those numbers together. The numbers given must be integers, and are always positive. You can only use each number once...
This contest is officially over, the winner is jimmy23013. Congratulations! The challenge is to make a program that prints Hello World! to stdout. The catch is that your program must have a Levenshtein distance of 7 or less from the program in the answer submitted before yours. How This Will Work Below I have already s...
The Setup Most of us are familiar with crossword numbering, which follows three basic rules: in a character grid consisting of blacks and whites (see below), any maximal contiguous horizontal or vertical chain of whites with length ≥ 2 is considered a word any white at the leftmost end of a horizontal word and/or at t...
Given 3 integers, determine the lowest possible base for the first two integers to multiply into the third. If you think of the Answer to the Ultimate Question of Life, The Universe, and Everything, 6 * 9 == 42, is true in Base 13. The inputs can include any numbers whose digits use the characters 0-9, a-z, and A-Z, wh...
Let's take a grid of 16x16 printable ASCII characters (code points 0x20 to 0x7E). There are 30-choose-15 paths from the top left to the bottom right corner, making only orthogonal moves, like the following example: ##.............. .#.............. .######......... ......##........ .......##....... ........#....... ......
Background You are a rich executive of a software empire. Your time is worth a lot of money. As such, you must always travel in the most efficient route possible. However, as an executive, you spend a lot of time participating in important phone calls. It is paramount that you never drop calls, so you must never travel...
As you may know, the Unicode standard has room for 1,114,111 code points, and each assigned code point represents a glyph (character, emoji, etc.). Most code points are not yet assigned. Current Unicode implementations take a lot of space to encode all possible code points (UTF-32 takes 4 bytes per code point, UTF-16: ...
The task is to display n characters of the ASCII table. You may write a function (or a program that takes the argument as a parameter, STDIN is allowed as well) that takes a parameter n, which will be the index of the last character to print. The task is quite simple, so as an example here's a possible implementation i...
Repdigits are numbers of the form a * (10^n - 1)/9 with a in [-9,9]\{0} (in other words 111, -3333, 66, numbers which are made by repeating only one digit) Goal: Write a program or function which takes a single positive integer N and prints N = s_1 + s_2 + ... + s_k. There should be one number per line and the numbers...
Given a string, consisting of a prefix and then "illion", convert this number into standard form. For example: "million" -> 10^6 "trillion" -> 10^12 "quattuordecillion" -> 10^45 The program needs to be able to handle input going up to Centillion, which is 10^303. A list of names and their standard form values can be ...
You are from the tiny country of Que-Wopistan. The Que-Wopistonion's are a proud people, and every Que-Wopistonian dreams of making their country proud by representing their country in the Olympics. You have been given the incredible honor of competing in the 100-meter-dash. You are the nations sole representative, so...
Puzzle There are some mirrors located throughout a grid. A ray of light enters the grid from some position. It travels through the grid in a straight line trying to escape. On encountering with a mirror it changes its course by 90 degrees. This continues to happen until it breaks free from the maze. The challenge is si...
I was expecting to post something more complex as my first puzzle in PCG, but a particular, uh... homework question on Stack Overflow inspired me to post this. They want to: print the following pattern for any given word that contains odd number of letters: P M R A O R G ...
Update: The winner has been decided, but the challenge is not over! Finally, nearly 3 months after the question first started, someone has remained the last answerer for more than a week! Congratulations to jimmy23013 with his P1eq answer! There are still however 8 characters left: 48KSaclw. If anyone is really ambitio...
Challenge You must output the Chinese character for biáng. Your program must not access any external sources and must exactly reproduce this SVG in every way. Note that the image below is just a gif version of the image. The output should be an SVG file. Your program must be a program, therefore you cannot hardcode the...
The Challenge Program a comic strip. As artistically rich and detailed as you can possibly make it, so long as it complies with the following rules: the comic must be your own original work, not a duplicate or approximation of an existing comic (you may however use characters from an existing strip as an homage, if yo...
We have a group of stealthy computer-savvy geeks who are also musicians with a very subversive element to their songs that the authorities in their totalitarian country just can't stand, and are itching to show up at one of the concerts, fire off rubber bullets and tear gas at the audience, and arrest the band members ...
Using only printable ASCII (hex codes 20 to 7E), write a square N×N core program without comments that is surrounded by 4 more layers, creating a (N+8)×(N+8) square program (N > 0). For N = 3 the layout (to be replaced by actual code) looks like this: 44444444444 43333333334 43222222234 43211111234 4321CCC1234 4321CCC1...
Challenge Write a program that toggles another. Your program should accept exactly two command arguments. Specifically, your two tasks are: If the names of any running processes are identical to argument one, close them and exit If the names of zero running processes are named identical to argument one, spawn one with...
There are various coding standards enforced at software companies which have the goal of increasing code reliability, portability, and, most importantly, readability in code written jointly by different developers. Two notable examples are the MISRA C, and the C++ standard developed for the JSF project. These are usual...
Trick the user that StackExchange is broken: It can be done in several ways: Your program starts a browser in some certain way (with a proxy server, for example); Your program shows static picture; Your program is executed in address bar using javascript:. (your other creative way) StackExchange error page should be...
Scriptbot Warz! The results are in and Assassin is our champion, winning 2 of 3 matches! Thanks to everyone who submitted their Scriptbots! Special thanks to horns for BestOpportunityBot which displayed excellent pathing and made full use of all action options. Map 1 Assassin took out BestOpportunityBot early on, and ...
In this challenge, you'll need to edit a grid of characters to make a program that does a task, while ensuring that you leave a lasting mark on the grid. Task The task to perform is determined by when you answer. Specifically, for the nth answer, divide n by 5, and if the remainder is... 0. Read a positive integer fro...
I've got a tough one for you! My girlfriend recently came across a new show on MTV (USA). It's a terrible show, and everyone on it is trashy, but the "game" is pretty interesting. From Wikipedia: Are You The One? follows 20 people who are living together in Hawaii to find their perfect match. If the 10 men and 10 wo...
This challenge consists in coding an interpreter for a 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. Coordinates must be integers. The stack is initialized with a single r...
Consider a randomized list of the integers 1 to N. You want to sort it using only the following actions: Swap the first and last list elements. (S) Pop off the first element and append it to the end of the list. (P) This is always possible because any list can be sorted with enough swaps of adjacent elements. Using S...
Sometimes when you press a key on a keyboard, the letter doesn't always display on screen. Whether this is because of a dodgy connection or otherwise, you have decided to write a script to control the probability of a letter displaying on screen when the corresponding key is pressed. One day, you decide to buy a monke...
I was looking around on the web and I found this Google Code Jam Puzzle. I really liked it so I decided to post it here. New Lottery Game The Lottery is changing! The Lottery used to have a machine to generate a random winning number. But due to cheating problems, the Lottery has decided to add another machine. Th...
Your boss has recently learned of this interesting programming language called English. He has had this "revolutionary" idea, he wants to code with you to double code production rates! Since he is not a tech savvy, he wants you to write a compiler for it so that he can code too! Now, you are an evil lazy programmer and...
Using Algodoo and Paint I made these six 300×300 monochromatic images of four convenient shapes: This class of images has the following properties: They are always 300×300 pixels, monochromatic (black and white only), and have exactly four white regions that correspond to a square, a circle, a triangle, and a ge...
Here is a list of the 118 (current) elements of the periodic table (in a collapsed Stack Snippet for your convenience): Hydrogen Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen Fluorine Neon Sodium Magnesium Aluminium Silicon Phosphorus Sulfur Chlorine Argon Potassium Calcium Scandium Titan...
Situation: A turtle starts at (0, 0) on a cartesian graph. We have a non-empty zero-indexed "moves" list that contains numbers. Each number represents the distance moved. The first number is the distance north, the second is the distance east, the third is the distance south, the fourth is the distance west, and rep...
See Hole #1 if you are confused. What does every kid do after he/she collects buckets of candy over Halloween? Sort it by type and size, of course1! The Challenge Given a dumped-out bag of candy of varying shapes and sizes, sort the candy from left to right based on: First: The amount of candy (so 5 of one will be mor...
Consider these 10 images of various amounts of uncooked grains of white rice. THESE ARE ONLY THUMBNAILS. Click an image to view it at full size. A: B: C: D: E: F: G: H: I: J: Grain Counts: A: 3, B: 5, C: 12, D: 25, E: 50, F: 83, G: 120, H:150, I: 151, J: 200 Notice that... The grains may touch each other but...
In Python, you can use the dir function on any object to get a list of the names of its instance functions: >>> dir('abc') ['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__in...
Challenge Walking around Marks and Spencers, I noticed that they had air conditioning units placed randomly around the shop. Wanting to keep cool, I wondered what was the easiest way to move around the whole shop without being away from an air conditioning unit for too long. Given a map, you must find a way to travel a...
Until decimalization in 1971, British money was based on dividing the pound into 240 pennies. A shilling was 12 pennies so 20 shillings made a pound. The smallest denomination was the farthing at one fourth of a penny. There were many other denominations and nicknames for coins, which can get quite confusing if you're ...
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 needed until the fuse is fu...
When it comes to eating candy, I hold myself to higher standards than the typical layperson. There is a delicate balance between "mixing it up" and "saving the best for last." In this challenge, you will be given a string of characters in which each character represents a piece of candy. Different characters (case-se...
Note: This challenge is now closed to new cop submissions. This is to ensure that no one can post submissions that only remain uncracked because there aren't enough robbers interested in the challenge anymore. In this game of cops-and-robbers, each cop will write a simple program to give a single output. They will t...
This is the companion thread to the main Unscramble the Source Code challenge. If you think you have managed to unscramble one of the cop answers, you should post your solution as the answer to this thread. As a reminder, you have one attempt at cracking each submission. Your cracking attempt will be an unscrambled ve...
Generate a Koch Snowflake A Koch snowflake is a triangle that for each n, another equilateral point is added in the middle of each side: http://en.wikipedia.org/wiki/Koch_snowflake#Properties We already had a kolmogrov-complexity Koch Snowflake challenge for n=4. The new challenge is to draw a Koch snowflake with any ...
This challenge is partly an algorithms challenge, partly an optimization challenge and partly simply a fastest code challenge. A cyclic matrix is fully specified by its first row r. The remaining rows are each cyclic permutations of the row r with offset equal to the row index. We will allow cyclic matrices which are n...
Background In typography, rivers 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 distracts your eyes. As an example, take the following block of text, lines ...
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: Link to Google Drive (t...
Introduction Pi is 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089... Let's treat each digit as an instruction as to how to get to the next digit. The first digit is 3. Counting three digits after the first digit, we arrive at 1. One digit after this 1 is a 5. Five digits after that ...
I have a simple task that should be relatively easy to implement by means of code. Your goal is to write a program that will output the time written in Spanish, given the time in HH:MM format. Many people likely don't know how to do this, so I will elaborate. Time in Spanish is fairly logical. It usually follows the pa...
Challenge Write a function or program which takes a positive decimal number, call it A, and output two positive numbers, B and C, such that: A == B bitxor C B and C must not contain any of the digits 0, 3 or 7 in its decimal representation. Examples >>> decompose(3) 1, 2 >>> decompose(7) 1, 6 >>> decompose(718) 121, ...
The board game In the board game "Carcassonne" players place tiles by matching their edges and earn the highest scores through creating large contiguous areas of terrain. The following are (roughly) the types and quantities of tiles included in the game: #01 x4 #02 x5 #03 x8 #04 x2 #05 x9 #06 x4 #07 x1 #08 x3 #...
Your task is, given a square grid of digits (0-9), output one of the ways that the digits can be grouped such that: Each digit is part of exactly one group All groups have the same number of digits All groups are bounded by one polygon-like shape (this means that every digit in the group is next to [left, right, up, d...
The goal of this codegolf is evaluating the cumulative distribution function of the student-t probability distribution. This is not trivial since there is no closed form and the function is dependent of two variables v and x. The distribution function is For getting the CDF you could integrate this function from -inf...
Objective Write a routine that accepts a string of printable ASCII characters, s, and returns a string containing the same characters as s, reordered so that no two-character substring appears more than once. The program must process all benchmark strings (see below) in under one minute each on a modern computer. I wi...
In this form of the game Tic-Tac-Chec, the goal is to move chess pieces to get four-in-a-row. Your goal here is to figure out if a position has a winning move. Rules The rules are similar, but not identical, to those of Tic-Tac-Chec. The board is 4 by 4 squares. Each player has a rook, bishop, knight, and queen. On you...
Challenge: implement calculation of a Delacorte Number in any language. Shortest code wins. For a given square matrix of distinct integers 1..n² (possible side length n at least between 3 and 27), its Delacorte Number is the sum of the products gcd(a, b) × distance²(a, b) for each distinct pair of integers {a, b}. The...
The Challenge In this challenge, you specify a source language S and a target language T. Your task is to write the following program P in the language S. If a valid program Q in the language T is given as input to P, it will output a valid program R in the language T which takes no input and outputs Q(R), that is, the...
Everyone knows that the content makes the question. But a good title helps too, and that's the first thing we see. It's time to turn that first impression into a program, and figure out what kinds of titles get more upvotes. You are hereby challenged to write a program or function that takes the title of a PPCG questio...
In this challenge, you are given a map of a two-dimensional terrain, viewed from the side. Unfortunately, some parts of the terrain are floating in the air, which means they'll come crashing down. Your job is to predict where they land. The Input Your input is one or more newline-separated strings of equal lengths, con...