instruction stringlengths 34 53.1k |
|---|
Easter Egg Hunt
Bot find egg before bunny find egg. Bot happy.
Overview
This is a king-of-the-hill challenge in honor of Easter and the Easter egg hunting tradition!
Your bot has a vision of two spaces in every direction, including diagonals, creating a 5x5 square around you that you can see. It is looking for eggs, an... |
Write a program that prints the following 80-character line:
This program from codegolf.stackexchange.com permutes itself to encode a string.
then accepts one line of input, then prints its source code with its code points possibly reordered (none added and none deleted). When that code is executed, the same has to h... |
Your mission is to write a program that prints "Hello World!". Simple?
The text must be human readable and should not be "|-| € |_ |_ 0 // 0 |? |_ |) \./" or something like that.
The program should not contain:
Newline character
Any characters in the string "Hello World!" including whitespace (whitespace outside str... |
Hi guys, for my class I need to make a number square root but it
doesnt work !!HELLPP!
The challenge:
Write a function or program that will "make a number square root".
Note: This is code trolling. Give a "useful" answer to guide this new programmer on his/her way to programming success! Be creative!
|
An Almost Equilateral Heronian Triangle is a triangle with integer lengths of the form n-1, n, and n+1 and also has integer area. The first few are:
3, 4, 5 -> 6
13, 14, 15 -> 84
51, 52, 53 -> 1170
Quest: Generate the shortest program that outputs the nth such triple. (Hint: this is a known sequence).
Winner w... |
Overview:
Your job is to take CSV input in key=value format and line it up in a more organized (see below) way.
Input:
Always via stdin. Records will always be in the following form key=value:
foo=bar,baz=quux
abc=123,foo=fubar
baz=qwe,abc=rty,zxc=uiop,foo=asdf
There will be no list of possible keys in advance, you m... |
When I was a lad, kids would wander into computer stores and play Hunt the Wumpus until the staff kicked us out. It was a simple game, programmable on the home computers of the mid-1970s, machines so rudimentary that instead of chicklet-sized microprocessors, I think some of them probably had real chicklets in there.
L... |
Setting
The Fry King is a small criminal mastermind from the western european nation of Belgium, more specifically Flanders. He has acquired every single fastfood restaurant in a large part of Belgium and set them out on a 101X49 grid (102 intersections horizontally, 50 vertically, including the borders), 5100 restaura... |
As the title says, I was thinking to contest in which one must detect edges of an ASCII art.
The code should accept a B/W ASCII art as input.
A B/W ASCII art is defined as (by me) an ASCII art with only one kind of non-white-spaces character (in our case: an asteriks *). And as output produce a standard ASCII art (all... |
A minifloat is a binary representation of a floating-point number that has very few bits.
The minifloat in this question will be defined as an 6-bit number m, which has the following representation:
1 bit to repesent the sign of the number. This bit will be 0 if the number is positive, and 1 if the number is negative.... |
Flavour text
The stack-based esolang Underload has some interesting ties to functional programming. One of them is its treatment of the numerical datatype—like the lambda calculus, you represent the natural number N by a function which perform an action N times.
To make things simple, we will only consider only the fol... |
This is the audio version of the Twitter image encoding challenge.
Design an audio compression format that can represent at least one minute of music in 140 bytes or less of printable UTF-8-encoded text.
Implement it by writing a command-line program that takes the following 3 arguments (after the name of the program i... |
In the game of Flood Paint, the goal of the game is to get the entire board to be the same colour in as few turns as possible.
The game starts with a board that looks something like this:
3 3 5 4 1 3 4 1 5
5 1 3 4 1 1 5 2 1
6 5 2 3 4 3 3 4 3
4 4 4 5 5 5 4 1 4
6 2 5 3[3]1 1 6 6
5 5 1 2 5 2 6 6 3
6 1 1 5 3 6 2 3 6
1 2 2 ... |
Several months ago I had this question as a pre-screening puzzle for an interview. Recently when thinking about blog material, it popped in my head as a good example to use for solving a problem functionally. I'll post my solution to this as soon as I'm done writing my blog post.
NOTE: This question was asked on Stac... |
In this question, a mapping is defined between EBCDIC and a superset of ISO-8859-1.
Your task is to build a network of two-input NAND gates that will take eight inputs A1, A2, A4, ..., A128 representing an EBCDIC character and return eight outputs B1, B2, B4, ..., B128 that represent the corresponding "ISO-8859-1" char... |
This Code Golf was inspired by the recent Daily WTF article You Can't Handle the True!, which features a string comparison written as:
String yes = "YES";
if ((delay.hashCode()) == yes.hashCode())
Imagine the trouble it would have caused for Steve's team if Java's String.hashCode method just happened to be implemented... |
Task:
Your program is given a proper, positive simple fraction in the format <numerator>/<denominator>.
For this input, it must find two fractions.
A fraction that is less than the input.
A fraction that is greater than the input.
Both fractions must have a lower denominator than the input. Of all possible fractions,... |
In informatics, we often use trees in lots of different forms and representations. The three major methods of serialising binary trees are prefix, infix and postfix notation. For example, the following binary tree:
(source: Dutch Olympiad in Informatics, finals, 2012/13)
can be represented in prefix notation as abrx... |
Notice
This challenge has ended and will not be re-judged, but feel free to post answers and test your program against the others with the Control Program!
The aim of this challenge is to make an AI to win a fight against another AI by strategically drawing a wall on a 25x25 grid to block the opponent.
Input
25 lines... |
As any amateur photographer can tell you, extreme post-processing is always good. One such technique is called "miniature-faking".
The object is to make an image look like a photograph of a miniaturized, toy version of itself. This works best for photographs taken from a moderate/high angle to the ground, with a low v... |
I have this code which I have written in Python/NumPy
from __future__ import division
import numpy as np
import itertools
n = 6
iters = 1000
firstzero = 0
bothzero = 0
""" The next line iterates over arrays of length n+1 which contain only -1s and 1s """
for S in itertools.product([-1, 1], repeat=n+1):
"""For i fr... |
This is a follow up to How slow is Python really? (Or how fast is your language?).
It turns out it was a bit too easy to get a x100 speedup for my last question. For those who have enjoyed the challenge but want something harder where they can really use their low level skills, here is part II. The challenge is to get... |
You are developing some code to generate ID numbers. Policy requires that no ID numbers include the digit sequence 666.
Create a function (or your language's equivalent) which takes a positive integer parameter and returns the next integer that does not include 666 when that integer is expressed in decimal. (60606 is f... |
You know those wooden toys with little ball bearings where the object is to move around the maze? This is kinda like that. Given a maze and a series of moves, determine where the ball ends up.
The board is held vertically, and the ball moves only by gravity when the board is rotated. Each "move" is a rotation (in radia... |
Entries for this challenge will display an animated rotating Lissajous figure. The appearance of 3d rotation occurs as the x parameter is successively phase-shifted in each frame.
Input:
The a and b parameters (as per the wikipedia article) will be specified at the command line, or read from stdin.
Output:
This is asc... |
Now that everyone has developed their (often amazing) low level coding expertise for How slow is Python really? (Or how fast is your language?) and How Slow Is Python Really (Part II)? it is time for a challenge which will also stretch your ability to improve an algorithm.
The following code computes a list of length... |
Given a string representing the current state of a game of Monopoly at the beginning of a player's turn, compress all the necessary data into the smallest output. Answers will be judged by output size and source size.
Note: There are many regional variations, but all references in this post to property names, etc, are ... |
In this question, a game was devised in which players would face each other off pair by pair in the Prisoner's Dilemma, to determine which iterative strategy scored the highest against others.
In this question, I devised a way for multiple people to play the Prisoners' Dilemma against each other all at the same time. I... |
This challenge is based on some new findings related to the Collatz conjecture and designed somewhat in the spirit of a collaborative polymath project. Solving the full conjecture is regarded as extremely difficult or maybe impossible by math/number theory experts, but this simpler task is quite doable and there is man... |
Permutations of a set have a natural order called lexicographic order in which two permutations are compared by comparing the first position at which they differ. For the purposes of this question we're working with base 64 and the order of the digits is
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/... |
Background
In Bejeweled and similar games, the player must swap any two adjacent gems (no diagonals) in an 8x8 grid of gems in order to match three of the same color in a row. The gems can be matched horizontally or vertically. Gameplay continues until there no move exists that can be made resulting in three in a row, ... |
In Chinese Checkers, a piece can move by hopping over any other piece, or by making a sequence of such hops. Your task is to find the longest possible sequence of hops.
Input
A sequence of 121 zeroes or ones, each representing a place on a board. A zero means the place is empty; a one means the place is occupied. Posit... |
Everyone knows that C is a lovely, safe, high level programming language. However you, as a coder are set the following task.
Write a program to add two numbers.
Input: Two space separated integers.
Output: The sum of the two numbers in the input.
The twist is that your code must be 100% safe. In other words, it m... |
Your goal is to write an obfuscated program that displays the current time.
Guidelines: The program can print local or global time. You are allowed to draw ASCII numbers, display an analog clock, etc. No input should be needed. Whether you include 12 or 24 hour, including AM/PM, milliseconds and seconds or not, it all ... |
TASK
The goal is to write a program that rotates any two-dimensional list by 45 degrees, it must be able to do this up to 7*45 (at once) before returning the list. The list will not necessarily be square or rectangular. You must include output for the examples in your answer. It must also work for cases that are not in... |
I am trying to golf down some C++. Is it possible to make this condition shorter?
X > 3 & X - Y > 1
(Apart from removing whitespace, of course.)
So, X is at least 4 but X >= Y + 2.
X and Y are integers in the [0,5] interval.
I have tried to find some bitwise formula but failed.
|
Dither a grayscale image into pure black and white with your own algorithm.
Guidelines: You must come up with your own new algorithm. You cannot use pre-existing algorithms (ex. Floyd-Steinburg) but you can use the general technique. Your program must be able to read an image and produce an image the same size. This is... |
Please note: By its nature, the spec for this challenge is difficult to understand. It probably requires at least a freshman course in computability theory, or equivalent background reading. In addition, the challenge itself is rather hard. Answering it will require writing an entire interpreter for some subset of your... |
Let N be the set of nonnegative integers, i.e. {0, 1, 2, 3, ...}.
Let c0(N) be the set of all infinite sequences in N that converge to 0, i.e. { (xn) ∈ NN | xn → 0 as n → ∞}.
c0(N) can be equivalently written as the set of all finite sequences of natural numbers, such that there are no trailing zeroes. The infinite seq... |
Task
You must write a program or function in the language of your choice which accurately counts the number of terminal cycles of a simple directed graph.
This particular kind of directed graph is represented as an array of n integers, each with an independently-chosen random value between 1 and n (or 0 and n-1, if you... |
In honor of Star Wars day, write a program to display the following text, scrolling like the Star Wars opening crawl:
It is a period of civil war. Rebel
spaceships, striking from a hidden
base, have won their first victory
against the evil Galactic Empire.
During the battle, Rebel spies managed
to ... |
Your mission is to write a function/program that converts an array of bytes (i.e: an array of integers from 0 to 255), to base64.
Using built-in base64 encoders is not allowed.
The required base64 implementation is RFC 2045. (using "+", "/", and mandatory padding with "=")
Shortest code (in bytes) wins!
Example:
Input ... |
Your objective is to take input like
Pie is good. I just ate a bunch of pies early this morning. Actually, it was closer to the afternoon. Mornings are good.
and create an array of the indexes of the string where the letters that make up the word "Llama" appear (one of each in order). For example, let me show the ... |
Create a function in your chosen language that prints out the following:
Old MacDonald had a farm, E-I-E-I-O,
And on that farm he had a cow, E-I-E-I-O,
With a moo moo here and a moo moo there,
Here a moo, there a moo, everywhere a moo moo,
Old MacDonald had a farm, E-I-E-I-O!
Where cow and moo are strings in the funct... |
The challenge is to filter a large file quickly.
Input: Each line has three space separated positive integers.
Output: All input lines A B, Tthat satisfy either of the following criterion.
There exists another input line C, D, U where D = A and 0 <= T - U < 100.
There exists another input line C, D, U where B = C ... |
Task:
There are a lot of answers on this site that are arranged into ascii art, like this one. Usually the arrangement is done manually, but wouldn't a program help with that? :)
Your program will take 3 inputs:
The code, as one single line
The number of lines in the pattern (can be omitted if not necessary)
The pat... |
Your objective is to take multiline ASCII like
| v |
* * * *
* * *
and have an array that includes everything that isn't a star changed to a star (except for [any-width] spaces) and the number of stars it included and the number of stars it now includes. So the output of my example would be:
['* * *
* * * *
* *... |
With the recent Python bashing, here's an attempt to show Python's strengths.
Your challenge is to write a program that calculates the factorial of as high a number n as possible within 10 seconds.
Your score will be (highest n for your program on your machine)/(highest n for my program on your machine)
Rules
You must... |
The goal is to output or display an image with an € (euro) sign according to the following specs (ignoring the border of the sign).
Source: http://en.wikipedia.org/wiki/File:Euro_Construction.svg
Rules:
The program / script must take the height of the € sign in pixels as an argument (empty space around the sign is op... |
Title says it all. Two input 32-bit positive integers m, n >= 2, output gcd(m,n) in prime factorization form.
Input
Command line args or 1 line of stdin okay, whatever's better for golf.
Output
Single space delimited with exponents (no additional spaces). Output nothing if the inputs are relatively prime.
Examples:
$ .... |
Your goal is simple: the program must turn the screen of your computer totally black.
After the program is started, the screen must quickly turn completely black, and remain so until the program is exited (any key, or alt+F4, mouse movement, etc.), after which things should turn back to normal. So shutting down the co... |
What general tips do you have for golfing in LiveScript? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to LiveScript (e.g. "remove comments" is not an answer). Please post one tip per answer.
|
The goal is simple: calculate the totient function for as many numbers as you can in 10 seconds and sum the numbers.
You must print your result at the end and you must actually calculate it. No automated totient function is allowed, but bignum libraries are. You have to start at 1 and count up all the integers consecu... |
This challenge is inspired by a problem I encountered recently out in the real-world, though ultimately I cheated and found a workaround.
Challenge
The input is a space-separated table of characters (each line is a row, and every line will have the same number of columns). Your challenge is to group together co-occurri... |
Overview
This challenge was inspired by this StackOverflow Meta post. In it, @hakre says:
I've seen a project really written by Stackoverflow (a noob copies together from SO here and SO there), attribution normally never is done which results in rights termination under CC. (sic)
Your mission is to make the most int... |
As programmers, we all know the saying: "You can have it fast and good, but it won't be cheap, you can have it cheap and good, but it won't be fast, or you can have it fast and cheap, but it won't be good."
For this challenge, you are implementing an imaginary configuration tool for your custom programming services. Yo... |
Does anyone have any code-golf tips for golfing in Processing? It is a graphical extension of java, and is somewhat difficult to golf.
|
How about giving the good ol' arcade game Frogger a revival, Code Golf-style!
Your task is to create a version of this classic game, with as few characters of code as possible. Use the language of your choice (libraries, like jQuery etc., are allowed).
Requirements
You have 3 lives, and lose 1 life from:
moving outsi... |
In Python, one can save bytes by aliasing functions that are used repeatedly. For example:
r=range
a=r(100)
b=r(200)
c=r(300)
However, when the functions are member functions together, I don't know how to alias them in a way that allows chaining. For example:
s='Hello'
// Plain code
s=s.replace('H','J').replace('e','... |
Einstein wrote a riddle. He said that 98% of the world could not solve it.
I solved this riddle in about 25 minutes while on the train to work.
It's basically just deduction.
The riddle
There are 5 houses in 5 different colors in a row.
In each house lives a person with a different nationality.
The 5 owners drink a ce... |
This challenge is simple. Write code that shows what looks exactly like a complete reboot of the computer. It must not show anything on-screen that shows it is not a full reboot and should end at the log-in screen you would get after rebooting.
Rules
You can choose any OS you like to imitate. For example you can rebo... |
The goal of this challenge is to write a program able to guess a word in the smallest possible number of attempts.
It is based on the concept of the Lingo TV show (http://en.wikipedia.org/wiki/Lingo_(U.S._game_show)).
Rules
Given a word length passed as the first argument on its command line, the player program dispose... |
Based on the Duct tape can fix anything question, that was too broad, with very similar rules. Only this time the objective is very specific:
The challenge
Your mission is to make a program that displays hello mom -- without ever writing a single line of code.
You can only use code which is already written for you, bot... |
Inspired by Cheap, Fast, Good, we're going to implement an algorithm which has exactly two of them.
The Math
Given two nonzero integers a and b, the GCF d is the largest integer that divides both a and b without remainder. Bézout coefficients are pairs of integers (x, y) such that ax + by = d. Bézout coefficients are n... |
Here's the challenge:
Order an Array from the Lowest to the Highest digit from a number, which is conveniently represented in an array. The trick here is that you cannot use any array methods, nor other sorts of loopholes. You have to stick to the basics (Arrays, Mathematical Operators /not Math Class/, no recursion. Y... |
This is the goal: count from 0 all the way to the current epoch time while the epoch time is still advancing in the fastest time possible. An example of how you'd do it could be as what is shown here in Python 2.7:
from time import time
start, end, count = None, None, 0
while count <= time():
if start == None: star... |
Your job is to make a sorting algorithm. The catch, you must copy it from Stack Overflow.
Your program will take an input array (or equivalency), and output a sorted permutation of the array.
Your program must consist solely of copy and pasted code blocks from Stack Overflow.
You may not take parts of a code block, n... |
The Task
You are given a mutable string that matches [a-z]+( [a-z]+)*.
You must mutate it into the string which contains the same words, but in reverse order, so that "hello there everyone" becomes "everyone there hello".
You are not permitted to use more than a constant amount of additional memory (so no copying the ... |
Task:
Your task is to create a program that, when given a number of strands and number of iterations of a braid, will tell where each strand goes. Rules are as follows:
The number of strands will always be odd, and between 3 and 6000 (inclusive)
When you start, the strands will be divided into 2 (almost) equal bunches... |
Implement the Pigeonhole sort. This is a variant of the Bucket sort, and its logic is very simple: index your items (by a given function) and then return all non-empty indexes' items.
Your program/function should get an array of items in the most comfortable way for your language of choice, (i.e. a parameter, stdin, et... |
The Task
Write a function L() that takes two Tuple arguments of coordinates in the form (x, y), and returns their respective linear function in the form (a, c), where a is the co-efficent of the x term and c is the y-intercept.
You can assume that the input will not be a line perpendicular the the x axis, and that the ... |
Turns out there are some distant aliens who know English (and have coincidentally standardized on 8-bit computer architectures). Yet they have never heard of ASCII, nor even alphabetical order.
It is believed that these aliens are picking up information from Earth. Yet they are doing so with digital equipment that re... |
Given a list of points, find the shortest path that visits all points and returns to the starting point.
The Travelling Salesman Problem is well-known in the computer science field, as are many ways to calculate/approximate it. It's been solved for very large groups of points, but some of the largest take many CPU-ye... |
Your job is to simulate a mathematically perfect game of 2048. The idea is to find the theoretical upper limit of how far a 2048 game can go, and find how to get there.
To get an idea of what this looks like, play with this 2x2 clone and try to score 68 points. If you do, you will end up with a 2, 4, 8, and 16 tile. It... |
Introduction:
The sine of \$x\$ is given by the formula:
$$\sin(x) = x - \frac {x^3}{3!} + \frac {x^5}{5!} - \frac {x^7}{7!} + \frac {x^9}{9!} - \frac {x^{11}}{11!} + \cdots$$
The cosine of \$x\$ is given by the formula:
$$\cos(x) = 1 - \frac {x^2}{2!} + \frac {x^4}{4!} - \frac {x^6}{6!} + \frac {x^8}{8!} - \frac {x^{1... |
Pathological Sorting
Your boss has demanded that you develop a sorting algorithm to improve the performance of your company's application. However, having written the application, you know that you're unlikely to be able to make it significantly faster. Not wanting to disappoint your boss, you've decided to develop a n... |
Flux is very similar to the Fifteen Puzzle.
However, instead of numbers, the squares are colors.
There are 4 colors: Red, Yellow, Blue, and Gray.
There are exactly 4 red squares, 4 yellow squares, 2 blue squares, 1 gray square, and 1 empty square.
The grid has 3 rows and 4 columns
A grid configuration is solved whe... |
The challenge is a follow-up to Filter a large file quickly which had two submissions where were as fast as wc! This time the difficulty is that RAM is severely restricted which means that new methods will have to be used.
Input: Each line has three space separated positive integers.
Output: All input lines A B, Tt... |
Your task is to play the roles of both characters in this scene from Inception. In it, Cobb gives Ariadne a challenge:
You have two minutes to design a maze that takes one minute to solve.
Some liberties will be taken on that description. Most importantly, this challenge is not time-based, rather scores are based on ... |
On some old Nokia phones, there was a variation of the fifteen puzzle called Rotation. In this variation, instead of sliding one tile at a time, you rotated four tiles at a time in one direction.
In this game, you'd start out with a board like this:
4 9 2
3 5 7
8 1 6
And by rotating the lower-left block twice clockwis... |
You need to implement immutable dictionaries using only functions without any other data types (custom or built-in).
The dictionary must be indexed by any data type of class Eq and contain values of arbitrary type, but all the values in a dictionary should be of the same type.
Here are some examples of usage:
dict `acc... |
Write a program that counts and prints the number of characters in it's own source code to standard output.
The number must be generated from counting the characters.
This Ruby solution would not be allowed:
puts 6
because it is not calculated. Spaces, tabs, new lines, etc should be counted.
The program must be small... |
Input: An RGBA hex color c (ex. FFFF00FF) and an integer > 0 and < 1000 n (ex. 200).
Output: Raw bytes of a PNG file such that when the output is saved to a file and opened in an image viewer, an n by n image filled with the color c is displayed.
Specification: Your program should output exactly:
a PNG header (89504E4... |
Your task is to generate a null-pointer exception. That is, your program must accept a value which it expects to be non-null, and throw an exception/error or crash because the value is null.
Furthermore, it can't be obvious from reading the code that the value is null. Your goal is to make it seem clear to the reader t... |
In the highly underrated Steampunk novel The Difference Engine, the equivalent of cinema houses delivered a pixelated moving image displayed by tiles which could be flipped mechanically. The control engine for orchestrating the movement of the these tiles was a large noisy machine controlled by a deck of punched cards.... |
The problem is to create a string of the same character repeated 100 times.
One potential solution in JavaScript is:
var i = 100,
s = '';
while(i--) s += "Z";
Shortest code wins.
|
Your mission is not so simple. You have to write a program that decodes QR-codes.
There are some things that are not permitted:
Making web requests (except https://i.stack.imgur.com/sCUJT.png or https://i.stack.imgur.com/mXUcd.jpg)
Using any QR code processing library (Or using any external library to do this)
Image ... |
The Task:
Given a .txt file with frames of ASCII art each separated by a \n (see this example if you are unclear) output a motion picture with frame with 1 frame per second.
Note that there is a trailing \n on the final frame.
Each frames dimensions will be:
X<80
Y<20
The Rules
The Previous frame must be cleared bef... |
Write a program that connects to this site, downloads the very answer in which it is posted, extracts its own source code and prints it out. The output must be identical to the source code. Shortest code (in bytes) wins.
Rules:
No URL shorteners allowed.
The answer must have a regular format - a heading with the langu... |
This is a micro-optimization challenge. The task is to sample from the maximally skewed stable distribution F(x;1,-1,Pi/2,0). See Table 1 of http://arxiv.org/pdf/0908.3961v2.pdf . It is easiest to describe how to do this using the following C code which uses the Mersenne Twister RNG C code from here .
#include <stdi... |
Lagrange's four square theorem tells us any natural number can be represented as the sum of four square numbers. Your task is to write a program that does this.
Input: A natural number (below 1 billion)
Output: Four numbers whose squares sum to that number (order doesn't matter)
Note: You don't have to do a brute force... |
From now on considering the word "fuck" to be non-profane would be a good idea
Make the smallest compiler or an interpreter for the Brainfuck variant, Boolfuck. It has to be executable in Windows, DOS, or a Unix operating system (so Linux, Mac, OpenBSD etc). Boolfuck is very similar to Brainfuck, and a complete definit... |
If you've ever tried to write palindromic code before, you'd know how much brackets tend to get in your way. ()() is not a palindrome, even though it kinda looks like it should be, while ())( and ()( are both palindromic and both very dumb looking. Wouldn't it be convenient if it was the other way around?
A string is c... |
Your task is to read an image containing a handwritten digit, recognize and print out the digit.
Input: A 28*28 grayscale image, given as a sequence of 784 plain-text numbers from 0 to 255, separated by space. 0 means white and 255 means black.
Output: The recognized digit.
Scoring: I will test your program with 1000 o... |
This was fun! However with only three digits, the fun was over way too soon. This challenge is similar, but we'll keep the fun going.
The Challenge
Print as many digits of the Golden Ratio φ as possible. The Golden Ratio is defined as the number that satisfies φ = (φ + 1)/φ and the first 100 digits are given by:
1.618... |
Appended Numbers Game
Write a function/program that takes 2 integer parameters integer parameters or integer variables, a start number, and a max iterations count. The code should perform the following game example to construct a new number, and repeat until the number is a single digit left. eg.
3 7 2 = (3 + 7) & (7 +... |
For this challenge, you must implement Ruby's Abbrev module in as little code as possible.
Challenge
The input will be whatever your language has as an array (array, list, sequence, etc.) of strings. You may write a function, or you may accept comma-separated words on STDIN.
You must then calculate the set of unambigu... |
As stated, write a program that is capable to, in an automated manner, write more code and another program and execute that program from itself.
In short, you are asked to write a program that can write another self-standing program itself and enable it to execute in any function.
Do this in the shortest amount of cod... |
In this problem on Puzzling.SE, I ask a question about determining the amounts of drug to use in a clinical test to minimize total drug usage and fulfill the requirements of the testing procedure.
The problem is as follows, for those of you who currently don't have access to the private beta:
A medical researcher is t... |
Introduction
The arena is a flatland dotted with skyscrapers, which your enemies use for cover. You and your enemies shoot each other with lasers. All of you carry jet packs, allowing flight.
Which enemies can you hit with your laser, and which are hiding?
Problem
First, the size of an arena is given by an integer n on... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.