instruction stringlengths 34 53.1k |
|---|
Kakuro Combinations
Because I can't do mental arithmetic, I often struggle with the Kakuro Puzzle, which requires the victim to repeatedly work out which distinct numbers in the range 1 to 9 (inclusive) sum to another number in range 1 to 45 when you know how many numbers there are. For example, if you may want to know... |
Integer math can generate amazing patterns when laid out over a grid. Even the most basic functions can yield stunningly elaborate designs!
Your challenge
Write 3 Tweetable (meaning 140 characters or less) function bodies for the red, green, and blue values for a 1024x1024 image.
The input to the functions will be two ... |
Here is a fairly simple ASCII depiction of an open book:
|\
| \
| \
| \
| \__________
| || |
| || Lorem i |
\ || psum do |
\ || lor sit |
\ || amet, |
\ || consect |
\||_________|
Notice that the text portion is only on the right page and is 7 characters wide by 5 tall. Also notic... |
Winner: Ian D. Scott's answer, by one byte (48 bytes)! Superb!
Your program must accept input from a fraction that can be simplified, then simplify it.
Rules:
If the fraction is already in its most simplified form, you must inform the user
No built-in functions to do this
The user must type the number at some point, h... |
Task: Have your program randomly choose one of the following two quotes at runtime and print that one quote, exactly as shown.
1:
Under the spreading chestnut tree
I sold you and you sold me.
There lie they, and here lie we
Under the spreading chestnut tree.
2:
WAR IS PEACE.
FREEDOM IS SLAVERY.
IGNORANCE IS STRENGTH.
... |
Task
Write a program that takes in a compound made solely of elements with an atomic number less than or equal to 92 (Uranium), and outputs the molar mass of the compound in grams/mole.
Rules and Restrictions
You may not use a function that directly calculates molar masses for you.
Your program must be able to run on ... |
Challenge
For any given input Y of length >= 1024 bytes:
sort in ascending or descending order -- your choice
generate output Q, where Q = [sorted data] + [restore
information]
restore Y using Q as input
Sorting Example
input: [2, 5, 119, 0, 1, 223, 0, 118, ...]
output: [0, 0, 1, 2, 5, 118, 119, 223, ...] + [restore... |
Task
Your task is to write a function or a program in a language of your choice that analyzes a couple of statements and determines whether it can be concluded from those statements that pigs are able to fly.
Input
The input is a String that can be read from STDIN, taken as a function argument or even be stored in a fi... |
Idea
From a given word dictionary (containing only plain letters, i.e: no accent or other special chars), with a given fixed word length, find every same when a given number letters are missing.
For sample: un--ed could match: united, untied or unused
Using my dictionnary: /usr/share/dict/american-english, searching f... |
Here's a challenge inspired by Programming Praxis:
http://programmingpraxis.com/2009/02/19/flavius-josephus/
Write a function josephus(n,m) that returns a list of n people,
numbered from 0 to n-1, in the order in which they are executed, every
mth person in turn, with the sole survivor as the last person in the
list.
... |
Pick a quote or phrase that is exactly 5 words long, such as Programming puzzles and code golf!.
Write a program that, when appended to itself n times, outputs the first n + 1 words of your phrase in order.
For example, if your program code was MYPROG and your phrase was Programming puzzles and code golf!, running...
... |
Programmin' Pac-Man
Setting
You play as Pac-Man. You want to collect pellets, fruit, and power pellets before anybody else, all while avoiding ghosts.
Rules
Every valid Pac-Man will be in a single maze. The player with the highest cumulative score after 10 games will win.
A game is over when all Pac-Men are dead, al... |
Challenge
Find the smallest cover of bases (e.g., moduli) whose sets of quadratic residue can be tested via table-lookup to definitively determine whether or not a given non-negative integer n is a perfect square. The bases must all be less than or equal to the square root of the maximum value of n.
The answer with the... |
It has been proven that the following 13 square Wang tiles always tile the plane aperiodically. This means that when the squares are arranged in a grid with all neighboring sides the same color, a translation of the pattern will never match up with itself.
We'll represent each tile textually by a 3×3 grid filled with ... |
The aim is to parse a sentence and compress/encrypt it according to the rules below and then decrypt it using the key:
Remove all letters in a word before the first vowel is encountered. Example: pigeon becomes igeon.
All characters except alphabets should be kept in the sentence including numerals, punctuations, etc.... |
Golf a Venn Diagram generator
In order to properly celebrate John Venn's 180th birthday, today your task will be creating a program that outputs a Venn Diagram!
Input:
A positive integer N that will define the range of numbers appearing in the diagram (From zero to N) and three sets of positive integers.
Output:
A 3 s... |
Calculate the Riemann zeta function to the maximum primitive precision in your language (for C-family, that would be double or long double, var in JS, etc.) No need for BigDecimal or the like unless you need it to use a double-equivalent precision.
Efficiency (be sane) doesn't matter.
If it's not in a common language,... |
Challenge
Challenge is writing a program that takes a positive numbers a and a nonzero number b and outputs a^b (a raised to the power b). You can only use + - * / abs() as mathematical functions/operators. These can only be applied to scalar values, but not to whole lists or arrays.
Examples:
1.234 ^ 5.678 = 3.29980... |
Your task is to determine if a given string is of proper length and can be represented with Scrabble tiles and, if so, output the sum of each letter's score.
If you don't know how to play Scrabble:, you have 100 tiles with various letters A–Z printed on them, as well as two wildcards that can represent any letter. Each... |
The Challenge
The challenge is that I have a standard mechanical push button lock and you need to find out every possible code that could unlock it.
With a standard mechanical push button lock you have all single digit numerals and sometimes a few letters.
With this specific push button lock there are specific rules.
R... |
Create the shortest script that organizes all the logs by month and date.
Rules
Syntax
organize <folder to scan> <folder to place logs>
folder cannot be root
the two folder should be different and not contain one another
Behaviour
The script should scan all the *.log files in <folder to scan> and copy them to <fol... |
The printable ASCII characters (hex codes 20 to 7E) in order are:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
(Note that space is in there.)
This string clearly contains all the printable ASCII characters at least once in increasing order when read from left to to ri... |
In this challenge, you will take an input image and crop it to make a square, leaving only the central part of the input image.
The answers must work with landscape, portrait, or square input images. The width of the output image should be equal to the shortest side of the input image e.g. the result of a 200x300 image... |
The recent question about Wang tiles has led me to think that creating Penrose tilings might be an interesting popularity contest.
Background
Wang tiles are tiles that can tile the plane, but only aperiodically (see Fill the Screen with Wang Tiles for a full description). Penrose tiles give the affirmative answer to a ... |
It is simple. I cannot stand when people use spaces when naming files. It sometimes wrecks console commands and makes the output of ls ugly.
The challenge is to write a program (only ascii characters) which
renames all files (including directories) in the current directory to versions with spaces removed or replaced b... |
Conway's Game of Life is (almost) always played on a regular square grid, but it doesn't need to be.
Write a program that implements the standard cell neighboring rules from Conway's Game of Life on a two-dimensional tiling of the Euclidean plane that is not a regular tiling of squares, triangles, or hexagons.
Specific... |
Your task is to write program which will draw 800x600 black-and-white image with something resembling a forest.
Like this (it is dithered photo):
Rules
You are disallowed to use any existing images - you should generate image purely algorithmically
Use only 2 colors - black and white (no grayscale)
Each time program ... |
Intro
In most fonts all of the uppercase alphabet characters besides BDO have single lines approximately touching some of the four corners of the character's bounding rectangle: ACEFGHIJKLMNPQRSTUVWXYZ.
For example, the two legs of an A "touch" the bottom left and bottom right corners of the character. Likewise, C touc... |
After @MartinBüttner achieved exactly 10,000 reputation, we now have three full rows of 10k users on the users page! Now, since we're all programmers here, we like to automate things instead of doing them manually. Your challenge is to write a program to automatically congratulate new 10k users.
Specification
Input
The... |
Task
Write a function that accepts two integers \$a,b\$ that represent the Gaussian integer \$z = a+bi\$ (complex number). The program must return true or false depending on whether \$a+bi\$ is a Gaussian prime or not.
Definition
\$a+bi\$ is a Gaussian prime if and only if it meets one of the following conditions:
\$a... |
Write a program that outputs all 64 layers of this representation of Graham's number from Wikipedia:
Your output must exactly match this ASCII version (in which ^ represents Knuth's up-arrows and combinations of slashes and underscores represent the large horizontal curly brackets):
3^^................................. |
Some numbers such as: 6, 12, 20, 30, 42, 56, 60, 90, 120 and so on as can be expressed as a product of consecutive integer numbers as shown below.
6 = 2 * 3
12 = 3 * 4
30 = 5 * 6
60 = 3 * 4 * 5
90 = 9 * 10
120 = 4 * 5 * 6
Write a program or function that outputs a list of consecutive integers which pro... |
Overview
Given a list of fireworks a-z and times 3-78, arrange them with fuses to make them all light up at the correct time.
A line of input is given as space separated letters and numbers:
a 3 b 6 c 6 d 8 e 9 f 9
That example shows that firework a need to light at time 3, b and c both at 6, d at 8, with e and f both... |
Background
Manufactoria is a game about programming. The player must use a form of two-dimensional programming language to complete tasks. If you've never heard of it, the easiest way to learn is to try out the first few levels of the game.
Challenge
Your challenge is to create a program which tests the primality of a... |
Write a program that takes in a true-color RGB image I, the maximum number of lines to draw L, and the minimum m and maximum M length of each line. Output an image O that looks as much as possible like I and is drawn using L or fewer straight lines, all of which have Euclidean length between m and M.
Each line must be ... |
Picture of me drafting this challenge with my advanced drawing skills.
Background
The Stickman wars happened long ago, when Earth's dominant species was made of nothing but sticks. Historians regret the fact that there were no painters or cameras back then, we could use some pictures of that war in today's history bo... |
Write two rectangular blocks of code, each w characters wide and h characters tall, that implement Conway's Game of Life when arranged in a grid. (w and h may be any positive integers)
For example, the two code blocks might be: (w = 3, h = 2, not actual code)
XX|
--+
and
|
--+
Treat the first block as if it is the ... |
An ant walks along the edges (not faces) of a wireframe cube. Each vertex it encounters presents it with a fork from which two new edges branch off. The ant chooses which way to turn -- left or right. These direction are relative to the ant, who is facing the vertex and is outside the cube. Your goal is to determine, f... |
Create a program that output's itself as a series of punch cards:
Rules:
You can use any programming language.
The output (i.e. punch cards) can be ASCII art.
Each line of code must be able to be punched into a single 80 column x 9 row punch card - i.e. you can only use 80 characters.
To fit in the 9 rows you need to... |
4-Man Standoff
Description
You've somehow found yourself into a four-way standoff. A loaded gun rests in your hands, and some grenades are hooked on your belt.
The objective is to have the most health at the end of a standoff. A standoff is over when at most one person has a positive amount of health.
Each player has ... |
You are given a certain number of cups (n). You are tasked with stacking these cups into a pyramid, with each row having one more cup than the row above it. The number you are given may or may not be able to be perfectly stacked. You must write a function that takes the total number of cups (n), and returns the followi... |
Imagine you are given two lists of numbers which are to be interpreted as points on a circle of circumference 1000. Let us say
circleA = [10, 24, 44, 175, 321, 579, 618, 841, 871, 979]
circleB = [270, 283, 389, 406, 435, 457, 612, 684, 692, 732]
To measure the distance between these two circles we do the following.
F... |
Invert the Format method.
The Format method of the String class (or equivallent, such as sprintf) is available in most languages. It basically takes a "Format" string which may contain placeholders with some extra formatting, and zero or more values to be inserted instead of those placeholders.
Your task is to implemen... |
Inspired by the connection rules from Calvin's Hobbies' question Make me an alphabet tree take a number of lines of letters as input and output the number of distinct connected trees it represents.
Letters connect to diagonally adjacent letters (never horizontally or vertically) and only where such a connection is avai... |
Consider a question written in plain English whose answer involves two reasonably accurate (but potentially clever) words or phrases that can be separated by the word 'and':
Q: What are the two sides of a coin? A: heads and tails
Q: What are the best ways to travel? A: airplane and jetpack
Q: Why is a raven like a wri... |
Intro
Consider the process of taking some positive integer n in some base b and replacing each digit with its representation in the base of the digit to the right.
If the digit to the right is a 0, use base b.
If the digit to the right is a 1, use unary with 0's as tally marks.
If there is no digit to the right (i.e. ... |
Header:
this question has a very close duplicate, but the other question requires a difference between versions of the languages, instead of a difference between different implementation. this means that all answers from the almost-duplicate are invlid here. this is also my first question, so please don't be harsh.
the... |
I'm work on a problem which I set myself for fun, which is to create a python script which prints the even numbers from 0 to 100. The challenge is to make the script as small as possible. This is what I have so far:
for x in range(0, 101):
if (x % 2 == 0):
print x
Currently it is 60 bytes. Can anyone think... |
Let's make an ASCII art clock and calendar that tells us the current month, day of the month, day of the week, hour, minute, and whether it's night or day (but not the year or second).
At any particular time the calendar will look something like this: (it looks better with less line spacing)
__________________________... |
There is a sequence of numbers called the "Look-and-Say Numbers".
Here is an example of the first 5 terms of the sequence, starting at 1 (with spaces added between the digits):
1
1 1
2 1
1 2 1 1
1 1 1 2 2 1
The pattern is simple, once you see it.
The sequence starts with 1. There is one 1, so the next n... |
Write function which solves equation of degree less than or equal to 2 (ax^2 + bx + c = 0).
Input
Function should get 3 parameters - floating point numbers which are coefficients of this equation. Coefficients may be zero (that means function must able to solve bx + c = 0 and c = 0 too).
Coefficients are between -1000 ... |
Introduction
Greetings fellow traders, you have just entered the Stack Exchange stock exchange. Here you will compete to earn the money by buying and selling shares (unfortunately, we only have the single market).
Gameplay
You will need to write a program that buys and sells shares. At the start, the market price is 20... |
Given a sequence of the bases Adenine, Cytosine, Guanine and Thymine (encoded as ACGT), you're to produce an ASCII art representation of a corresponding double strand of DNA.
The strand will extend vertically. The left-hand strand is the one you are given as input. The right-hand strand will be its complement. For thos... |
Given a number, find an expression in words equaling that number, with a length of that number.
Thus, to an input of 15, you might output sixteen minus one, which has fifteen characters (not counting spaces). If multiple solutions exist, print whichever you want. If none exist, print impossible
Use only the operators p... |
Objective: Print all multiples of 32 from 0 to an arbitrary number n.
Rules:
One argument will be given: a single integer from 0 to 231 - 1. This will be n here on out.
The first iteration must be 0, and the last iteration must be n. 0 is to be counted as a multiple of 32.
Each time a multiple is encountered, the mult... |
Write the shortest code to reverse the bit order of a 32-bit integer.
Rules:
Input is assumed to be a valid integer or string equivalent if your language doesn't support numerical values (e.g. Windows Batch).
Output must be a valid integer or string equivalent if your language doesn't support numerical values (e.g. Wi... |
Not restricted to any one programming language.
What I'm saying is you pass 1 to it and it returns Monday, 7 corresponds with sunday and so on.
I've managed a 146 byte statement in Java to do the same.
return (n<1?"invalid":(n<2?"monday":(n<3?"tuesday":(n<4?"wednesday":(n<5?"thursday":(n<6?"friday":(n<7?"saturday":(n<... |
Update: It seems that the original question at math.SE was solved, there should be no 23 pieces solution.
The original problem is stated here over at math.SE
The task is writing a program that fits 22 copies (or perhaps 23) of the following pentacube into a 5x5x5 cube (back and front view).
The pentacube must be place... |
Your challenge: write a "program", for a language of your choice, that causes the compiler/interpreter/runtime to produce error output when compiling/running your program which is identical to your program's source code.
Rules:
Your program may be specific to a particular version or implementation of your language's c... |
Plot: Jimmy is missing; we have to find him. We should split up.
Plot twist: Jimmy is already dead.
But, our cast doesn't know that, so they need to search the whole area anyway. There is an N columns x M rows (1<=M,N<=256) grid of cells,
either marked as "S" for the starting point, "." for open space, or "#" for an o... |
your task is...
Given a string x and a positive integer y, to determine whether there is a positive integer b and an injective mapping from the distinct characters in x to the digits of base b which permit us to interpret x as an integer equal to y.
details:
If there is more than one base which works, you don't have... |
This challenge is similar to Can you Meta Quine?
A quine is a program that produces itself on STDOUT. This challenge is to produce a program A which when run produces a program B on STDOUT. Program B when run produces program A on STDOUT. Programs A and B must be written in (and run in) the same language. The linked qu... |
Task
Write a program to determine the note sounded, along with how many cents out of tune, of a string tuned to a given frequency and pressed down at a given point.
For the sake of simplicity, assume that the frequency of the sound produced and the length of the string to the right of where it is pressed are inversely... |
Write a program that reads a \$n\times n \times n\$ array of binary values which represent an \$n\times n \times n\$ cube, that consists of \$n^3\$ smaller cubes. Each value says whether there is a voxel (small cube) present in the given position or not. The program must output the given array as an ASCII graphic (that... |
Loopy is a puzzle game from the collection of Simon Tatham. The previous link contains a javascript implementation of a Loopy puzzle generator. I suggest everybody who wants to attempt this challenge to solve a couple of puzzles manually to understand how they are supposed to work.
Here are instructions on how to solve... |
This is an additional challenge to the generate Loopy puzzles challenge. You might want to solve this challenge before attempting the harder challenge in the previous link.
The goal of this challenge is to validate the solution to a loopy puzzle. Please take all documentation on what a loopy puzzle is from the previous... |
You are paddling a canoe down a fairly fast whitewater river. Suddenly, your paddles explode, and you find yourself in a dangerous situation hurtling down a river rapid without any paddles. Luckily, you still have your programming skills, so you decide to carve a program on the side of your canoe to help you survive th... |
You are a foreign trader, hoping to make a profit. There are 5 goods people wish to trade: Apricots, Boars, Canaries, Daffodils, and Earwigs. Starting in the winter, you need to decide what to produce. Then, in the fall, you travel and spend your days trading for a profit.
Gameplay
You start the game with 10 of each... |
Scoreboard
Here are the raw scores (i.e. domino counts) for VisualMelon's submission. I'll turn these into the normalised scores described below, when more answers come in. The existing solution can now solve all circuits in the benchmark:
Author Circuit: 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
Inspired by vi.sualize.us
Goal
The input is a grayscale image and the output is a black and white image. The output image consists of just one closed curve (loop) that is not allowed to intersect with itself or touch itself. The width of the line shall be constant throughout the whole image. The challenge here is findi... |
Your challenge is to find the smoothest number over a given range. In other words, find the number whose greatest prime factor is the smallest.
A smooth number is one whose largest prime factor is small. Numbers of this type are useful for the fast Fourier transform algorithm, cryptanalysis, and other applications.
For... |
Write the shortest program possible such that when you combine the first character and every Nth character after it into a new program, the output is N. This must work for N = 1, 2, ..., 16.
Another way to say it is, if you remove all the characters from your program except for the first one and every Nth one after tha... |
After your disastrous canoe ride, you ended up falling off a waterfall at the end of the river rapids. Your canoe exploded, but you managed to survive the explosion. However, your river journey went completely off the map - you have now found yourself lost in the midst of a forest. Luckily, you still have your programm... |
Write a program in the shortest number of bytes possible that will parse any string given to it by input, and output that string with any and all numbers padded with leading zeroes to match the largest number's length.
For example:
Input:
This 104 is an -8 example of 4.518 a string 50.
The generated output should beco... |
Write two functions/programs which take an ASCII code of character (8-bit unsigned integer) and one of them converts char to uppercase and other to lowercase.
That is, they must be equivalent to following functions:
unsigned char toUpper(unsigned char c){
if (c >= 97 && c <= 122) return c - 32;
return c;
}
unsi... |
Your task is to output a representation of the legendary tree of life, Yggdrasil.
You must write a program whose output is exactly that :
/\
/**\
/****\
/******\
... |
I want you to write a program that outputs a trigonometry circle like the one below. I also want you to animate this circle, having the sine line move along the circumference with the other lines move around it. The minimum number of unique frames is 5. Any lower and your entry will not be counted.
The lines you will... |
With a window similar to the one pictured below, you are given a list of strings, which you want to put in alphabetical order.
As shown, you have five operations:
Move up [U] - moves the selected string up one place
Move down [D] - moves the selected string down one place
Move first [F] - moves the selected string t... |
You are a project manager. One day, one of your programmers went insane (not your fault) and took all the expressions in the codebase and added random brackets to them, before quitting on the spot, ranting about your incompetence (also not your fault). This would be an easy fix, however, for some reason you aren't usin... |
Write a Brainfuck interpreter that can interpret multiple Brainfuck programs embedded within the same source. The syntax is the same except that the instructions must be prefixxed with the number/ID of the targetted program. Example:
1st program
+++[->+<]
2nd program
+>++>+++.
Mashup
1+1+1+2+2>1[1-2+2+2>1>1+2+1<2+1... |
The year is 930, and the Gregorian Church is having a problem. They have thousands of pages of chant music, but the problem is that all the sheet music was simply thrown onto a pile instead of having any real organisation system:
Image by user gamerprinter at Cartographers' Guild.
The Church needs to organise all the ... |
Tallying is a simple counting system that works in base 5. There are various different tallying systems used around the world, but the one that is used in most English-speaking countries is perhaps the most simple - count units by marking vertical lines, then for each 5th mark put a horizontal line through the previous... |
I presume you've all heard of the Rosetta Stone, an ancient stone found to have essentially the same passage written on it in three different scripts. This challenge is based upon that: you have to write three versions of the same program in different languages.
The three programs must output the first n iban numbers, ... |
Background
You are all traders for a slightly less than reputable stock firm. You all are part of a group of traders who focus only on one specific stock.
Each hour each trader has a chance to Buy X stocks or Sell X stocks. There are 50 hours per round and 3 rounds per competition. At the end of all of the rounds the t... |
The MMIX architecture is a fairly simple big-endian RISC design. It has a couple of interesting features, one of them is the MXOR instruction, which is what you should implement.
The MXOR instruction interprets its arguments (two 64-bit registers) as two 8×8 matrices of bits and performs a matrix multiplication where e... |
You don't want to pay money for the expensive architectural program, so you decide to roll your own. You decide to use ASCII to design your buildings. Your program will take in a single string formatted in a specific way, and the program will output the building.
Input
Input consists of a single line of characters. It ... |
The Challenge is to write the shortest implementation to find the Longest increasing subsequence .
Example :
Let S be the sequence 1 5 7 1 8 4 3 5 [length of S = 8 ]
We have 1 sub-sequence of length 0 [will consider it increasing]
6 sub-sequences of length 1 {1,5,7,8,4,3}[all of them are considered increasing]
(7*8)/2... |
A bit of an unusual one, but hey, why not? :)
The objective: Write a functioning IRC daemon in your language of choice that provides barebones functionality, in as few characters as possible. As long as it fulfills the criteria below, it does not have to fully comply with the IRC RFCs (this would make the challenge sig... |
Objective
Given input r and n find the first n natural numbers x such that if we rotate the first digit to the last place we obtain x/r.
You may assume that 2 <= r <= 9 and 1 <= n <= 65535.
You may write a program which takes input from stdin or command-line arguments; or you may write a function which takes r and n as... |
The Task
This is quite a simple coding task, all your program has to do is place a point on a canvas (or your alternative in another coding language) and connect it to all the dots already placed. Your program must take in one input, the number of dots that should be placed, and output some sort of display with the do... |
The Symbols vs. The Letters
The ASCII characters have been divided once again! Your sets are The Letters and The Symbols.
The Letters
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
The Symbols
!"#$%&'()*+,-./0123456789:;<=>?@[\]^_`{|}~
The task is to write two programs:
Print each of The Letters exactly once w... |
All bots at the battle arena suddenly got brainfucked and no one can explain why. But who cares as long as they are still able to fight - although Brainfuck is the only language they understand anymore.
It's been a while since the last submission so I'll finally annouce the winner of BrainFuckedBotsForBattling: Congra... |
What you need to do to win this challenge is to write the shortest "timeago" script that outputs the number of decades, years, weeks, days, hours, minutes, and seconds between a given Unix timestamp and the time the script is run.
You must give the time difference in "lowest terms", e.g. 1 week not 7 days, 9 years not ... |
An epicycloid is the curve a point on a circle makes as it rolls around another circle. A cyclogon is the shape a point on a regular polygon makes as it rolls across a plane. An epicyclogon is the curve traced by a point on one regular polygon as it rolls around another.
Write a program that draws an epicyclogon given ... |
You have found the path through the forest and now plan on travelling along it. However, just before you start on your journey, the ground turns into lava.
You manage to scurry up the nearest tree (the trees have inexplicably not burnt up), but now you are faced with a problem: how can you get out of the forest when t... |
Inspired by this example of using d3js, I challenge you to create a canvas (or your language-of-choice equivalent) in which the mouse pointer trails will be displayed, with the following twist:
The Twist
You should not display the trails of where the mouse pointer was, but the "trails" of where it will (might) be in f... |
I've become alarmed with the growing hatred of spaces and this answer has inspired me to make sure Morse code is safe from this insidious removal of whitespace.
So, your task will be to create a program that can successfully translate Morse code with all of the spaces removed.
Rules:
Input will be a string consistin... |
Introduction
Hello! This is my second post, and I decided to do one which is more language specific, since my last one was very much orientated towards mathematical languages, and thus did not leave room for languages like JavaScript or HTML. If there is anyway to make this more clear, or to tidy up a wording problem... |
It's time to face the truth: We will not be here forever, but at least we can write a program that will outlive the human race even if it struggles till the end of time.
Your task is to write a program that has a expected running time greater than the remaining time till the end of the universe.
You may assume that:
T... |
The Challenge
A simple "spy versus spy" challenge.
Write a program with the following specifications:
The program may be written in any language but must not exceed 512 characters (as represented in a code block on this site).
The program must accept 5 signed 32-bit integers as inputs. It can take the form of a functi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.