instruction
stringlengths
34
53.1k
It's back to school season! So for a part-time job, you're helping out at the school's library. The problem is, the head librarian has never even heard the words "Dewey Decimal," let alone implemented that system. Instead, the sorting system in use has grown "organically" as the library has expanded... In an effort to ...
The idea here is to produce an almost repeating pattern. That is, the sequence being constructed changes at the last moment to avoid a repetition of some subsequence. Subsequences of the type AA and ABA are to be avoided (where B is no longer than A). Examples: I'll go ahead and start by listing all of the small exampl...
There exists a very simple cipher that replaces a letter with it's position in the alphabet. For example, abc would become 1 2 3 in this cipher. This challenge is an alternative take on this cipher. The Challenge Create a program that takes an input of ASCII characters, and outputs a space-separated string of: intege...
Write a program that tests if a number n is prime by checking that none of the integers between 2 and n-1 (inclusive) divide n (you must use this algorithm!). The input to STDIN should be an integer n (strictly) greater than 1. The output to STDOUT should be prime if n is prime and not prime if n is not prime. Even tho...
In modern day standards Golfing translates to playing a game of golf, while golf itself translates to a car manufactured by Volkswagen. So instead of the usual golfing of code, you will today be coding a golf. Challenge Write a program (A) in language A which will output the source code of another program (B) of lang...
You live inside a terminal that is 80 characters wide. You are bored, so you decide to play dominoes. No, not the boring kind that look like Scrabble, the fun kind where you spend an hour setting them to watch them fall in a second. In terminals, dominoes look like this: | upright domino \ left-tilted domino / ri...
The Challenge Create a function that, when given an input of ASCII art (directing a path that may eventually loop), outputs the length of the loop (if there is one) and the length of the "tail" leading into the loop in one of the forms below. Input Your input must be passed to a function. Below is an example of a simp...
Most of us LOST fans out there remember the computer that Desmond had to type the characters "4 8 15 16 23 42" in every 108 minutes or the world would end (or would it?). The challenge here is to create a program that would do the same thing by requiring that every 108 seconds the input 4 8 15 16 23 42 is entered or it...
Write two triangle (i.e. pyramid) shaped programs. The first one should be an upwards pointing text triangle with a minimum base width of three characters. So it would have a structure like X XXX or X XXX XXXXX or X XXX XXXXX XXXXXXX or larger. Each of the X's is to be replaced with the characters of your ...
If you remember back to your schooling years, you might remember learning about Truth Tables. They seemed boring, but they are basis for logic and (some would argue) all computing... Problem Your mission, should you choose to accept it is to write a program, function, or widget of code that can output a truth table gi...
Background Person of Interest is a crime drama on CBS, and my favorite TV show, as of late. The show is about a man named Harold Finch, a billionaire programmer, and his partner John Reese, a special forces veteran and ex-CIA operative. This programmer created a sentient AI called "The Machine" that predicts violent cr...
The Rugby World Cup starts in a few hours! Write a program or function which, given a rugby team score as input, outputs all possible ways the score could have been attained in a Rugby game. Ways to score in Rugby Penalty kick/Drop kick: Both penalty kicks and a drop kicks are worth 3 points (We regroup them in this c...
Computers live by binary. All programmers know binary. But the 2**x bases are often neglected as non-practical, while they have beautiful relations to binary. To show you one example of such a beatiful relation, 19 will be my testimonial. 19 10011 103 23 13 j 19 is decimal, included for clarity. 10011 is 19 in binary...
Introduction Don't you hate it when someone uploads an album you like to YouTube, but the description only contains a track listing? Like this: 1. Everything in Its Right Place - 4:11 2. Kid A - 4:44 3. The National Anthem - 5:50 4. How to Disappear Completely - 5:55 5. Treefingers - 3:42 6. Optimistic - 5:16 7. In Lim...
Given any unsigned 16 bit integer, convert its decimal form (i.e., base-10) number into a 4x4 ASCII grid of its bits, with the most-significant bit (MSB) at the top left, least-significant bit (LSB) at bottom right, read across and then down (like English text). Examples Input: 4242 +---+---+---+---+ | | | | # | ...
Cluck cluck. No one knows why the chicken crossed the road, maybe there was a good looking rooster on the other side. But we can figure out how. Write a program, that, left to right, crosses this (or any) "road". 1356 | 1738 3822 | 1424 3527 3718 9809 | 5926 0261 | 1947 7188 4717 6624 | 9836 4055 | 9164 2636 4927...
Some trading cards have real value and can be sold for money. Bending the cards is frowned upon because it takes away their value and makes them look less new. Say you have a deck of trading cards (Pokemon, Magic, etc.) and you want to shuffle them. Instead of doing the bridge that bends all of the cards, another simpl...
Introduction Everyone's heard of sine (sin), cosine (cos), tangent (tan), cotangent (cot), secant (sec), and cosecant (csc). Nearly every angle has them. Far less known, or remembered, are the exsecant (exsec), excosecant (excsc), versine (versin), and coversine (cvs). Nearly every angle has those as well. There are s...
You should write a program or function which receives a string representing an ASCII art as input and outputs or returns the number of endpoints in the input. The input will consist of the characters space - | + (with 0, 2, 2 and 4 endpoints respectively) and linebreaks. E.g.: -|++- + Two adjacent characters are con...
Blackbeard was an English pirate of the early 18th century. Although he was known for looting and taking ships, he commanded his vessels with the permission of their crews. There are no accounts of him ever harming or murdering his captives. This challenge is in honor of the infamous Blackbeard and inspired by Internat...
I am a teacher who was given a problem a few years ago. Every year since I have given it to my advanced students as a bonus assignment, but in ~10 years only 8 solved it, each with a slightly different approach. The problem is as follows: You have some input (from stdin), in the following format (the //comments are not...
The Challenge Write a program that can calculate how many times and how long a ball will bounce based on a few input variables. Input There are three variables that will be passed. You can accept these however you like (user input, function call, etc). The variables are as follows: height velocity "bounciness" They ...
Consider taking some non-negative integer such as 8675309 and computing the absolute values of the differences between all the pairs of neighboring digits. For \$8675309\$ we get \$|8-6| = 2\$, \$|6-7| = 1\$, \$|7-5| = 2\$, \$|5-3| = 2\$, \$|3-0| = 3\$, \$|0-9| = 9\$. Stringing these results together yields another, sm...
Bob the Bowman o /( )\ This is Bob. L L Bob wants to be an archer. ############# . / \ <--- bow So he bought himself a (c -)-> <--- arrow nic...
Holy wars have been fought over spaces vs. tabs. (And of course spaces, being objectively superior, won.) —Alex A. Some people still refuse to accept that which is clearly supreme. You've just received a file using the incorrect, bad, and inferior form of whitespace, and now the contents of the file are tainted and...
Say that you have a string like this: abaabbbbbaabba Count the number of times that a specified character appears in the input string, but only if the character appears only once in a row. For example, if the character is a, abaabbbbbaabba ^ x x ^ The total would be 2 (the aa's wouldn't count because the a app...
Write a program that converts a mathematical expression to words, evaluates the expression, and prints how the equation would be spoken aloud. Input The input must only contain numbers and the symbols +, -, *, and /. There cannot be any whitespace in the input. The input does not say what the expression is equal to. ...
I'm sure you know about the $9.99 price scheme, instead of using $10. Well, in your new job as a sys admin at a large retail store, they want prices to adhere to a similar scheme: All prices are in whole dollars, no cents. All prices should end with 5 or 9, rounding to the closest but up if the last digit is right bet...
Groups In abstract algebra, a group is a tuple \$(G,\ast)\$, where \$G\$ is a set and \$\ast\$ is a function \$G\times G\rightarrow G\$ such that the following holds: For all \$x, y, z\$ in \$G\$, \$(x\ast y)\ast z=x\ast(y\ast z)\$. There exists an element \$e\$ in \$G\$ such that for all \$x\$ in \$G\$, \$x\ast e=x\...
Monday Mini-Golf: A series of short code-golf challenges, posted (hopefully!) every Monday. A Fibonacci-like sequence is obtained using the same method as the famous Fibonacci sequence; that is, each number F(n) is found by adding the previous two numbers in the sequence (F(n) = F(n-1) + F(n-2)), or by subtracting the ...
Here is your task, should you choose to accept it: Output (through STDOUT, or whatever is most convenient) some n by m ASCII art that has at least one line of symmetry and is non-empty. Example: HiiH iooi iooi H!!H This is a 4x4 example output. (Note: I define an ASCII character to be in the ASCII range 32-126 plus ne...
I need a UUID. Your job is to generate one. The canonical UUID (Universally Unique IDentifier) is a 32 digit hexadecimal number with hyphens inserted in certain points.The program should output 32 hex digits (128 bits), in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (8-4-4-4-12 digits), where x is a random hexadec...
Write a program or function that takes in two positive integers, a width and a height, and draws an ASCII art houndstooth grid pattern with those dimensions using this 25×26 text grid as the base cell: .......#.....#####....... .......##.....#####...... .......###.....#####..... .......####.....####..... .......#####.....
Welcome Back to the Future's fans and enthusiastic codegolfers. Let's begin with this simple statement : Marty arrives in 2015 in one month (On october the 21st !). Therefore I propose we use the time remaining to pay him and the saga the best homage we can. Task Marty left for 2015 on October the 26, 1985. Thus, you ...
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 inputs that contain parentheses, which...
We all have knowledge of the periodic table, since our days in school. Something most of us have often tried to do is to spell out your name using elements of the table. Your challenge is to do exactly this. You will be given a string to STDIN or equivalent, and you will need to output the formula corresponding to the ...
Currently, the Stack Exchange network has nearly 150 sites. These sites are as follows: Computer Graphics Portuguese Language elementary OS Open Source Law Русский язык Mythology Health Stack Overflow на русском CiviCRM Woodworking Music Fans Vi and Vim Coffee Engineering Lifehacks Economics History of Science and Math...
The Challenge Write a program that can take an input of a single-line string containing any ASCII printable characters, and output the same string encoded in Base85 (using a big-endian convention). You can assume that the input will always be ≤ 100 characters. A Guide to Base85 Four octets are encoded into (usually) ...
Some time ago, the following question was asked: GolfScript, CJam, or Pyth? Based on the title only, I thought that it would be a very nice challenge, but unfortunately, it turned out to be a question asking for tips. Here is the challenge I wanted to read: Who said golfing languages were not used in the Real World? ...
Challenge: Create a program that compresses a semi-random string, and another program that decompresses it. The question is indeed quite similar to this one from 2012, but the answers will most likely be very different, and I would therefore claim that this is not a duplicate. The functions should be tested on 3 cont...
As we all know, the Zelda series are one of the best game series ever made. In honor of that, let us play some songs on the ocarina. Challenge: Write a program which, given a song, outputs the score to stdout for that particular song. Input: The song which you will have to output the score of will be given by a unique ...
Overview In this challenge, your task is to randomly generate a monotonic mathematical function between two sets. Input Your inputs are two positive integers s and n. After getting these inputs, your program shall generate a random mathematical function f from the set {0,1,...,s-1}n to {0,1,...,s-1}. In other words, f ...
Your job is to take a string input and a number and align the string to the right, making the width of the text the number. When a line is too long, break it and put the rest on the next line, repeating until it's not necessary. If a line is shorter than the width, then pad it with spaces. Multiple newlines can occur, ...
Write a program that outputs Do not repeat yourself! Your program code must respect the following constraints : its length must be an even number each character that is in position 2n (where n is an integer > 0) must be equal to the character in position 2n-1. The second character of the program is equal to the firs...
Scores This section will be filled in as submissions are entered. Normal 1. bopjesvla Perl 54 2. edc65 Javascript (ES6) 91 3. name language score 4. name language score 5. name language score Bonus Round 1. name language score 2. ...
The Challenge Write a program or function that takes two input integers, i and j, and outputs their greatest common divisor; calculated by using the Euclidean algorithm (see below). Input Input may be taken as a space-delimited string representation of i and j or as two separate integers. You can assume that integers ...
Your company is just getting started on a project, and for the first time you decided to go use a functional programming code-style. However your boss is really diffident and doesn't want to use built-in functions, and requires you to implement yourself the main functions. In particular you need to write the functions:...
(First challenge, please let me know if there are any problems with it.) A heterogram is a word where no letter of the alphabet occurs more than once, and a palindrome is a phrase that is the same backwards and forwards. The challenge here is to write a piece of code that takes in a word (just letters) as input, and o...
The goal of this challenge is to write a program that visualizes a dependency graph in the form of a tree. While "dependency graph" in this context means nothing more than a directed graph, the visualization method described here works best for graphs describing some dependency relation (as an exercise, after you've re...
The Challenge Create a program or function that takes no input, and outputs (or returns): I'm a programming paradox — no I'm not. Without using a character twice in any string, or digit twice in any integer. Rules You may not use any character twice within a string. For example, the word "test" would violate this ru...
Introduction In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other catalogue challenges, there is "Hello World!" and "Is this number a prime?". Challenge Write a program that prints the decimal ...
Confidant Numbers Let x be an integer of an arbitrary base, such that D is an array of its digits. x is a Confidant Number if, for all n between 1 and the length of D: D[n+1] = D[n] + D[n-1] + ... + D[1] + n Take, for example, the number 349 in base 10. If we label the indices for this number, we have the following. ...
The famous C64 basic one liner 10 PRINT CHR$(205.5+RND(1)); : GOTO 10 prints a maze of slashes and backslashes. \\/\\\//\/\////\\/\/ \/\///\\///////\//\/ /\\\//\//\////\\//\\ \////\//\//\/\\\\\\/ /\/\\///\\\\/\\\\/\\ \/\//\\\\\\//\/\//// /\//\\///\/\///\//// \/\\\//\\/\\\//\\/\/ //////\\/\\/\/\/\/// \\/\/\\////\/\/\\/...
Create a program that does the same thing forwards and backwards, in different languages. “Different languages” does not include different versions of the same language. Challenge This program can take any input and write anything to stdout and stderr. However, the program must output exactly the same things for the sa...
Prime numbers have always fascinated people. 2300 years ago Euclid wrote in his "Elements" A prime number is that which is measured by a unit alone. which means that a prime is only divisible by 1 (or by itself). People have always looked for relations between prime numbers, and have come up with some pretty weird (a...
Being short of cash, you have signed up to build donuts for The Doughnut Shop™, the biggest digital doughnut company in the world, mostly because they sell every size of doughnut imaginable. Now, given that trading standards nowadays is very tough, you need to write a piece of code as short as possible to create these ...
You've just been hired by a German car manufacturing company. Your first task, as an engineer, is to write a program that computes the ecological footprint of ASCII strings. The ecological footprint of character is computed as follows: Write the character's ASCII code in binary, and count the number of 1's. For examp...
Introduction Remember the roaring 80's? I mean, you know, like 30 years ago? No cell phones, no internet, no ATM's, fluorescent clothing (what was that?!) and scrolling marqee's! No, no, no! Not the online ones, but real ones, With LED lights. Since I'm in a nostalgic mood, I'd like you to create a scrolling marquee. ...
Bonjour, PPCG ! Quelle heure est-il ? This means what time is it in French, for that is exactly what this challenge is about. Telling time in French (at least formally) is a bit different from telling time in English. Telling the time starts out with Il est (It is). Then, you put the hour followed by heures (o'clock). ...
Input will consist of the following characters: ^: Go up one v: Go down one ▲ or k: Go up two ▼ or j: Go down two For example, the following input: ^^▲^v▼▲^^v would produce the following output: ^ ^ ^ v ▲ v ▲ ^ ▼ ^ Escape sequences that move the cursor such as \e[B are not allowed. You must produ...
Introduction We all love StackExchange, therefore it would be essential to download all gems hidden on Stack Overflow repositories in the simplest possible way. Challenge/Task Your task is to write a script or program which would: Fetch the list of all (within current page) repositories under Stack Overflow GitHub acc...
Congratulations! You've just been hired by NASA to work on the new Horizons 2 project. Sadly, there have been huge budget cuts recently, so the top management has decided to fake the whole planned Pluto flyby (as they did for the moon landings in the 70s). Your task is to write a program that will accept as input a dat...
This challenge is a slightly different kind of Code Golf challenge. Rather than coding to match IO, you code to match an interface. Background Finite state machines are very useful design models for modeling event-based programming. A state machine is defined by a set of states and tranitions between them. The machine ...
Given a dictionary file (a text file containing a word or phrase on each line, with possible punctuation but no numbers; lines are alphabetized), you must output each combination of words where one letter can be removed from a word to make another; the removed letter should be encased in parentheses. For example, the i...
The shortest reliable password testing code Introduction I started playing Empire of Code recently, and there was some challenge. The player is supposed to write a piece of Python or Javascript code to detect if the string passed to it is reliable password, that is, it contains at least one lowercase Latin letter, one ...
In Lisp style languages, a list is usually defined like this: (list 1 2 3) For the purposes of this challenge, all lists will only contain positive integers or other lists. We will also leave out the list keyword at the start, so the list will now look like this: (1 2 3) We can get the first element of a list by usin...
One of the reasons I've always loved Pokemon is because for such a simple-seeming game, it has so many layers of complexity. Let's consider the move Hidden Power. In game, the type and power (at least before Generation VI) of Hidden Power is different for every Pokemon that uses it! That's pretty cool, right? Now, woul...
(Previously on "Print the __ without using __" ... this one and this one) The game of Hearts has a popular scoring variant called "Shooting the Moon," whereby instead of trying to not acquire penalty cards (and thus penalty points), as is the usual gameplay strategy, if you acquire all of the penalty cards you actually...
We all know that if you google the word "google" it will break the internet. Your task is to create a function that accepts one string and returns its length, in the fewest possible Unicode characters. However, if the given string is google (lowercase), it will cause an error. For example, g('bing') will return 4 but g...
Inspired by a chat conversation I lurked. I am an adventurer on the far away land of Zendikar. I truly enjoy traveling the land. Bushwhacking, weathering the roil and encountering strange and exotic flora and fauna are the highlights of any good adventure. Unfortunately, my duties as an adventurer do not always allow m...
Monday Mini-Golf: A series of short code-golf challenges, posted (hopefully!) every Monday. Many web applications (especially social media) automatically truncate long passages of text so they fit within the app's formatting. In this challenge, we're going to create an algorithm to automatically trim a passage of text ...
A while ago, we had a challenge related to antiferromagnetism (AF) in two dimensions. Now, on a 2-d square lattice, antiferromagnetic is antiferromagnetic, and that is all there is to it. Moving to other lattice types or higher dimensionality, things get more interesting. Here, we will explore the second route: mag...
Challenge Write a program/function that accepts an "image" and outputs a picture maze formed from that image. Input Your program should accept two arguments: I, the image to form the maze from S, a boolean specifying whether or not to display the solution to the maze I is given in the following form: ....... .#####. ...
Write a program in a language with name A that, given a string S, outputs the name of a different programming language B. The length of B must be equal to the Levenshtein distance (abbr. "LD") between A and S. To be considered a programming language, B must have an esolangs page or a Wikipedia page. Example: (Suppose t...
Minesweeper is a popular computer game that you have probably wasted time playing where you try to reveal the cells that are mines in a rectangular grid based on hints of how many neighboring mines each non-mine cell has. And in case you haven't played it, do so here. A nifty mathematical fact about a Minesweeper grid ...
Monday numbers, as defined by Gamow in this question over on Puzzling, are positive integers N with the following three properties: The decimal representation of N does not contain the digit 0 The decimal representation of N does not contain any digit twice N is divisible by every digit D that occurs in its decimal re...
A kitten is much like a cat. Some of the main differences are cuteness, lack of intelligence, and size. Similarly, the cat command is different from the kitten command. Fortunately, there is only one difference in this case. In the kitten command, all uppercase letters are replaced with lowercase letters. Objective To...
The Banach–Tarski paradox states that, given a ball in 3‑dimensional space, you can decompose the ball into a finite number of point subsets. These disjoint sets of points can then be reassembled to produce two copies of the initial ball. You would then, theoretically, have two identical balls. The process of reassembl...
Your company lately hired a new bunch of extremely dedicated sysadmins. They feel that just watching computer screens is quite limiting (I mean, 60Hz refresh rate is just NOT enough), so they hooked up the CPU data bus to an DAC and play that on a speaker through the server room so that they can hear up to 20kHz. One p...
C/C++ use double quotes "" for making string literals. If I want the double-quote itself, or certain other characters, to appear in the string, I have to escape them, like so: char *s2 = "This is not \"good\".\nThis is awesome!\n"; Here, I used \" to represent a double-quote, and \n to represent the newline character....
A Vigenère Cipher is encrypted by repeating a keyword to be the length of the plaintext, and summing each character in that text with the corresponding letter in the plaintext modulo 26. (using A=0,B=1 etc.) For example, if the keyword is LEMON and the plaintext is ATTACKATDAWN, then the key is repeated to form LEMONLE...
Problem: given any input string that does not contain null bytes, determine whether or not the input string matches glob as defined below: null is disallowed in both string in glob * matches zero or more characters ** is disallowed in glob ? matches exactly 1 character [ch] matches a character class o...
You should write a program or function which receives a string representing a chessboard with only pawns as input and outputs or returns whether any capture is possible on the board. Input is in a FEN-like notation describing positions of white and black pawns with no other pieces present. You should decide if there is...
Your task is to create a program which takes a string, and if it contains any numbers, symbols or other non-letter characters, it throws an error. Else, it returns the original string. (The string may include whitespace) ("Letters" are a-z and A-Z) Examples: Input: My name is Joe Output My name is Joe Input: My userna...
A three-fruit pie is made of three different fruits. What is the most three-fruit pies you can make from the quantities of 5 fruits you have? For example, with 1 apple 1 banana 4 mangoes 2 nectarines 0 peaches you can make 2 pies: apple, mango, nectarine banana, mango, nectarine Input: Five non-negative integers, ...
The Challenge Implement the Sundaram sieve for finding prime numbers below n. Take an input integer, n, and output the prime numbers below n. You can assume that n will always be less than or equal to one million. Sieve Start with a list of the integers from 1 to n. Remove all numbers that are in the form i + j + 2ij...
Objective Design a modulator/demodulator pair to accurately transmit data as quickly as possible over simulated plain old telephone service (POTS). Steps Generate some random (/dev/random or the like) data that will take 3-4 seconds to transmit Modulate the data with your modulator to produce an audio file Pass the au...
I have always failed to give an answer for kolmogorov-complexity challenges which require string compression, the main reason being that I don't know to use string compression tools as effectively as I should. For this reason, I have posted this question. Unlike my other tips questions, this is not language specific m...
Between the kitten question and seeing this question at U&L about some sed magic, how about implementing tac? Objective Implement a program that will reverse and print the lines in a file. Input A file, provided as a name or via standard input Output The lines, reversed, to standard out. Scoring Bytes of source cod...
Question We are captured by robot army on their space station. Our space ship pilot is in the prison which is in level 1. There is only one way how to escape and it's rescuing your space ship pilot. It mean's moving from level N to level 1. However because it's very risky you need to get to the prison in the least numb...
Introduction In this challenge, we will simulate a certain probabilistic cellular automaton using very bad pseudorandom numbers. The cellular automaton is defined on binary strings by the following local rule. Suppose that the left neighbor of a cell and the cell itself have states a and b. If min(a,b) == 0, then the ...
Since the first weekend of October is drawing near, let's have our own Oktoberfest! Background You and some other programmers have been hired by the local sausage guys in Munich, Germany. The sausage guys provide Oktoberfest with all the sausages the giant Volksfest needs. You manage to overhear your boss speaking to t...
I define the following operators: Manhattan Addition a +M b, for single-digit numbers, is the result of concatenating b onto a. So, a +M b = 10a + b. Therefore, the general operator +M is defined as thus: a +M b = 10a + b Manhattan Subtraction a –M b, for single-digit numbers, is the result of removing the last b from ...
A challenge with simple rules but non-trivial algorithms. :-) Task Take input in the form of space-separated integers: N A B S Where N is the side length of a 2D square matrix filled with unique numbers (integers) between A and B inclusive. For each row and column in this matrix, the sum is always the same: S. (In oth...
The goal of this challenge is to create a program that takes in a matrix and outputs its reduced row-echelon form. A matrix is in reduced row-echelon form if it meets all of the following conditions: If there is a row where every entry is zero, then this row lies below any other row that contains a nonzero entry...
Have you heard about trees? When performing DFS on a binary tree, you can traverse it in 3 possible orders. Root, left node, right node (Pre-order) Left node, Root, right node (In-order) Left node, right node, root (Post-order) Check wikipedia to know more. For this challenge, you have to provide a program that, giv...
Objective Write a program in any language that reads a matrix from stdin in which all columns are space delimited and all rows are newline delimited. The program must output a sub matrix so as that there is no other sub matrix with greater average, this sub matrix' average value, as well as the starting and ending coor...
Objective You have two knights on a standard chessboard labelled 1-8 and A-H, one knight is located at 1C and the other at 2G. You have to write a program in the language of your choosing that accepts a set of coordinates from stdin, like 2C, and then calculates which of the two knights you have to move in order to cap...
Your task is to create the shortest infinite loop! The point of this challenge is to create an infinite loop producing no output, unlike its possible duplicate. The reason to this is because the code might be shorter if no output is given. Rules Each submission must be a full program. You must create the shortest infi...
The Challenge Write a complete program that writes twice as many bytes to standard output as the length of the program. Rules The program must write ASCII characters to the standard output. The contents of the output doesn't matter. The output, measured in bytes, must be exactly twice the length of the program, also ...