instruction
stringlengths
34
53.1k
Today's challenge is to draw a binary tree as beautiful ascii-art like this example: /\ / \ / \ / \ / \ / \ ...
Below is a (schematic) Digital timing diagram, for the XNOR logic gate. ┌─┐ ┌─┐ ┌─────┐ ┌─┐ ┌─┐ ┌───┐ A ──┘ └─┘ └─┘ └─┘ └─┘ └─┘ └── ┌───┐ ┌───┐ ┌─┐ ┌─────┐ ┌─┐ ┌─┐ B ┘ └─┘ └─┘ └─┘ └───┘ └─┘ └ ┌─────┐ ┌─┐ ┌─┐ ┌───┐ X ──┘ └───┘ └───┘ └───┘ └──── Your goal is to reproduce ...
Amazingly, this simple task doesn't seem to exist already, so... Your task is to write a program that takes as input a 12 hour time, and converts it into "military time", or 24-hour time format. Input will be in the form: HH:MM am/pm Although slight variations are allowed: The space separating the am/pm from the res...
Challenge: Create a program that accepts a positive integer and checks if it can be written in the form of (3^x)-1, where X is another positive integer. If it can, output X If it can't, output -1 or a falsy statement. Example inputs/outputs Input: 2 It can be written as (3^1) - 1, so we output x which is 1 Output: 1 ...
Help! Here is my good friend Mr. Snowman: \(.,.) < Hello! ( : )> He is an amazing dancer, but he tends to get stage fright. He knows all the moves, but just needs someone to tell him which moves to do. Here are all of his moves: Arms Up \(.,.)/ ( : ) Arms Down (.,.) <( : )> Right Arm Up \(.,.) ( : )> Left Arm Up ...
To find the digital hardness of an integer, take its binary representation, and count the number of times both a leading and trailing 1 can be removed until it either start or ends with a 0. The total number of bits removed is its digital hardness. That's quite a wordy explanation - so let's break it down with a wor...
Introduction: Combinatory Logic Combinatory logic (CL) is based off of things called combinators, which are basically functions. There are two basic "built-in" combinators, S and K, which will be explained later. Left-associativity CL is left-associative, which means brackets (containing stuff) which are at the far-lef...
Challenge: In the programming language of your choice, accept an integer as input in base 10, and output it in the negadecimal notation, which is also known as base -10 Example algorithm: This is an algorithm taken from Wikipedia to convert base 10 to any negative base in VB.NET: Function toNegativeBase(Number As Inte...
Frequently while I'm code-golfing, I'll want to know what the ASCII value of a certain character is. One of my favorite resources for quickly looking up all of the printable ASCII characters is ASCIItable.com. This has a really nice image that not only shows the printable ASCII characters and their values, but also the...
Introduction You are a supervisor of a parking lot and your manager is preparing for shrinking the size to the extreme. It is a simplified and adapted version of a problem in last year's PAT top-level. Challenge You are asked to calculate how many cars are in the lot at the same time, at most. Standard rules apply. And...
Shuffling a deck of cards is hard for kids, so they must figure out ways to get a reasonable well shuffled deck as simply as possible. One way to do this that gives reasonably good results is: Take the top card out and insert it a random place in the deck Take the bottom card out and insert it in a random place in the...
Inspired by this video of Infinite Series. Introduction Pi is defined as the ratio of the circumference to the diameter of a circle. But how is a circle defined? Usually a circle is defined as the points with constant distance to the centerpoint (let us assume that the center is at (0,0)). The next question would be: H...
A Window is an ASCII-art square with odd side length of at least 3, with a single character border around the edge as well as vertical and horizontal strokes in the middle: ####### # # # # # # ####### # # # # # # ####### An MS Window is a window where the border is made only of the characters M and S. Your tas...
Your challenge: Connect to the Online Encyclopedia of Integer Sequences OEIS.org, access any random valid sequence, output it's ID, and ouput all of the members of the sequence provided by the OEIS entry. The only website you're allowed to connect to is OEIS.org. Hints: Sequences are found in URLs such as http://oeis.o...
Challenge Create a program that returns a truthy value when run on Microsoft Windows (for simplicity we'll stick with Windows 7, 8.1 and 10) and a falsey value when run on any other operating system (OSX, FreeBSD, Linux). Rules Code that fails to run/compile on a platform doesn't count as a falsey value. Winning crit...
In this challenge, you need to solve 4 different tasks using the same set of characters. You can rearrange the characters, but you can't add or remove characters. The winner will be the submission that solves all tasks using the smallest number of characters. All tasks must be solved in the same language. Note that i...
Challenge Given a nonempty list of real numbers, compute its median. Definitions The median is computed as follows: First sort the list, if the number of entries is odd, the median is the value in the center of the sorted list, otherwise the median is the arithmetic mean of the two values closest to the center of the ...
When you resize an image down to a very small size, it looks very blocky when you scale the pixels back up individually. In extreme cases, as above, you can no longer reconstruct the original image, as too much information has been lost. Your task is to build a program that will imagine what the original, unscaled im...
Input: Two decimal integers. These can be given to the code in standard input, as arguments to the program or function, or as a list. Output: Their product, as a decimal integer. For example, the input 5 16 would lead to the output 80. Restrictions: No standard loopholes please. This is code-golf, answer in lowest amou...
Challenge Origami (folding paper) is a creative form of art. As far as I know, master of Origami prefers square paper. Let's start from beginning - convert a rectangular paper to a square one. So the paper is divided into squares. We remove the biggest square which shares one shorter edge with the current shape, step b...
This challenge is a little tricky, but rather simple, given a string s: meta.codegolf.stackexchange.com Use the position of the character in the string as an x coordinate and the ascii value as a y coordinate. For the above string, the resultant set of coordinates would be: 0, 109 1, 101 2, 116 3, 97 4, 46 5, 99 6, 11...
Overview Consider the following task: Given a positive integer n > 0, output its integer square root. The integer square root of a number n is the largest value of x where x2 ≤ n, usually expressed with the formula floor(sqrt(n)). Examples: 25 -> 5, 24 -> 4, 40 -> 6, 1 -> 1. This task is easy enough on its own. Howev...
Ice mazes have been one of my favorite staples of Pokémon games since their debut in Pokémon Gold and Silver. Your task will be to make a program that solves these types of problems. Ice mazes primarily consist of, as the name suggests, ice. Once the player moves in a direction on ice they will continue to move in th...
Introduction Consider a nonempty list L of integers. A zero-sum slice of L is a contiguous subsequence of L whose sum equals 0. For example, [1, -3, 2] is a zero-sum slice of [-2, 4, 1, -3, 2, 2, -1, -1], but [2, 2] is not (because it doesn't sum to 0), and neither is [4, -3, -1] (because it's not contiguous). A collec...
Goal: Given any non-zero natural number a, find the smallest non-zero natural number b such that a•b is palindromic, e.g. it reads the same forwards and backwards. Input a through any reasonable means (STDIN, function argument, etc.), And output b through any reasonable means (STDOUT, function return value.) Notes: In...
Edit: I will be posting a newer version of this question on meta-golf soon. Stay tooned! Edit #2: I will no longer be updating the challenge, but will leave it open. The meta-golf version is available here: https://codegolf.stackexchange.com/questions/106509/obfuscated-number-golf Background: Most numbers can be writte...
Given a list of 1s and -1s, determine whether or not it is a valid OVSF code (by outputting a truthy or falsey value). OVSF codes are defined as follows: [1] is an OVSF code. If X is an OVSF code, then X ++ X and X ++ -X are both OVSF codes. Here ++ is list concatenation, and - negates every element in the list. No ...
If you sort a string you'll typically get something like: ':Iaaceeefggghiiiiklllllmnnooooprrssstttttuuyyyy Yes, that was the first sentence sorted. As you can see, there are a lot of repeated characters, aa, eee, ttttt, 9 spaces and so on. If we add 128 to the ASCII-value of the first duplicate, 256 to the se...
Challenge You have been assigned a task to write a program which takes a multigraph as its input and if it contains an Eularian circuit to return one. Otherwise, the program's behavior is undefined, according to the specifications you're handed by your boss. However, you recently caught your new coworker Steven several...
You're a professional hacker and your boss has just ordered you to help a candidate win an upcoming election. Your task is to alter the voting machines data to boost the candidate's results. Voting machines store voting results as two integers : the number of votes for your candidate (v1) and the number of votes for th...
Balanced bases: Balanced bases are essentially the same as normal bases, except that digits can be positive or negative, while in normal bases digits can only be positive. From here on, balanced bases of base b may be represented as balb - so balanced base 4 = bal4. In this challenge's definition, the range of digits i...
Given two string inputs of "Rock", "Paper", or "Scissors", determine the outcome of the RPS round. Output 1 if the first player wins, -1 if the second player wins, or 0 for a tie. Rock Rock -> 0 Rock Paper -> -1 Rock Scissors -> 1 Paper Rock -> 1 Paper Paper -> 0 Paper Scissors -> -1 Scissors Rock -> -1 Scissors Paper ...
This is a tips question for golfing in Python. In Python golfing, it's common for a submission to be a function defined as a lambda. For example, f=lambda x:0**x or x*f(x-1) computes the factorial of x. The lambda format has two big advantages: The boilerplate of f=lambda x:... or lambda x:... is shorter than the de...
Basically, between every character of a uni-line string, add a space, but there can't be two spaces in between one character. aesthetic becomes a e s t h e t i c. The quick brown fox jumps over the lazy dog becomes T h e q u i c k b r o w n f o x j u m p s o v e r t h e l a z y d o g. I'm Nobody! Who are you? becomes ...
Your task is to write a program that will output a readable list of every five letter words with the structure: consonant - vowel - consonant - vowel - consonant The output should be sorted alphabetically with one word per line and no words repeated twice. It can be lowercase or uppercase but not mixed. So the list cou...
There are lots of different ways to explain matrix multiplication. I'll stick with a single figure since I believe most people here are familiar with it (and the figure is very descriptive). If you want more detailed information, I suggest you visit the Wikipedia-article, or the explanation on WolframMathWorld. Simple ...
Note, challenge copied from question asked at math.stackexchange. Recently, I attained quite some skill at blowing bubbles. At first I would blow bubbles like this: But then things started getting strange: After a while, I was blowing some pretty weird bubbles: After blowing hundreds, maybe even thousands of such bu...
This was inspired by part of the 2016 ARML competition Team Problem #6. Here's the challenge: You're given a "wildcard sequence", which is a sequence of digits and another character. A string matches this wildcard sequence by the following pseudocode: w = wildcard s = string # s matches w iff for all 0 >= i > wildcard....
Lets create a system of numbers where the biggest digit in the nth place value (counting from right to left) of a number length m is always equal to m - n + 1. To give an example the largest 5 digit number expressible in this system is written 12345. Apart from the number of digits available to be used in a particular ...
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 → 101000110100000011011 → 6 1 → 1 → 1 9965546 → 100110000000111111101...
It's lunch time, I am hungry and I came to your Sushi Bar. You are the Sushi Chef and you have to produce a full program or function to make me some sushi! Credits: Wikipedia Disclaimer: The image is for illustration purposes only and do not necessarily represent the exact product. Although you have limited ingredien...
Write a program which, according to whether the script has access to the internet, produces an output which is "Truthy/Falsey". You may try and connect to any existing site, at your own discretion (don't use a shady site which only has 10% uptime - try to keep to above 80% annual uptime). If the site is down, your prog...
Paul is one of your Belgian acquaintances, and he would like you to create a program that outputs at least one of the following five strings: 12496=>14288=>15472=>14536=>14264 14264=>12496=>14288=>15472=>14536 14536=>14264=>12496=>14288=>15472 15472=>14536=>14264=>12496=>14288 14288=>15472=>14536=>14264=>12496 It ...
As we all know, modern operating systems have thread schedulers that can pick different orders to schedule your threads based on internal logic which your code is not privy to. Normally you architect your multithreaded code to ensure that this nondeterminism imposed on you does not meaningfully affect your output. The ...
Intro There are 3 nails in the wall. You've got a piece of string that is fixed to the picture frame with both ends. To hang the picture, you entangled the string with the nails. But before letting the picture go: Can you predict whether the image is going to fall, just by looking at how the string is wrapped around th...
Your challenge is to exactly output the following box: .................................................. .................................................. .. .. .. .. .. ++++++++++++++++++++++++++++++++++++++++++ .. .. ++++++...
About a year ago you were asked to find the XOR primes. These are numbers whose only factors are 1 and themselves when performing XOR multiplication in base 2. Now were are going to spice things up a bit. We are going to find the XOR primes in base -2 Converting to Base -2 Base -2 is a lot like every other base. The...
This impossible object is Reutersvärd's triangle: Draw your own version according to these rules: Exactly 9 cubes total Each side is made up of exactly 4 cubes The cubes appear to overlap such that the rendered object is in fact an impossible object 4 distinct colours are used - one for the background and 3 for each ...
Challenge Given a size s, print a cube net of that size made of hash symbols (#) and spaces (). Examples: 1: # # # # # # 2: # # # # # # # # # # # # # # # # # # # # # # # # 3: # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #...
Motivation: Sometimes you need to know where you are in a string. You want to be able to look at any part of a string and know exactly where you are, as far as possible. Challenge: write a program to output a tape measure string of a given length. A tape measure string self describes its length-so-far as often as possi...
Given 3 input items, a list of coordinate pairs, a 2D string, and a single-character string, output whether the character at each coordinate of the 2D string is equal to the single character. You can take the input in any order and the coordinates may be 1-indexed. You may take the 2D string as a 2D list, a list of li...
Summary Write a program or function, which doesn't take any input, and outputs all the integer numbers, between -1000 and 1000 in ascending order, to the stdout, one per line, like this: -1000 -999 -998 -997 ... And after that you need to print the time taken to print these numbers, or the time from the start of the p...
Given a list of math expressions that all hold true and consist of modulo remainder calculations with two numbers and a result, your task is to yield the first n numbers that hold true for all the statements in the list. For example: [m % 3 = 0, m % 4 = 1, m % 5 = 3], where % is the modulo operator. For n = 3, the fir...
XKCD Comic: Goal: Given a date, the current Dow Opening, and your current coordinates as a rounded integer, produce a "geohash." Input: Input through any reasonable means (STDIN, function argument, flag, etc.) the following: The current date. This does necessarily have to be the date of the system's clock, so assume ...
Background Many esoteric programming languages don't have numbers built in at literals, so you have to calculate them at runtime; and in many of these cases, the number representation can be quite interesting. We've already had a challenge about representing numbers for Underload. This challenge is about representing n...
Challenge: Take input of two black and white (monochrome) images and xor each pixel of the first, with each pixel of the second, add them to a new image and output the new image. Some clarifications: Size of pictures does not matter. Extension/Image format doesn't matter. You can make it take input any extension and ou...
Here’s how to backspace-and-retype from one string to another: Start from the first string. Remove characters at the end until the result is a prefix of the second string. (This may take 0 steps.) Add characters at the end until the result equals the second string. (This may take 0 steps, too.) For example, the path ...
I think it's easiest to explain this challenge in a sequential manner. Start with an input number \$N\$ and: Find its highest prime factor Check numbers above and below \$N\$ and see if the highest prime factor is higher (i.e. the highest prime factor of \$N-1\$ and/or \$N+1\$ is higher than the factor of \$N\$. Conti...
This question is about abelian sandpiles. Read this previous challenge and watch this numberphile video to learn more. An abelian sandpile of size n by n is a grid containing the number 0, 1, 2 and 3 (representing the number of grains of sand). Adding two sandpiles works by first adding element by element, and then to...
When code-golfing there will be times where you need a Hex Dump of your code, usually because you've used unprintable characters. So, why not make a program that Hex Dumps itself? The Challenge This challenge is to, given no input, output a Hex Dump of your source code in the following formatting: 0000: 00 00 00 00 00 ...
To neutralize data, recursively replace all numbers (not digits!) with zeros and all characters (not strings!) with spaces. You must accept any single number, character, or string, or possibly recursive array* of mixed numeric/character data that your language can handle. For example, you must accept actual strings (an...
Introduction You have been tasked to write a program that splits a rectangular integer array evenly in half (for whatever reason). This task is computationally intensive, but luckily you have a dual-core machine to perform the calculations. To maximize the benefits of parallelism, you decide to split the program evenly...
This is a cops-and-robbers puzzle the robbers' thread can be found here. Your task will be two write two programs (or functions) such that they are anagrams of each other and one performs the left inverse of the other. These programs may accept and output as many integers or complex numbers as you wish. If you choose...
This is a cops-and-robbers puzzle, the cops' thread can be found here. Your task will be to find an anagram of the provided programs in the cops' thread that performs its left inverse. Once you crack an answer post the solution as an answer below and notify the original answerer. You will be scored on the number of pro...
I found about Code Golf after writing this program and decided to post the rules here so you can try it out too. I saw this, which is a less restrictive version of my question. I've got a bit more rules which (in my opinion) make the task quite a lot more tougher. Title says it all. If the input is 8, we should get: 8 ...
Task Find all the non-negative integers up to and including a given non-zero positive integer n, that are prime and the count of 1's and 0's in their binary representation (having no leading zeroes) are prime too. Here are the first five such primes, 17, 19, 37, 41, 79 10001, 10011, 100101, 101001, 1001111 Clarific...
Task Given a ASCII diagram of a loop e.g. .................... ......@@@@@......... ......@...@......... .....@@...@@@@@..... ....@@........@..... ....@........@@..... ....@@@@@@@@@@...... .................... .................... And a location on the loop e.g. (7,1) You must find the inside and outside of the loop ...
I'd like you to build me a clock that displays time in this format: 18 ---------- 19 -------------------------------------------------- This displays '18:10'. The current hour and the next hour are shown at the front of the line, followed by a space and a number of dashes: on the first line the number of minutes that ...
Background Programmers these days can't seem to keep their buffers straight! A common source of error is trying to use an array index that is too large for the buffer. Your task is to implement a buffer where large indices are reduced to a size that the buffer can handle. Because I decide exactly what's best for everyo...
Since I saw the first one a few years ago, I always was subjugated by this kind of word clock where the time is actually spelled out by words being lit up or not into a meaningful sentence. The text displayed on that clock is the following. IT IS HALF TEN QUARTER TWENTY FIVE MINUTES TO PAST TWO THREE ONE FOUR FIVE SIX...
Yup, you read the title right. play the sound of pi. More specifically, for every digit of pi in the first 1000, map it to a musical note and output the resulting melody to a file. Basically, each digit turns to a note on the C Major scale (basically the normal scale). so 1 turns to Middle C, 2 turns to D4, 3 turns to ...
Count the number of contiguous blocks within a given 3D input. Input The input will consist of one or more rectangles of characters separated by blank lines. Each rectangle represents a cross section of the 3D space. The characters used will be 0, representing empty space, and 1 representing a solid block. Example 0000...
Inspired by this default for IO. The Task Write a program that, given an input integer x between 0 and 255, crashes with exit code x. Restrictions You may not call anything which is intended directly for exit code output (System.exit(x), returning from main, etc.). Instead, your program must cause an error or crash wh...
Challenge Write a function or program that accepts a line of input, performs a very specific and oddly familiar shuffle on its characters, and outputs the result. The required shuffling can be described using the following algorithm: Label each character in the input with a 1 based index. Write character number 1 as o...
The On-Line Encyclopedia of Integer Sequences (OEIS) is an online database of integer sequences. It contains nearly 280000 sequences of mathematical interest. Examples of sequences: positive integers (A000027) prime numbers (A000040) Fibonacci numbers (A000045) Your task is to write a program or function that displ...
Often I need a simple Hello World! program to show some basic concepts of a programming language on my travels. As I usually travel only with light luggage I can't to carry a Hello World! program for each language. So a program that generates Hello World! programs in as many languages as possible would be a great help....
EDIT It appears that there has been some confusion following my typo in the original post which used a lowercase o to define the plane and then an uppercase later. Unfortunately this bug did not get picked up in the Sandbox. Since many members have written answers with both and since the typo was my fault I will allow ...
Given a directed graph, output the longest cycle. Rules Any reasonable input format is allowed (e.g. list of edges, connectivity matrix). The labels are not important, so you may impose any restrictions on the labels that you need and/or desire, so long as they do not contain additional information not given in the in...
Task: Your challenge is, given previous submissions and itself as input, output the language that they're written in, in the following format: Say the first program is in Ruby. It must output 1, because Ruby is the 1st language used in this challenge. An example program is: a=gets puts 1 When given itself as input, it...
Challenge description On some channels on a popular streaming site twitch.tv a common message people tend to spam in chats to bait people into spamming "LUL" is One more LUL and I'm out LUL is a popular emote used to express that something funny happened on stream. Soon dank memes showed their potential and a parody o...
You should write a program or function which receives no input and outputs a stream of digits. The stream should contain at least once every positive integer number which does not contain the digit sequence 42. E.g. The string 1231 contains the integers 1 12 123 1231 2 23 231 3 31 (and 1 again) The stream should not c...
Disarium Dilemma A Disarium is defined as a number whose: sum of its digits powered with their respective position is equal to the original number Your Task: You have a strange obsession with numbers classified as being a disarium. The need to follow the ways of disarium is so great in you that you refuse to read a...
Task There is a set of numbers x, such that x^2 divides 7^x-1. Your task is to find these numbers. Given an input of n, the code will print the nth number that follows this rule. Examples 1-index In Out 3 3 9 24 31 1140 The relevant sequence can be found here. Rules Shortest answer will be the winner* Standa...
Sandbox post here. Create a function or program that "Springifies" a string. Input will be a String in Stdin, or closest alternative Input will only contain printable ASCII and/or spaces Output will be to Stdout, or closest alternative A trailing newlines and spaces are acceptable How to springify a String Format th...
Question : You will be given the starting and ending integers of a sequence and should return the number of integers within it which do not contain the digit 5. The start and end numbers should be included! Examples: 1,9 → 1,2,3,4,6,7,8,9 → Result 8 4,17 → 4,6,7,8,9,10,11,12,13,14,16,17 → Result 12 50,60 → 60 → Result...
Background Incident is a fairly unusual programming language, in that its list of tokens is not predetermined, but rather inferred from the input. As such, tokenising an Incident program can be fairly difficult, especially if you want to do so efficiently. This task is about doing that yourself. The task Your program w...
Challenge Description You have to show a simulation of rain in terminal. In the example given below its adding 100 raindrops at random (use the default random function which your language offers) coordinates, waiting for 0.2 seconds and then redrawing again until the given time expires. Any character can be used for r...
Given a non-negative integer \$n ,\$ output the \$n^{\text{th}}\$ Euler number (OEIS A122045). All odd-indexed Euler numbers are \$0 .\$ The even-indexed Euler numbers can be computed with the following formula (\$i \equiv \sqrt{-1}\$ refers to the imaginary unit): $$ E_{2n} = i \sum_{k=1}^{2n+1}{ \sum_{j=0}^{k}{ ...
There are an abundance of questions involving drawing shapes using asterisks - so I thought, with so many asterisks out there, we should draw one, using the ASCII table. Challenge Your task is to write a program or function which takes no input, and outputs this exact text: ! "# $% ...
Backstory Disclaimer: May contain made up information about kangaroos. Kangaroos traverse several stages of development. As they grow older and stronger, they can jump higher and longer, and they can jump more times before they get hungry. In stage 1, the kangaroo is very little and cannot jump at all. Despite this, is...
Brun's constant is the value to which the sum of the reciprocals of twin prime pairs (1/p and 1/(p+2) where p and p+2 are both prime) converges. It is approximately 1.902160583104. Given a positive integer N, approximate Brun's constant by summing the reciprocals of the twin prime pairs where both primes in the pair ar...
Now, we all know most languages have very simple ways to "self-modify" code. However, what if you were to actually modify the code and edit parts of it...on disk? Your goal is to make code that prints a number, then edits its own file to replace the number with the next one in the Fibonacci sequence like so: $ ./progr...
Write a program that terminates without an error. If any single byte is substituted by any other byte the program should output CORRUPTED Do not read your source code from a file Your program should not produce any other output This is code-golf so the shortest answer in bytes wins. Edit: removed "NOT CORRUPTED" req...
(Challenge taken from a multiplayer game (clash of code) at codingame.com) The challenge Find the n-th term of the following sequence: 1, 1, 2, 1, 2, 3, 1, 2, 3, 4... or, to make it more obvious, {1}, {1,2}, {1,2,3}, {1,2,3,4}... The sequence is made up from concatenated ranges from 1 to x, starting from 1, all the way...
Write a program or function that takes two inputs: A text message The dictionary of English language, as it appears in this Github file (containing about 60000 words) and outputs the number of spelling errors in the message (see below for definition and test cases). You can receive the dictionary as a parameter to yo...
Your task is to create a program that will display the following text, wait for the user to press a key (it is okay to ignore keys like ctrl, alt, caps lock, etc., as long as keys like letters, numbers, symbols, and enter are not ignored), and then terminate the program: Press any key to continue... Trailing newlines...
Everybody has heard of the phrase "be there or be square". So I thought it was time for a challenge about it. Input You will take a full absolute directory address as text as input via STDIN or equivalent. Output If the directory address exists and is valid, your program will move itself to that folder on your computer...
Related Goats are great. Everybody loves goats. And they also, for some reason, are an excellent complex ascii art for many languages to have built-ins for. Because of this, I personally feel a catalogue to document just how easily a language can print goats is greatly needed. The Challenge Given an integer input via a...
Introduction There is a small village with nothing but a few houses and empty fields. The local bureaucrats want to divide the village into lots so that each lot contains exactly one house, and the borders of the lots form a nice straight-line grid. Your task is to determine whether this is possible. The task Your inpu...
Challenge Summary In summary, the challenge is to provide the glider synthesis for a Game of Life configuration, which is your input. What does this mean? Well, firstly, let me explain a few terms. By Game of Life, I mean Conway's Game of Life. If you don't know what this is, you can read the Wikipedia article at htt...