instruction
stringlengths
34
53.1k
Jack likes the C programming language, but hates writing expressions like V=a*b\*h; to multiply values. He would like to just write V=abh; instead; why should the compiler moan about abh being undefined? Since int a, b, h; are defined, can't it just deduce multiplication? Help him implement a parser that deciphers a si...
Today your goal is to find integers a and b given non-negative integer n such that: You should write a program or a function that takes parameter n and outputs a and b in a format of your choice. Standard loopholes apply. Additionally, it's intended that you implement the above problem using basic arithmetic yourself....
You should write a program or function which receives a block of chars represented as a string and outputs or returns a similar string in which the letters adjacent in the alphabet are connected. A visual example (in the form of input => output): b d b d |\ /| ...
I've just bought a new jigsaw puzzle but, as a programmer, I'm too lazy to do it by myself. So I've devised a way to encode the pieces, and now I need a way to solve the puzzle itself. Challenge A puzzle piece will have from 2 to 4 connecting corners, defined by a letter; and a color, defined by a number. a B 1 c D...
A bit of background: When I first learned about Brainf*ck, one of the first things I did was to write a Java application that would take in a string and create a, somewhat, optimized program to print said string. Recently, I've been playing around with Piet, and I have been playing with doing the same thing. I have rea...
This challenge is about the game Tic Tac Toe, but it's played on a torus. How to play To create the necessary game board, you start out with a regular Tic Tac Toe game board. First fold it into a cylinder by joining the left and the right edge. Then fold it into torus by joining the top and the bottom edge. Here's a s...
Assign the numbers 0 through 7 to the 8 vertices of a cube in any way you want. Exactly one number must be assigned to each vertex. For example, your vertices might be assigned like this: 3-----1 /| /| 4-----2 | | | | | | 5---|-0 |/ |/ 6-----7 Write a program that takes in an integer from 0 to 5. Each of th...
What general tips do you have for golfing in The Shakespeare Programming Language? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to SPL (e.g. "remove comments" is not an answer). Please post one tip per answer.
A new code-golfer, Joe, just registered to the site. He has 1 reputation but determined to reach all his lucky numbers in reputation exactly. Joe believes in higher powers which will help him to achieve his goal with minimal amount of (his or others) actions. As a new user he also believes that negative reputation is p...
Write a program or function that takes a base n and a number x, and returns or outputs the n-ary Gray code of x. Rules n is an integer in the range 2 <= n <= 16. x is an integer in the range 0 <= n < 2**32. The inputted numbers can either be two integer arguments if you write a function, or two arguments to ARGV or a ...
First of all, this is more a challenge, than a serious programming question, I would like to share. Some of you might know the game Kuku kube, where you have to identify a square in a grid, which has a different colour than the others and click it. You can find it under http://kuku-kube.com/ . As this seems to be an id...
Write two functions of one line each that can encode and decode base64. Use any language you want, but if the language can naturally be converted to a single line (e.g. javascript) then any block of code separated by an end-of-line character is counted as a line. The functions must be self-contained. They cannot refer...
Write a program that: if a compiled language is used, compiles without errors if an interpreted language is used, runs without syntax errors for every major release of your language, and produces different output for every major release under which it is compiled/run. (It may produce the same or different output for ...
This challenge, if you accept it, is to write three functions or programs A, B, and C: A is a quine that outputs all of A,B and C (which is also the whole content of the code in your submission). B takes a parameter F and checks whether it is such a quine (outputting FBC), or doing something different. C takes a param...
Hodor is a slow-minded but endearing character on the show Game of Thrones (he's in the books as well of course). The only word he ever says is 'hodor'. Surprisingly, despite not having much of a vocabulary, Hodor always speaks in complete sentences with correct capitalization and punctuation, and does in fact convey m...
Background This puzzle is a variation on the four fours puzzle (itself the topic of a past question). Like that puzzle, the aim is to find mathematical expressions for different whole numbers, using only four digits and certain mathematical operators. In this case, however, the permitted digits are just 2, 0, 1 and 5. ...
The ordinal number system is a system with infinite numbers. A lot of infinite numbers. So many infinite numbers that it literally does not have an infinity to represent its own infiniteness. The image above gives a little idea of how they work. An ordinal number (Von Neumann construction) is a set of previous ordinal...
This challenge is entirely fictional. There is no time limit for this challenge. My little brother is terrible with computers! He saved up all of his money to buy a new one, and within half an hour the hard drive was wiped and the only software left is a lousy BF interpreter. The worst part of it is, he has a huge Geom...
For this challenge, an ASCII art quilt will be a block of text 24 characters wide and 18 lines tall, containing the characters =-<>/\ in a quilt-like pattern that is horizontally and vertically symmetrical. Example quilt: ======================== ------------------------ //\\//\\\//\/\\///\\//\\ <<><<>>>>><<>><<<<<>><>...
Since my use of Element has increased recently, I am interested in tips for golfing programs written in it. What general tips do you have for golfing in Element? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Element. Please post one tip per answer.
The Challenge Input: alphanumeric string. You can assume that the string will only contain the characters [0-9A-Z]. This can come from a parameter, command line, or STDIN. Digits are always before letters in terms of the base. Think like an extended version of HEX. Output X,Y Such that Y is the minimum base required to...
EDIT: As some of you suspected, there was a bug in the official interpreter: the order of composition in . was reversed. I had two versions of the interpreter, and used the wrong one here. The examples were also written for this incorrect version. I have fixed the interpreter in the repository, and the examples below. ...
I have a lot of java projects and I am often making new ones. I have a few helper classes (Vector, Logger, etc.) and it takes a lot of time correcting the first line to the correct package, I would really need a little program to help me fix it automatically. Your program will first take the name of the package the fi...
Write a program, that determines whether the multiplication table of the given finite magma represents a group. A magma is a set with a binary operation that is closed, that means for all \$a,b\$ in \$G\$, \$a*b\$ is again in \$G\$ (Closedness) Let \$(G, * )\$ be a magma. \$(G, * )\$ is a group if for all \$a,b,c\$ ...
Definitions: I define a "true antiquine" as follows: A true antiquine is a non-empty computer program of length n which takes no input and produces a copy of every valid program of length n in the same language, except the original program. I define a "modified antiquine" as follows: A modified antiquine is a non-em...
Successful code golf submissions are, by nature, filled with crazy symbols all over the place. To make their submission easier to understand, many code-golfers choose to include an explanation of their code. In their explanation, the line of code is turned into a vertically exploded diagram. For example, if this we...
This is a game of capture the flag, heavily inspired and based off of Red vs. Blue - Pixel Team Battlebots. That was an awesome question (thank you very much Calvin'sHobbies; I hope you don't mind that I shamelessly stole a lot of code from you) -- here's another team based king-of-the-hill. Hopefully, capture the flag...
Write code to determine who wins a four-card trick in a game of Spades. Fewest bytes wins. The input is a string that lists the four cards played in sequence like TH QC JH 2H (Ten of Hearts, Queen of Clubs, Jack of Hearts, Two of Hearts). A card is given by two characters: a suit from CDHS and a value from 23456789TJQK...
Consider a non-empty string of correctly balanced parentheses: (()(()())()((())))(()) We can imagine that each pair of parentheses represents a ring in a collapsed telescopic construction. So let's extend the telescope: ( )( ) ()( )()( ) () ()() ( ) () Another way to look ...
When students are first taught about the proof technique of mathematical induction, a common example is the problem of tiling a 2N×2N grid with L-shaped trominoes, leaving one predetermined grid space empty. (N is some nonnegative integer.) I will leave it to you to go over the proof if you do not already know it. Ther...
Overview Pearls (or Masyu) is a logic game played on a grid. There are black and white pearls placed on the grid. The object is to form a single, closed loop that travels through each pearl using only straight line segments and right angles. There are some rules that govern how the loop interacts with pearls: White pe...
The background My son Leonhard (4 years old) loves labyrinths. I don't know where he knows labyrinths from, but he paints them and knows quite well how they work: Recently, he started making a game from his paintings. These are his rules: a black square denotes the starting point. a hook denotes the exit of the labyr...
Introduction The Hausdorff distance measures the difference between two subsets of a metric space. Intuitively, a metric space is just some set with a built-in distance function; in this challenge, we will use natural numbers with the ordinary distance d(a, b) := abs(a - b). The Hausdorff distance between two non-empty...
You should write a program or function which takes a non-negative integer k and a sorted integer list Las input and outputs or returns a smoothed list M. M is created from the ascending list L by inserting at most k integer elements while keeping the list sorted. The inserted integers should be chosen in a way that the...
Iterated Function Systems An Iterated Function System (IFS) is a method of constructing self-similar fractals. Each fractal is defined recursively as the union of several copies of itself, with each copy obtained by applying a transformation function to the whole. The functions are usually affine transformations of the...
In this challenge, you will be given a list of points. These points lie on the perimeter of an imaginary square. Your goal is to: If possible, print out the rotation of the square, which will be a value from [0, 90) where 0 represents a square with lines vertical and horizontal. The rotation is to be given in degre...
I'm starting with golf code. But im only do C# so I know wont be a breaking record, but I want give it a try. Leibniz Challenge is here The first line contains the number of test cases (N) which is less than 100. Each additional line is a test case for a positive integer value (T) less than 10^7. I format the code to e...
My challenges tend to be a little bit hard and unattractive. So here something easy and fun. Alcuin's sequence Alcuin's sequence A(n) is defined by counting triangles. A(n) is the number of triangles with integer sides and perimeter n. This sequence is called after Alcuin of York. The first few elements of this seque...
It is the year 87,539,319 and solitary space-walking is now commonplace, many people travel into space by themselves, propelled by nothing but a jetpack on their backs, programming their course with a personal computer and keyboard as they go. You are one such person; you were out on a lovely, peaceful spacewalk, when,...
Write a GOLF assembly program that reads an integer from stdin (followed by a trailing newline), and outputs its prime factors seperated by newlines, followed by a trailing newline on stdout. The prime factors need not be in a particular order. 1 is not a prime factor. Your GOLF binary (after assembling) must fit in 81...
Background The birthday paradox is a popular problem in probability theory which defies (most people's) mathematical intuition. The problem statement is: Given N people, what is the probability that at least two of them have the same birthday (disregarding the year). The problem is usually simplified by ignoring leap...
Joe is your average BF developer. He is about to check in his code changes to their repository when he gets a call from his boss. "Joe! The new client's machine is broken! The brainfuck interpreter sets all the cells to random values before program execution. No time to fix it, your code will have to deal with it." Joe...
I recently got a new Sudoku app that produces really hard Sudoku's, which can't be solved using the standard strategies. So I had to learn a few new ones. One of these strategies is the Y-Wing Strategy. It is ranked under "Tough Strategies", but it is actually not that hard. Example For this strategy only 4 cells are ...
Write a program or function (or set of programs/functions) to encrypt and decrypt data given the following specification: Encryption Calculate an XOR hash of the input by XOR-ing every byte with each-other. XOR every byte of the input by this hash. Shift the result four bits left. Pad the left side with the first four...
You should write a program or function which receives a list of distinct integers as input and outputs or returns the number of occurrences of the input numbers in the following upside-down number pyramid. Starting from the original list in every step we create a new one with the maximal values of every pair of adjacen...
This challenge is partly an algorithms challenge, partly an optimization challenge and partly simply a fastest code challenge. A T matrix is fully specified by its first row r and first column c. Each remaining element of the matrix is just a copy of the element that is diagonally up and left. That is M[i,j] = M[i-1,j-...
Did you know that the Euclidean algorithm is capable of generating traditional musical rhythms? We'll see how this works by describing a similar, but slightly different algorithm to that in the paper. Pick a positive integer n, the total number of beats, and a positive integer k, the number of beats which are sounded (...
In this challenge, the goal is to recreate the On-Line Encyclopedia of Integer Sequences one sequence at a time. Similar to the Evolution of Hello World, each answer depends on a previous answer. Over time, this challenge will create a "family tree" of the OEIS sequences. It is simple to add on to this tree. Find a ...
Write a program that takes in an odd length string containing only the characters . and :. With the aid of an initially empty stack, generate a number from this string as follows: For every character c in the string (going from left to right)... If c is . and the stack has less than 2 elements, push 1 on the stack. If...
In the United States, the two opposing directions of traffic on a road are separated by a dashed yellow line if passing is allowed and two solid yellow lines if passing is not allowed. (Just one side can be dashed to allow passing on that side, and yellow lines can mean other things like center or reversible lanes, bu...
You should write a program or function which receives a string representing an ascii-art polygon as input and outputs ot returns the area of the polygon. The input is a string consisting of the characters _ / \ L V space and newline defining a simple polygon (which means no extra segments, no self-touch and no self-int...
In this challence, your task is to locate substrings with a given structure. Input Your input shall be two non-empty alphanumeric strings, a pattern p and a text t. The idea is that each character of p represents a contiguous non-empty substring of t which occur next to each other, and p represents their concatenation....
Very simple, write a program that at first glance appears to be a quine, but is not. Upon running, the program actually prints the source to a real quine, obviously distinct from the original program in some way, preferably creative, but since this is a popularity contest, the answer with the most upvotes wins. Standa...
Write a GOLF assembly program that given a 64-bit unsigned integer in register n puts a non-zero value into register s if n is a square, otherwise 0 into s. Your GOLF binary (after assembling) must fit in 4096 bytes. Your program will be scored using the following Python3 program (which must be put inside the GOLF dir...
You should write a program or function which outputs or returns as much of Chapter I of The Little Prince as it can. Your program or function has to be an M-by-N block of code containing only printable ascii characters (codepoint from 32 to 126) and newlines at the end of each row. You can only use at most 26 character...
About the Series First off, you may treat this like any other code golf challenge, and answer it without worrying about the series at all. However, there is a leaderboard across all challenges. You can find the leaderboard along with some more information about the series in the first post. Although I have a bunch of i...
Task The task is to golf a real-time exact string matching algorithm of your choice. Input Two lines of text supplied on standard input, separated by a new line. The first line contains the "pattern" and will simply be an ASCII string drawn from the letters a-z. The second line contains the longer "text" and will also ...
The Ship of Theseus is an old question that goes something like: If a ship has had all of its original parts replaced, is it still the same ship? For this golf, we're going to slowly replace "parts" on a "ship", and see how long it takes to get a whole new ship. Task A ship is comprised of at least two parts. The par...
Edit: Bounty puzzle at the end of the question. Given a set of 1-digit numbers, you should determine how tall a tower they can construct. The digits live on a horizontal plane with a ground level where they can stand. No digit wants to be confused with a multi-digit number, so they always have an empty space on both ...
In the webcomic Darths & Droids, Pete, who plays R2-D2 in the fictional roleplaying campaign around which the comic is based, once claims (warning: potential spoilers in the linked comic) that, with the Lost Orb of Phanastacoria rigged up to his shock probe, he can now dish out a whopping 1048576d4 of damage. (The GM h...
This is a screenshot of some text typed in a text editor: This is the same text at a larger size. Notice how visible the aliasing is on letters with prominent diagonal strokes like x and z. This issue is a major reason why raster fonts have lost popularity to “scalable” formats like TrueType. But maybe this isn't an...
You should write a program or function which given three positive integers n b k as input outputs or returns the last k digits before the trailing zeros in the base b representation of n!. Example n=7 b=5 k=4 factorial(n) is 5040 5040 is 130130 in base 5 the last 4 digits of 130130 before the trailing zeros are 3013 th...
You should write a program or function which given a string as input outputs or returns a string or list of the lowercase letters in the order they find their uppercase pair. The input is a string consisting of the characters [a-zA-Z] space and newline representing a torus (rectangular grid with wrap around for rows an...
Optimize the following function for number of tokens: int length(int x) { switch (x) { case 1: return 1; case 3: return 2; case 7: return 3; case 15: return 4; case 31: return 5; case 63: return 6; case 127: return 7; case 255: return 8; case 511: return 9; case 1023: ret...
A brick wall is a rectangle made of horizontal 1-by-n bricks stacked into rows. Here's a wall of height 4 and width 8, with brick sizes shown on the right. [______][______] 4 4 [__][____][__][] 2 3 2 1 [][______][____] 1 4 3 [____][______][] 3 4 1 This wall is unsteady because it has a fault, a place where...
You should write a program or function which given a starting order of distinct one-digit positive integers and the length of the track as input outputs or returns the finish order of the numbers. The input [5,1,2,6,7] and 14 defines the following race: -------------- 76215 -> -------------- Rules of the race The tra...
Identicons are small images of geometric patterns that represent the hash value of a string. Stack Exchange uses the identicons from Gravatar as each user's default avatar image. In this challenge, we will use the Gravatar identicons as well to generate some text to golf. Challenge This stack snippet (a minified versio...
I wanted to fool a friend by giving him a quine that almost worked, but became sloppier and sloppier. Create a program that, when run, will output the program, but one character off. Either one character can be added, removed or both (one character changes). But only one character. Your score will be (length of your pr...
Task Write a program or function that takes an image of width w and height h, and two integers a <= w/2 and b <= h/2, and outputs an ascii art representation of the image, with the dimensions a x b. The ascii art should be generated through the following steps (or another process with the same output): Resize the w x ...
You and some buddies are going bowling. There are a total of N bowlers. However, there are only N-1 chairs to sit in. The solution is simple: whoever's turn it currently is doesn't get a chair. Then when their turn is over, they sit in the chair of the person that goes next. Lets take an example. Say You are named A, ...
Write a program or function that takes in a single string containing only lowercase a-z, and prints or returns a truthy value if the word is the feminine version of the thing it represents and a falsy value if it is the masculine version. For example, hen is the feminine version for chicken and rooster is the masculine...
StickStack is a very simple stack-based programming language with only two instructions: | pushes the length of the stack onto the stack - pops the top two elements from the stack and pushes back their difference (second topmost - topmost) Language details The stack is empty at the start of the program. All instruct...
Almost the polar opposite if this challenge, and I suspect it will be slightly easier. Your task is to take two integers in the format a/b (Forming a rational number) then output the number in decimal exactly. For example, if you were to input 1/3, it would output: 0.33333333333333333 And would keep on printing 3s unt...
Your task is to create many programs. The first outputs 1, the second outputs 2, etc. The higher you can go, the better! However, all of these programs must be made the same list of characters. You can choose which characters to put in the list. Each program can only use a character as many times as it appears in the l...
Express a number Back in the 60s, the French invented the TV game show "Des Chiffres et des Lettres" (Digits & Letters). The goal of the Digits-part of the show was to come as close as you can to a certain 3-digit target number, using some semi-randomly selected numbers. The contestants could use the following operator...
Consider this ASCII version of a mechanism similar to a bean machine or plinko/pachinko game: O ^ \ ^ ^ ^ \ \ ^ / ^ U U U U U 1 2 3 4 5 The O is a ball that falls down. When it hits a ^, there's a 50-50 chance it will go left or right. When it hits a /, it always goes left. When it hits a \, it always ...
"Let's face it, aligned images are like little gifts from Heaven. Welcome, but unexpected." - Geobits +10000 reputation to whoever wins this challenge. Rules: 1) You are to generate a program. 2) Input will be an image, however whether it is passed as a file or a list of numbers is up to you. 3) Output will be a file w...
Edit: I will award a 100-reputation bounty for the first solver of the bonus puzzle at the end of the question! I will add the bounty to the question only when the answer appears as this bounty has no deadline. Given a non-decreasing list of one-digit positive integers, you should determine how deep dungeon the digit...
One of my kid's favorite toys is a set like this. Actually its one of my favorite toys - I've been playing with it and its been giving me some PPCG challenge ideas. Here's one: Write a program or function that takes an ASCII line drawing as input and decides whether or not it folds into a cube. Input Input will consi...
This is a tips question for golfing in python. Suppose you have two lists of strings, and you want to concatenate the corresponding entries from each list. E.g. with a=list("abcd") and b=list("1234"), calculate ["a1","b2","c3","d4"]. This is trivial in array-based programming languages, where operations generally apply...
Here is a simple ASCII art snowman: _===_ (.,.) ( : ) ( : ) Let's make him some friends. This will be the general pattern for our ASCII art snowpeople: HHHHH HHHHH X(LNR)Y X(TTT)Y (BBB) The leading spaces and the parentheses are always the same for all snowpeople. The different letters represent sections of the pa...
In Magic: the Gathering, mages (known as "planeswalkers") battle each other by casting spells. Spells cost mana. Five colors of mana exist: White, Blue, Black, Red, and Green, represented as {W}, {U}, {B}, {R}, and {G}, respectively. A spell's cost is slightly more complex. The cost can be any combination of the follow...
Write a program in any language that takes a single natural number n as input and generates a Pyth program that, in turn, produces, using nested lists, the nested set given by S(n), where: S(0) = ∅ S(n+1) = S(n) ∪ {S(n)} S(n) giving the set representation of the corresponding ordinal number. Using the list representa...
I have some books and a bookshelf. I would like to put as many books on the shelf as possible but I have a rule. All dimensions of the books (height, width and depth) should form a non-increasing sequence on the shelf. This means every books has to be at least as high as the ones after it on the self. The same goes for...
This challenge is inspired by dmenu, the program I use to launch other programs on my Linux box. To start, for example, GIMP, I simply hit the keyboard shortcut I have assigned to dmenu, type "gimp" and hit enter. However, I don't have to type the whole name. On my machine, if I type "gim", that's enough. Here's how d...
Inspired by one of Vi Hart's videos (which are a treasure trove full of potential challenge ideas) A snake is made up of segments of same length and the connection between each segment can be straight or make a 90° turn. We can encode such a snake (up to a rotation, which depends on the initial direction) by writing do...
Write a program that calculates the first n perfect numbers. A perfect number is one where the sum of the factors is the original number. For example, 6 is a perfect number because 1+2+3=6. No non standard libraries.The standard loopholes are forbidden.
Shortest answer wins. It must be sorted, and in 24hr time. The final line does not have a comma. Output should be as follows: '00:00', '00:30', '01:00', '01:30', '02:00', '02:30', '03:00', '03:30', '04:00', '04:30', '05:00', '05:30', '06:00', '06:30', '07:00', '07:30', '08:00', '08:30', '09:00', '09:30', '10:00', '10:3...
A casino uses the following deck of cards. (* is one of the card suits D, S, C or H.) _________ _________ _________ _________ _________ | | | | | | | | | | | | | | | * | | * * | | * * | | | | * | | | | ...
Background The twelve-coin problem is a classic balance puzzle commonly used in job interviews. The puzzle first appeared in 1945 and was posed to my father by my grandfather when he asked to marry my mother! In the puzzle there are twelve coins, one of which is either heavier or lighter than the others (you don't know...
A Friedman Number is a positive integer that is equal to a non-trivial expression which uses its own digits in combination with the operations +, -, *, /, ^, parentheses and concatenation. A Nice Friedman Number is a positive integer that is equal to a non-trivial expression which uses its own digits in combination wit...
I need to reduce the length of this code in Python 3 as much as possible (even if it will be less readable): a,b,x,y=[int(i) for i in input().split()] while 1: r='' if y<b:r='S';y+=1 if y>b:r='N';y-=1 if x<a:r+='E';x+=1 if x>a:r+='W';x-=1 print(r) It's a map: you are on (x,y) and you need to go to (a,b). S for...
I was told that using the cmp function can be very useful in code-golf. But unfortunately, Python 3 doesn't have a cmp function. So what's the shortest equivalent of cmp that works in python 3?
Write a program that takes in (via STDIN/command line) a non-negative integer N. When N is 0, your program should print O (that's capital Oh, not zero). When N is 1, your program should print \|/ -O- /|\ When N is 2 your program should print \ | / \|/ --O-- /|\ / | \ When N is 3 your program should print \ | / \...
I'm not even sure if this is even possible, but I think it's worth a shot. The Challenge Code/conceptualize a pseudo-random number generator that has the potential to produce results evenly spaced out with similar frequencies... with a twist. The random number generator has to 'loop' back after Foo iterations to its be...
Someone built a really fancy clock using Fibonacci numbers, which looks really nice but is fairly unusable. Just the way we like it! Let's recreate this. The clock is made up of 5 sections corresponding to the first five Fibonacci numbers, starting from 1 (i.e. 1, 1, 2, 3, 5): ccbeeeee ccaeeeee dddeeeee dddeeeee dddeee...
You should write a program or function which given a text as input outputs or returns the sum of the following three integers: Number of lowercase x's which are not part of a cross-formation. Number of uppercase X's which are not part of a cross-formation. Number of cross-formations which are made of neither x nor X. ...
Introduction Here at code colf SE, we appear to love meta-problems. Here, I've tried to compose a meta-problem that's an interesting, not-straightforward challenge. Challenge The answer code is allowed to read its own source code, but not allowed to use external resources. All characters should be 5-lines tall. Charact...
Take a unit circle centered on the origin. In any two neighboring quadrants, mirror the curve of the circle across the lines connecting the circle's x and y intercepts. With the resulting shape, you can tile the plane: I made this image with the awesome 2D physics sandbox Algodoo! Write a program that outputs an image...
This problem is from Five programming problems every Software Engineer should be able to solve in less than 1 hour which itself is an interesting read. The first few problems are trivial, but the fourth one can be a bit more interesting. Given a list of integers separated by a single space on standard input, print ou...