instruction stringlengths 34 53.1k |
|---|
EDIT: As some of you suspected, there was a bug in the official interpreter: the order of composition in . was reversed. I had two versions of the interpreter, and used the wrong one here. The examples were also written for this incorrect version. I have fixed the interpreter in the repository, and the examples below. ... |
I have a lot of java projects and I am often making new ones. I have a few helper classes (Vector, Logger, etc.) and it takes a lot of time correcting the first line to the correct package, I would really need a little program to help me fix it automatically.
Your program will first take the name of the package the fi... |
Write a program, that determines whether the multiplication table of the given finite magma represents a group.
A magma is a set with a binary operation that is closed, that means
for all \$a,b\$ in \$G\$, \$a*b\$ is again in \$G\$ (Closedness)
Let \$(G, * )\$ be a magma. \$(G, * )\$ is a group if
for all \$a,b,c\$ ... |
Definitions:
I define a "true antiquine" as follows:
A true antiquine is a non-empty computer program of length n which takes no input and produces a copy of every valid program of length n in the same language, except the original program.
I define a "modified antiquine" as follows:
A modified antiquine is a non-em... |
Successful code golf submissions are, by nature, filled with crazy symbols all over the place. To make their submission easier to understand, many code-golfers choose to include an explanation of their code. In their explanation, the line of code is turned into a vertically exploded diagram.
For example, if this we... |
This is a game of capture the flag, heavily inspired and based off of Red vs. Blue - Pixel Team Battlebots. That was an awesome question (thank you very much Calvin'sHobbies; I hope you don't mind that I shamelessly stole a lot of code from you) -- here's another team based king-of-the-hill. Hopefully, capture the flag... |
Write code to determine who wins a four-card trick in a game of Spades. Fewest bytes wins.
The input is a string that lists the four cards played in sequence like TH QC JH 2H (Ten of Hearts, Queen of Clubs, Jack of Hearts, Two of Hearts). A card is given by two characters: a suit from CDHS and a value from 23456789TJQK... |
Consider a non-empty string of correctly balanced parentheses:
(()(()())()((())))(())
We can imagine that each pair of parentheses represents a ring in a collapsed telescopic construction. So let's extend the telescope:
( )( )
()( )()( ) ()
()() ( )
()
Another way to look ... |
When students are first taught about the proof technique of mathematical induction, a common example is the problem of tiling a 2N×2N grid with L-shaped trominoes, leaving one predetermined grid space empty. (N is some nonnegative integer.)
I will leave it to you to go over the proof if you do not already know it. Ther... |
Overview
Pearls (or Masyu) is a logic game played on a grid. There are black and white pearls placed on the grid. The object is to form a single, closed loop that travels through each pearl using only straight line segments and right angles.
There are some rules that govern how the loop interacts with pearls:
White pe... |
The background
My son Leonhard (4 years old) loves labyrinths. I don't know where he knows labyrinths from, but he paints them and knows quite well how they work:
Recently, he started making a game from his paintings. These are his rules:
a black square denotes the starting point.
a hook denotes the exit of the labyr... |
Introduction
The Hausdorff distance measures the difference between two subsets of a metric space.
Intuitively, a metric space is just some set with a built-in distance function; in this challenge, we will use natural numbers with the ordinary distance d(a, b) := abs(a - b).
The Hausdorff distance between two non-empty... |
You should write a program or function which takes a non-negative integer k and a sorted integer list Las input and outputs or returns a smoothed list M.
M is created from the ascending list L by inserting at most k integer elements while keeping the list sorted. The inserted integers should be chosen in a way that the... |
Iterated Function Systems
An Iterated Function System (IFS) is a method of constructing self-similar fractals. Each fractal is defined recursively as the union of several copies of itself, with each copy obtained by applying a transformation function to the whole. The functions are usually affine transformations of the... |
In this challenge, you will be given a list of points. These points lie on the perimeter of an imaginary square. Your goal is to:
If possible, print out the rotation of the square, which will be a value from [0, 90) where 0 represents a square with lines vertical and horizontal. The rotation is to be given in degre... |
I'm starting with golf code. But im only do C# so I know wont be a breaking record, but I want give it a try. Leibniz
Challenge is here
The first line contains the number of test cases (N) which is less than 100. Each additional line is a test case for a positive integer value (T) less than 10^7.
I format the code to e... |
My challenges tend to be a little bit hard and unattractive. So here something easy and fun.
Alcuin's sequence
Alcuin's sequence A(n) is defined by counting triangles. A(n) is the number of triangles with integer sides and perimeter n. This sequence is called after Alcuin of York.
The first few elements of this seque... |
It is the year 87,539,319 and solitary space-walking is now commonplace, many people travel into space by themselves, propelled by nothing but a jetpack on their backs, programming their course with a personal computer and keyboard as they go.
You are one such person; you were out on a lovely, peaceful spacewalk, when,... |
Write a GOLF assembly program that reads an integer from stdin (followed by a trailing newline), and outputs its prime factors seperated by newlines, followed by a trailing newline on stdout.
The prime factors need not be in a particular order. 1 is not a prime factor.
Your GOLF binary (after assembling) must fit in 81... |
Background
The birthday paradox is a popular problem in probability theory which defies (most people's) mathematical intuition. The problem statement is:
Given N people, what is the probability that at least two of them have the same birthday (disregarding the year).
The problem is usually simplified by ignoring leap... |
Joe is your average BF developer. He is about to check in his code changes to their repository when he gets a call from his boss. "Joe! The new client's machine is broken! The brainfuck interpreter sets all the cells to random values before program execution. No time to fix it, your code will have to deal with it." Joe... |
I recently got a new Sudoku app that produces really hard Sudoku's, which can't be solved using the standard strategies. So I had to learn a few new ones. One of these strategies is the Y-Wing Strategy. It is ranked under "Tough Strategies", but it is actually not that hard.
Example
For this strategy only 4 cells are ... |
Write a program or function (or set of programs/functions) to encrypt and decrypt data given the following specification:
Encryption
Calculate an XOR hash of the input by XOR-ing every byte with each-other.
XOR every byte of the input by this hash.
Shift the result four bits left.
Pad the left side with the first four... |
You should write a program or function which receives a list of distinct integers as input and outputs or returns the number of occurrences of the input numbers in the following upside-down number pyramid.
Starting from the original list in every step we create a new one with the maximal values of every pair of adjacen... |
This challenge is partly an algorithms challenge, partly an optimization challenge and partly simply a fastest code challenge.
A T matrix is fully specified by its first row r and first column c. Each remaining element of the matrix is just a copy of the element that is diagonally up and left. That is M[i,j] = M[i-1,j-... |
Did you know that the Euclidean algorithm is capable of generating traditional musical rhythms? We'll see how this works by describing a similar, but slightly different algorithm to that in the paper.
Pick a positive integer n, the total number of beats, and a positive integer k, the number of beats which are sounded (... |
In this challenge, the goal is to recreate the On-Line Encyclopedia of Integer Sequences one sequence at a time. Similar to the Evolution of Hello World, each answer depends on a previous answer.
Over time, this challenge will create a "family tree" of the OEIS sequences. It is simple to add on to this tree.
Find a ... |
Write a program that takes in an odd length string containing only the characters . and :. With the aid of an initially empty stack, generate a number from this string as follows:
For every character c in the string (going from left to right)...
If c is . and the stack has less than 2 elements, push 1 on the stack.
If... |
In the United States, the two opposing directions of traffic on a road are separated by a dashed yellow line if passing is allowed and two solid yellow lines if passing is not allowed.
(Just one side can be dashed to allow passing on that side, and yellow lines can mean other things like center or reversible lanes, bu... |
You should write a program or function which receives a string representing an ascii-art polygon as input and outputs ot returns the area of the polygon.
The input is a string consisting of the characters _ / \ L V space and newline defining a simple polygon (which means no extra segments, no self-touch and no self-int... |
In this challence, your task is to locate substrings with a given structure.
Input
Your input shall be two non-empty alphanumeric strings, a pattern p and a text t.
The idea is that each character of p represents a contiguous non-empty substring of t which occur next to each other, and p represents their concatenation.... |
Very simple, write a program that at first glance appears to be a quine, but is not. Upon running, the program actually prints the source to a real quine, obviously distinct from the original program in some way, preferably creative, but since this is a popularity contest, the answer with the most upvotes wins.
Standa... |
Write a GOLF assembly program that given a 64-bit unsigned integer in register n puts a non-zero value into register s if n is a square, otherwise 0 into s.
Your GOLF binary (after assembling) must fit in 4096 bytes.
Your program will be scored using the following Python3 program (which must be put inside the GOLF dir... |
You should write a program or function which outputs or returns as much of Chapter I of The Little Prince as it can. Your program or function has to be an M-by-N block of code containing only printable ascii characters (codepoint from 32 to 126) and newlines at the end of each row.
You can only use at most 26 character... |
About the Series
First off, you may treat this like any other code golf challenge, and answer it without worrying about the series at all. However, there is a leaderboard across all challenges. You can find the leaderboard along with some more information about the series in the first post.
Although I have a bunch of i... |
Task
The task is to golf a real-time exact string matching algorithm of your choice.
Input
Two lines of text supplied on standard input, separated by a new line. The first line contains the "pattern" and will simply be an ASCII string drawn from the letters a-z.
The second line contains the longer "text" and will also ... |
The Ship of Theseus is an old question that goes something like:
If a ship has had all of its original parts replaced, is it still the same ship?
For this golf, we're going to slowly replace "parts" on a "ship", and see how long it takes to get a whole new ship.
Task
A ship is comprised of at least two parts. The par... |
Edit: Bounty puzzle at the end of the question.
Given a set of 1-digit numbers, you should determine how tall a tower they can construct.
The digits live on a horizontal plane with a ground level where they can stand. No digit wants to be confused with a multi-digit number, so they always have an empty space on both ... |
In the webcomic Darths & Droids, Pete, who plays R2-D2 in the fictional roleplaying campaign around which the comic is based, once claims (warning: potential spoilers in the linked comic) that, with the Lost Orb of Phanastacoria rigged up to his shock probe, he can now dish out a whopping 1048576d4 of damage. (The GM h... |
This is a screenshot of some text typed in a text editor:
This is the same text at a larger size.
Notice how visible the aliasing is on letters with prominent diagonal strokes like x and z. This issue is a major reason why raster fonts have lost popularity to “scalable” formats like TrueType.
But maybe this isn't an... |
You should write a program or function which given three positive integers n b k as input outputs or returns the last k digits before the trailing zeros in the base b representation of n!.
Example
n=7 b=5 k=4
factorial(n) is 5040
5040 is 130130 in base 5
the last 4 digits of 130130 before the trailing zeros are 3013
th... |
You should write a program or function which given a string as input outputs or returns a string or list of the lowercase letters in the order they find their uppercase pair.
The input is a string consisting of the characters [a-zA-Z] space and newline representing a torus (rectangular grid with wrap around for rows an... |
Optimize the following function for number of tokens:
int length(int x)
{
switch (x)
{
case 1: return 1;
case 3: return 2;
case 7: return 3;
case 15: return 4;
case 31: return 5;
case 63: return 6;
case 127: return 7;
case 255: return 8;
case 511: return 9;
case 1023: ret... |
A brick wall is a rectangle made of horizontal 1-by-n bricks stacked into rows. Here's a wall of height 4 and width 8, with brick sizes shown on the right.
[______][______] 4 4
[__][____][__][] 2 3 2 1
[][______][____] 1 4 3
[____][______][] 3 4 1
This wall is unsteady because it has a fault, a place where... |
You should write a program or function which given a starting order of distinct one-digit positive integers and the length of the track as input outputs or returns the finish order of the numbers.
The input [5,1,2,6,7] and 14 defines the following race:
--------------
76215 ->
--------------
Rules of the race
The tra... |
Identicons are small images of geometric patterns that represent the hash value of a string. Stack Exchange uses the identicons from Gravatar as each user's default avatar image.
In this challenge, we will use the Gravatar identicons as well to generate some text to golf.
Challenge
This stack snippet (a minified versio... |
I wanted to fool a friend by giving him a quine that almost worked, but became sloppier and sloppier.
Create a program that, when run, will output the program, but one character off. Either one character can be added, removed or both (one character changes). But only one character.
Your score will be (length of your pr... |
Task
Write a program or function that takes an image of width w and height h, and two integers a <= w/2 and b <= h/2, and outputs an ascii art representation of the image, with the dimensions a x b.
The ascii art should be generated through the following steps (or another process with the same output):
Resize the w x ... |
You and some buddies are going bowling. There are a total of N bowlers. However, there are only N-1 chairs to sit in. The solution is simple: whoever's turn it currently is doesn't get a chair. Then when their turn is over, they sit in the chair of the person that goes next.
Lets take an example. Say You are named A, ... |
Write a program or function that takes in a single string containing only lowercase a-z, and prints or returns a truthy value if the word is the feminine version of the thing it represents and a falsy value if it is the masculine version. For example, hen is the feminine version for chicken and rooster is the masculine... |
StickStack is a very simple stack-based programming language with only two instructions:
| pushes the length of the stack onto the stack
- pops the top two elements from the stack and pushes back their difference (second topmost - topmost)
Language details
The stack is empty at the start of the program.
All instruct... |
Almost the polar opposite if this challenge, and I suspect it will be slightly easier.
Your task is to take two integers in the format a/b (Forming a rational number) then output the number in decimal exactly.
For example, if you were to input 1/3, it would output:
0.33333333333333333
And would keep on printing 3s unt... |
Your task is to create many programs. The first outputs 1, the second outputs 2, etc. The higher you can go, the better!
However, all of these programs must be made the same list of characters. You can choose which characters to put in the list. Each program can only use a character as many times as it appears in the l... |
Express a number
Back in the 60s, the French invented the TV game show "Des Chiffres et des Lettres" (Digits & Letters). The goal of the Digits-part of the show was to come as close as you can to a certain 3-digit target number, using some semi-randomly selected numbers. The contestants could use the following operator... |
Consider this ASCII version of a mechanism similar to a bean machine or plinko/pachinko game:
O
^
\ ^
^ ^ \
\ ^ / ^
U U U U U
1 2 3 4 5
The O is a ball that falls down.
When it hits a ^, there's a 50-50 chance it will go left or right.
When it hits a /, it always goes left.
When it hits a \, it always ... |
"Let's face it, aligned images are like little gifts from Heaven. Welcome, but unexpected." - Geobits
+10000 reputation to whoever wins this challenge.
Rules:
1) You are to generate a program.
2) Input will be an image, however whether it is passed as a file or a list of numbers is up to you.
3) Output will be a file w... |
Edit: I will award a 100-reputation bounty for the first solver of the bonus puzzle at the end of the question!
I will add the bounty to the question only when the answer appears as this bounty has no deadline.
Given a non-decreasing list of one-digit positive integers, you should determine how deep dungeon the digit... |
One of my kid's favorite toys is a set like this. Actually its one of my favorite toys - I've been playing with it and its been giving me some PPCG challenge ideas. Here's one:
Write a program or function that takes an ASCII line drawing as input and decides whether or not it folds into a cube.
Input
Input will consi... |
This is a tips question for golfing in python.
Suppose you have two lists of strings, and you want to concatenate the corresponding entries from each list. E.g. with a=list("abcd") and b=list("1234"), calculate ["a1","b2","c3","d4"].
This is trivial in array-based programming languages, where operations generally apply... |
Here is a simple ASCII art snowman:
_===_
(.,.)
( : )
( : )
Let's make him some friends. This will be the general pattern for our ASCII art snowpeople:
HHHHH
HHHHH
X(LNR)Y
X(TTT)Y
(BBB)
The leading spaces and the parentheses are always the same for all snowpeople. The different letters represent sections of the pa... |
In Magic: the Gathering, mages (known as "planeswalkers") battle each other by casting spells. Spells cost mana. Five colors of mana exist: White, Blue, Black, Red, and Green, represented as {W}, {U}, {B}, {R}, and {G}, respectively.
A spell's cost is slightly more complex. The cost can be any combination of the follow... |
Write a program in any language that takes a single natural number n as input and generates a Pyth program that, in turn, produces, using nested lists, the nested set given by S(n), where:
S(0) = ∅
S(n+1) = S(n) ∪ {S(n)}
S(n) giving the set representation of the corresponding ordinal number.
Using the list representa... |
I have some books and a bookshelf. I would like to put as many books on the shelf as possible but I have a rule. All dimensions of the books (height, width and depth) should form a non-increasing sequence on the shelf.
This means every books has to be at least as high as the ones after it on the self. The same goes for... |
This challenge is inspired by dmenu, the program I use to launch other programs on my Linux box. To start, for example, GIMP, I simply hit the keyboard shortcut I have assigned to dmenu, type "gimp" and hit enter. However, I don't have to type the whole name. On my machine, if I type "gim", that's enough. Here's how d... |
Inspired by one of Vi Hart's videos (which are a treasure trove full of potential challenge ideas)
A snake is made up of segments of same length and the connection between each segment can be straight or make a 90° turn.
We can encode such a snake (up to a rotation, which depends on the initial direction) by writing do... |
Write a program that calculates the first n perfect numbers. A perfect number is one where the sum of the factors is the original number. For example, 6 is a perfect number because 1+2+3=6. No non standard libraries.The standard loopholes are forbidden.
|
Shortest answer wins.
It must be sorted, and in 24hr time. The final line does not have a comma.
Output should be as follows:
'00:00',
'00:30',
'01:00',
'01:30',
'02:00',
'02:30',
'03:00',
'03:30',
'04:00',
'04:30',
'05:00',
'05:30',
'06:00',
'06:30',
'07:00',
'07:30',
'08:00',
'08:30',
'09:00',
'09:30',
'10:00',
'10:3... |
A casino uses the following deck of cards. (* is one of the card suits D, S, C or H.)
_________ _________ _________ _________ _________
| | | | | | | | | |
| | | | | * | | * * | | * * |
| | | * | | | | ... |
Background
The twelve-coin problem is a classic balance puzzle commonly used in job interviews. The puzzle first appeared in 1945 and was posed to my father by my grandfather when he asked to marry my mother! In the puzzle there are twelve coins, one of which is either heavier or lighter than the others (you don't know... |
A Friedman Number is a positive integer that is equal to a non-trivial expression which uses its own digits in combination with the operations +, -, *, /, ^, parentheses and concatenation.
A Nice Friedman Number is a positive integer that is equal to a non-trivial expression which uses its own digits in combination wit... |
I need to reduce the length of this code in Python 3 as much as possible (even if it will be less readable):
a,b,x,y=[int(i) for i in input().split()]
while 1:
r=''
if y<b:r='S';y+=1
if y>b:r='N';y-=1
if x<a:r+='E';x+=1
if x>a:r+='W';x-=1
print(r)
It's a map: you are on (x,y) and you need to go to (a,b). S for... |
I was told that using the cmp function can be very useful in code-golf. But unfortunately, Python 3 doesn't have a cmp function.
So what's the shortest equivalent of cmp that works in python 3?
|
Write a program that takes in (via STDIN/command line) a non-negative integer N.
When N is 0, your program should print O (that's capital Oh, not zero).
When N is 1, your program should print
\|/
-O-
/|\
When N is 2 your program should print
\ | /
\|/
--O--
/|\
/ | \
When N is 3 your program should print
\ | /
\... |
I'm not even sure if this is even possible, but I think it's worth a shot.
The Challenge
Code/conceptualize a pseudo-random number generator that has the potential to produce results evenly spaced out with similar frequencies... with a twist. The random number generator has to 'loop' back after Foo iterations to its be... |
Someone built a really fancy clock using Fibonacci numbers, which looks really nice but is fairly unusable. Just the way we like it! Let's recreate this.
The clock is made up of 5 sections corresponding to the first five Fibonacci numbers, starting from 1 (i.e. 1, 1, 2, 3, 5):
ccbeeeee
ccaeeeee
dddeeeee
dddeeeee
dddeee... |
You should write a program or function which given a text as input outputs or returns the sum of the following three integers:
Number of lowercase x's which are not part of a cross-formation.
Number of uppercase X's which are not part of a cross-formation.
Number of cross-formations which are made of neither x nor X.
... |
Introduction
Here at code colf SE, we appear to love meta-problems. Here, I've tried to compose a meta-problem that's an interesting, not-straightforward challenge.
Challenge
The answer code is allowed to read its own source code, but not allowed to use external resources.
All characters should be 5-lines tall. Charact... |
Take a unit circle centered on the origin. In any two neighboring quadrants, mirror the curve of the circle across the lines connecting the circle's x and y intercepts.
With the resulting shape, you can tile the plane:
I made this image with the awesome 2D physics sandbox Algodoo!
Write a program that outputs an image... |
This problem is from Five programming problems every Software Engineer should be able to solve in less than 1 hour which itself is an interesting read. The first few problems are trivial, but the fourth one can be a bit more interesting.
Given a list of integers separated by a single space on standard input, print ou... |
Given a positive integer (0 and above, no maximum), convert it into a grade following these rules:
A = 100+
B = 90 - 99
C = 80 - 89
D = 70 - 79
E = 60 - 69
F = 59 and less.
This felt a little boring, so make the grade a + if it's 7,8 or 9 and a - if it's 0,1 or 2. Ignore this for the F and A cases.
An exampl... |
What general tips do you have for golfing in Befunge 93? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Befunge 93 (e.g. "remove comments" is not an answer). Please post one tip per answer.
|
What general tips do you have for golfing in LOLCODE? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to LOLCODE. (e.g. "remove comments" is not an answer). Please post one tip per answer.
|
The Pauli matrices are a set of 2x2 matrices which appear very commonly in quantum physics (no, you don't need to know any quantum physics for this challenge). If we include the identity in the set, the four matrices are:
σ0 = σ1 = σ2 = σ3 =
[1 0] [0 1] [0 -i] [1 0]
[0 1] [1 0] [i ... |
Prelude:
This task is taken from Five Problems Every Software Engineer Should Be Able to Solve in Less Than an Hour, which I really recommend.
The task:
Write a program that outputs all possibilities to put + or - or
nothing between the numbers 1, 2, ..., 9 (in this order) such that the result is always 100.
Winning ... |
The Question
Given a set of 9 numbers, m[], which contains only numbers 1 through 9 in a random order, with no two numbers being the same, create a program in any language which rearranges the number to be in numerical order (1, 2, 3, etc. etc.) by only switching two numbers which are next to each other (ie. 1, 3, 2 → ... |
We are given a list of integers p1, ..., pk (not necessarily distinct) where each has a value between 1 and 9, inclusive. Using each of the p1, ..., pk exactly once, we can form concatenations of digits, to achieve a new list of numbers; we then output the product of this new list. The goal is to maximize this product ... |
The Question
Given a two dimensional array, o[][], create a 2-dimensional graph such that o[xCoordinate][yCoordinate] is the hue of the point at (xCoordinate, yCoordinate), and the value and saturation are always 100. Let the hue go from -50 to 50, where -50 and 50 are 0 and 100 respectively.
Rules
You may use any lan... |
This is a relatively quick one, but I'm sure you'll like it.
Codegolf a program that will take input in the form of a sentence and then provide the output with the first letter capitalized in each word.
Rules:
Submissions may not be in the form of a function. So no:
function x(y){z=some_kind_of_magic(y);return z;} as ... |
Given a positive integer, n, along with n non-negative integers, write a program or function that prints or returns the smallest non-negative integer that can be obtained by additions and subtractions between those numbers. You must use all of the input numbers.
The winner is the algorithm with the smallest big O time ... |
Write a program that takes in an integer N via stdin or the command line.
If N is 0, the single letter O must be printed to stdout.
If N is positive, this horizontal ASCII art double helix, drawn N segments wide, must be printed.
If N is 1, the output is:
/\
O O
\/
If N is 2, the output is:
/\ /\
O / O
\/ \/
... |
You should write a program or function which receives a string as input and outputs or returns if the input is an ASCII tree.
_
\/ /
\_/
|
|
ASCII trees consist of characters / \ | _ spaces and newlines.
The non-whitespace characters connect two edge points of their cells by a line segment:
/ connects the bot... |
The Question
A Sophie Germain prime is a prime \$p\$ such that \$2p+1\$ is prime as well. For example, 11 is a Sophie Germain prime because 23 is prime as well. Write the shortest program to calculate Sophie Germain primes in ascending order
Rules
The Sophie Germain primes must be generated by your program, not from a... |
Introduction
A family of seals are stranded upon an iceberg in the Arctic Circle. There is a radio transmitter located on the iceberg which the seals can use to call for help. However, only the daddy seal knows how to operate the radio transmitter. And worse, the ice is very slippery this time of year, so the seals wil... |
Lets play a game of Meta tic-tac-toe!
This is a king-of-the-hill tournament of Meta tic-tac-toe. The rules of Meta tic-tac-toe are as follows:
All of the regular rules of tic-tac-toe apply.
There are nine boards arranged to make one master board. Like so:
0|1|2 || 0|1|2 || 0|1|2
----- || ----- || -----
3|4|5 || 3|4... |
Most common computer keyboard layouts have the decimal digit keys
1234567890
running along at their top, above the keys for letters.
Let a decimal digit's neighborhood be the set of digits from its own digit key and from the digit keys immediately to the left and right, if they exist.
For example, the neighborhood of ... |
We have 40 sticks of same widths but different heights. How many arrangements are there possible to put them next to each other so that when we look from right we see 10 sticks and when we look from left we again see exactly 10 sticks?
For example such an ordering is:
Black sticks are hidden, red sticks are the ones y... |
aBOTcalypse
Design a bot to compete in a King-of-the-Hill challenge! Here's a replay of a default bot game.
The board is 2D, like a side-scrolling video game (but without any scrolling).
A valid bot must accept a multiline string representation of the region of the board it can see, and output a move for the bot.
Mecha... |
Input:
Any Brainfuck program. This includes brainfuck programs with comments such as +++COMMENT[>+++<-]..
Output:
A program in one of the below languages that produces the same output as the Brainfuck program on all inputs. It should produce the same output exactly as the interepreter on this website There are no code-... |
On my website, users enter their date of birth in the style xx.xx.xx - three two-digit numbers separated by dots. Unfortunately, I forgot to tell the users exactly which format to use. All I know is that one section is used for the month, one for the date, and one for the year. The year is definitely in the 20th centur... |
You have been collecting data from a Advanced Collecting Device Controller™ for a long time. You check the logs, and to your horror you discover that something has gone terribly wrong: the data only contains the last bits of the numbers!
Luckily, you know the starting value and that the value never changes fast. That ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.