instruction stringlengths 34 53.1k |
|---|
In the fewest bytes, generate the dictionary of keypresses for any letter (as described in https://code.google.com/codejam/contest/351101/dashboard#s=p2)
In Python, the dictionary literal itself:
{'a':2,'c':222,'b':22,'e':33,'d':3,'g':4,'f':333,'i':444,'h':44,'k':55,'j':5,'m':6,'l':555,'o':666,'n':66,'q':77,'p':7,'s':7... |
Speed Clue
Cluedo/Clue is a classic board game with a compelling deduction gameplay
component. Speed Clue is a 3-6 player variant that emphasizes this component by
using only the cards. The result is that the only difference between standard
Cluedo and Speed Clue is that each player still in the game may make any
sug... |
From Wikipedia:
PESEL is the
national identification number used in Poland since 1979. It always
has 11 digits, identifies just one person and cannot be changed to
another one.
It has the form of YYMMDDZZZXQ, where YYMMDD is the date of birth
(with century encoded in month field), ZZZ is the personal
identi... |
You are to create a program, that, given another program, and a position, will make it a quine. Namely, it needs to insert an expression at that point that evaluates to a string that is the programs input. For example:
main=do
putStrLn "Welcome to the open source program, would you like my source code?"
(ans:_)... |
Given is a board of variable size with a maximum size of 5 times 5 fields. Every field kann be filled with an 'x'. If it is not filled with an 'x', it is filled with an 'o'.
The starting state of every board is given (see below). With each board, 10 rounds have to be played (at max, conditions: see below) and the evolu... |
Your task is to find the total destination of objects that are falling to a planet, you will get inputs like this:
7
...#...
.......
#..O..#
.......
...#...
.......
.......
where O is the planet and # are the objects, note that the planet will attract objects from the for basic directions(NEWS). You should ou... |
Hunger Gaming - Eat or Die
If you don't eat, you die. If you eat, you live (until you die). You will die, so try to die last.
Overview
There is an island populated with a herd of prey animals. You control a pack of five predators. Your object is to keep your pack alive. Do this by eating prey. The prey tend to run from... |
The largest forum on the web, called postcount++ decided to make a new forum game. In this game, the goal is to post the word, but the word has to have one letter added, removed, or changed. Your boss wanted you to write a program which gets the word, and the UNIX dictionary, as you work for company who has more intell... |
The goal is to take CSS rules from a regular CSS file and apply them to their respective targets in an HTML file, but by placing the rules in the style="" attribute (using the <style> tag would be too simple) and removing the class="" and id="" attributes.
Rules:
Only ids #id and classes .class selectors must be suppo... |
The parentheses on my keyboard are all worn out, and I want to avoid using them as much as possible. Your challenge is to balance a line containing parentheses by adding them in before and after each line.
This is similar to TI-Basic's automatic parentheses and string closure (i.e. Output(1, 1, "Hello, World!). It also... |
The goal of this code golf is to draw a regular polygon (one with equal side lengths) given the number of sides and radius (distance from center to vertex).
The number of sides and the radius can be entered via a file, STDIN, or just a plain old variable. Use whatever is shorter in your language.
-25% of total charac... |
I challenge you to generate the following sequence till 100 terms through any programming language in shortest characters possible.
The sequence is like this :-
1 2 3 4 5 10 20 30 40 50 100 200 300 400 500 ........
The output needs to be like this (above) only, nothing extra.
Remember, You can use + and - only and... |
Inspired by this question on SO, your task is to produce a program that is valid in (at least) two major versions of your chosen language that produce different output.
Rules
Any language that has more than one major version can be used.
For the purposes of this challenge, I would suggest a "major version" is where ... |
I know there is an (old) thread similar to this (here), but I'd like to reboot it with some modifications.
The goal: generate a random-looking maze using an algorithm of your choice, then output the maze graphically (printing counts).
The width and height are determined by you.
There should be at least one path from a... |
Task:
Remove all duplicates from one list of integers. A list is simply a sequence of connected values that allows the same values to be stored at different positions in this sequence.
If an item was found to be the same value as another item in this list, keep the first occurence of the item and remove the second (thi... |
The challenge is to, given a list of points, sort in a way that, when they are connected in this order, they never intersect.
Input format (read from stdin):
X Y
1 2
3 4
5 6
...
Output should be the same as input, but sorted.
Rules:
You can start from any point.
The last point must be same as first one, making a clos... |
You are given a directed graph in an adjacency dictionary format. This can be whatever format is most natural for your language. For instance, in python, this would be a dictionary with keys of nodes and values which are lists of nodes which that node has an edge to. For instance:
G={1: [2, 3], 2: [3], 3: [1], 4:[2]}
... |
As I'm sure many of you know, synonyms can range from very similar to not-so-similar-but-I-can-see-how-it's-similar. It's common for dictionaries to use "See also" to denote occurrences of words that have especially good synonyms. Thesauruses (Thesauri?), on the other hand, list every word that is remotely close in def... |
Input:
1
X
X
X
X XX XXXXXX X X X
X XX XXXXXX X X X
XXX X XX XXXXXX X X X
XXX X XX XXXXXX X X X
Output:
X. ... |
Given a string where the first line contains spaces and one period (., the "ball"), followed by lines containing spaces, forward slashes (/), and backslashes (\), determine what column the ball will land in after falling from its starting position. Each / moves it to the left by 1 column and each \ moves it to the righ... |
Example given an image which width and height is a power of two .
First step : Divide each image into Cartesian coordinate quadrants
_____ _____
| | |
| 2 | 1 |
|_____|_____|
| | |
| 4 | 3 |
|_____|_____|
Second step : Divide each quadrant to another four quadrants and add new quadrant id a... |
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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.