instruction stringlengths 34 53.1k |
|---|
Introduction
In this challenge, your task is to correctly list the cases of two Finnish nouns.
The twist is that you may use one of the listings as a guide to produce the other.
The Nouns
We use the following two declination tables as our data.
They list the cases of two nouns, one case per line in the same order as in... |
Food shortage in the Snakepit
For the first time in 35 years, the snakepit is running out of food. The inhabitant snakes now have to fight each other in order to survive this food shortage. Only one snake can stand at the top of the food chain!
Leaderboard
Not here yet!
Last update on February, 24th
Link to visualizat... |
Since I've been seeing more ><> submissions floating around lately, I thought it might be a good idea to have a tips page.
Please stick to one tip per post, unless they are closely related.
Official Python interpreter
Official Interpreter on TIO
Online interpreter (some bugs present, but good for most cases)
Another O... |
Write a rectangular block of text that when arranged into a Sierpinski carpet, using same-sized blocks of spaces for the empty portions, creates a program that outputs the iteration number of the carpet.
For example, if your text block is
TXT
BLK
then running the program
TXTTXTTXT
BLKBLKBLK
TXT TXT
BLK BLK
TXTTXTT... |
Updated Results
Introduction
To celebrate Monster Hunter 4 Ultimate launch on new 3DS (February 13th), here's a King of the Hill themed on this game.
You are a novice hunter, who'll take part in a tournament consisting of 5 consecutives hunts. At the end of these hunts, hunters will be ranked depending on the damage th... |
I am curious if I am Code Golfing properly. I set the challenge for myself to make a small hashing program into a single statement in Python. I first started off with:
from itertools import permutations
from string import ascii_lowercase
from random import sample
def test():
chars = sample(ascii_lowercase, 9)
... |
Write a quine that consists of real English words separated by single spaces. A "word" is defined as a string containing only lowercase and uppercase letters (/[a-zA-Z]+/ in regex). To be "real" your word must be recognized by the official Scrabble dictionary.
I'm using the Scrabble dictionary since it gives a definiti... |
Input
Two lists A and B of nonnegative integers.
Output
Either 1, 0, or -1, depending on whether A is larger than, equal to, or smaller than B with respect to the twisted lexicographical ordering as defined below.
If you want, you can replace 1, 0 and -1 with any other three constant values.
The twisted lexicographical... |
One of the key parts of PNG's compression algorithm is the Paeth transformation, which transforms the image in a way that makes it compress better (usually). In this challenge, your task is to write a program to compute a Paeth transformation. The operation of a Paeth transformation is described below.
The Paeth Transf... |
I have $15 in my pocket. Likewise, I am in a store which doesn't give change. While browsing, I spot an item that costs $10 (tax included). Can I buy that item without losing any money?
In this case, the answer is yes. No matter how my $15 is divided up (one 10 and one 5, or three 5s, or something else), I will alw... |
Recently, when doing some code-golf challenge, I came up with with two solutions, in 69 and 105 bytes. It's a remarkable coincidence, because:
69 (decimal) = 105 (octal)
69 (hexadecimal) = 105 (decimal)
What other numbers have this property (using different bases)? You should help me answer this question!
Write a pro... |
This king-of-the-hill game is a strategy game in which you must throw around a water balloon and avoid getting splashed by water. The goal is to obtain the most points. You will be given a map of the field and the location of the water balloon. You can either return that you want to hit the water balloon (if you are cl... |
Introduction
In this challenge you will be solving diagonal Burrows-Wheeler transforms. Here is a general overview of what a diagonal Burrows-Wheeler transform is. To encode a message, you first must guarantee that it is odd in length (i.e. 5, 7, 9, etc.). Then you make a grid, n by n, where n is the length of the mess... |
A comment I made in chat and the ensuing conversation inspired me to make this challenge.
Am I the only one referred to by initials around here? We are all about golfing things down. We can have MB and D-nob and ... O.
If I'm known as "CH" then I think everyone else ought to have an initial-based nickname as well.
He... |
... Ah sorry, no popcorn here, just POPCNT.
Write the shortest program or function which takes in a number n and output all integers from 0 to 2n - 1, in ascending order of number of 1 bits in the binary representation of the numbers (popcount). No duplicates allowed.
The order of numbers with the same popcount is impl... |
For the purposes of this challenge, let's define a cyclic number as an integer that passes the basic part of Midy's Theorem, but not necessarily the extended theorem. This means:
the digits in the second half of the repeating decimal period are [integer is] the 9s complement of the corresponding digits in its first ha... |
This challenge is about writing code to solve the following problem.
Given two strings A and B, your code should output the start and end indices of a substring of A with the following properties.
The substring of A should also match some substring of B with up to one substitution of a single character in the string.
... |
Topping the Charts
You are a record label company. Your goal is to get 4 of your signed bands in the top 4 positions in the charts. However, its recently been noted that bands currently in the charts influence who is going to be in the charts the next day.
In this challenge, each player will control 5 bands (instance... |
Introduction
In this challenge you will be solving date shift ciphers. Here is a general overview of what a date shift cipher is. To encode a message, you first must make a key. A key in a date shift cipher is any date converted into the form of MMDDYYYY (Adding zeros at the beginning of each part to keep the key 8 lon... |
Write a function/program that accepts a string of lower/uppercase letters [A-Za-z] as input, that checks whether the occuring letters are unique and in alphabetical order (ignoring lower and uppercase) or not. The output must be truthy if they are unique and in alphabetical order and falsy if not.
Here some testcases
a... |
We define a Collatz-like sequence s with 4 positive integers:
n starting value
d > 1 divisor
m > 1 multiplier
i increment
(In the original Collatz sequence d = 2 m = 3 and i = 1.)
Given these integers s will be created in the following manner:
s(0) = n
if k > 0 and s(k-1) mod d = 0 then s(k) = s(k-1) / d
if k > 0 an... |
I have bunch of hexagonal rods glued together into an odd sculpture. The rods
are 1 to 99 centimetres (cm) long and 1 square cm in cross-section area. All
rods are glued on a hexagonal face to at least one other rod. The rods are all
aligned at their bottom edge.
After some heavy rain, the sculpture is full of water. H... |
Prelude is an esoteric programming language, which has very few, but unusual, restrictions on what constitutes a valid program. Any block of printable ASCII text ("block" meaning that lines of printable ASCII are separated by newlines - 0x0A) is valid provided that:
Every (vertical) column of text contains at most one... |
Your work is to recreate this piece of art:
_____
|
|
|
|
_____|
|
|
|
|
_____|
|
|... |
This challenge is about writing code to solve the following problem.
Given two strings A and B, your code should output the start and end indices of a substring of A with the following properties.
The substring of A should also match some substring of B.
There should be no longer substring of A that satisfies the firs... |
Given a list of strings, find the smallest square matrix that contains each of the initial strings. The strings may appear horizontally, vertically or diagonally and forwards or backwards like in this question Word Search Puzzle.
Words should be placed in the square, with at least one word in each direction (horizonta... |
Write a program or function that takes in a positive integer N, and prints or returns an N×N ASCII art string whose top half is a semicircle made of ('s and whose bottom half is a downward-pointing triangle made of V's, with spaces used as padding.
In other words, make an ASCII ice cream cone: (output for N = 17)
... |
Introduction
I want to build a ladder.
For this, I have scavenged from the junkyard two long boards with holes in them, and I want to place the steps into these holes.
However, the holes are not evenly placed, so the steps will be a little wonky, and I find it hard to estimate the amount of rod I need for them.
Your jo... |
Edit
I have posted a 250 lines reference implementation for review at CR, discussing the major class of the code. Download the complete Visual Studio 2013, .NET 4.5 source code (10 kB) from my server.
Story
This is based on a real world puzzle.
A colleague had a very old program. It was announced to be discontinued by ... |
The task is simple: write assembly that computes the order of magnitude of an integer using as few clock cycles as possible.
Order of magnitude is defined as log10, not log2.
The range of valid input is 0 to 1012, inclusive. Behaviour for input outside that range is undefined.
Values should be rounded down to the near... |
Here's a pixelated 5 by 7 font for the digits 0 through 9:
.███.
█...█
█...█
█...█
█...█
█...█
.███.
..█..
███..
..█..
..█..
..█..
..█..
█████
.███.
█...█
....█
...█.
..█..
.█...
█████
.███.
█...█
....█
..██.
....█
█...█
.███.
█..█.
█..█.
█..█.
█████
...█.
...█.
...█.
█████
█....
█....
.███.
....█
█...█
.███.
.██... |
This is Fortnightly Challenge #6. Theme: Language Design
There's a chatroom for this challenge. Come and join us if you want to discuss ideas!
And now for something completely different...
This fortnight, we want to experiment with a new type of challenge. In this challenge, you will be designing a language! Pattern ... |
Input: You will be passed a string containing a single english word. All letters will be lowercase, and there will be no non-alphabetic characters in the string.
Output: You will return an integer from 1 to 7 representing how many syllables you think are in the word.
Scoring: Your program will be run against all of th... |
Once upon a time, I was reading this question/answer on Quora
Are there really programmers with computer science degrees who cannot pass the FizzBuzz test
This code is given as the obvious answer
for i in range(1, 100):
if i % 3 == 0 and i % 5 == 0:
print "FizzBuzz"
elif i % 3 == 0:
print "Fizz"... |
The Shotgun numbers are a sequence with a rather simple definition but some interesting structure. Start with the natural numbers:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, ...
Now take all numbers at indices divisible by 2, group them into pairs, and swap the numbers in each pair:
1, 2, 3... |
It's very simple: Your program or function should generate the following text:
Elizabeth obnoxiously quoted (just too rowdy for my peace): "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG," giving me a look.
Fine print
You may write a program or function, which returns the output as a string or printing it to STDOUT (or c... |
This challenge is simply to return a list of lists of integers, similar to the Python range function, except that each successive number must be that deep in lists.
Rules:
Create a program or a non-anonymous function
It should return or print the result
The result should be returned in a list (of lists) or array (of a... |
The Kolmogorov complexity of a string S is the length of the shortest program P, written in some programming language L, whose output is exactly S.
(Yes, the real definition is more formal but this will suffice for the challenge.)
Your task in this challenge is to write the shortest possible "Kolmogorov complexity solv... |
Believe it or not, the Sex Bob-ombs have become a world famous band and are currently on world tour! As their bookkeeper you must oversee their day to day finances and provide regular reports.
Every few weeks you compile a list of their expenses (in whole USD) in the order they were incurred.
For example, the list
378
... |
Write code to evaluate whether a chain of inequalities is true or false. An example input is the string
3<=4!=9>3==3
This is true because each of its components is true:
(3<=4) and (4!=9) and (9>3) and (3==3)
Input:
A string that represents a chain of one or more inequalities. The allowed comparison operators are
== ... |
The International Code of Signals flag alphabet is used by ships for communication, particularly for static signals.
Your challenge is to write a program or function that will take a string from STDIN or as an argument, and display the corresponding text in the ICS flag alphabet. If your language does not display to t... |
Similar to our threads for language-specific golfing tips: what are general tricks to shorten regular expressions?
I can see three uses of regex when it comes to golfing: classic regex golf ("here is a list that should match, and here is a list that should fail"), using regex to solve computational problems and regula... |
Background
For the purposes of this challenge, an n-state cellular automaton is simply a binary function f that takes two numbers from the state set {0, 1, ..., n-1} as inputs, and returns another number from that set as output.
It can be applied to a list of numbers L = [x0, x1, x2, ..., xk-1] of length at least 2 by
... |
You can find the Hack Assembly Language specification here: http://www.cs.huji.ac.il/course/2002/nand2tet/docs/ch_4_machine_language.pdf
You can download the Hack Computer emulator here:
http://www.nand2tetris.org/software.php
The goal is to write something similar to this:
int i = 1;
while(i<100){
i = i+i;
}
My... |
Your task is to create a random sequence of moves, which can be used to scramble a Rubik's Cube. Such a scramble is made up of exactly 25 moves. Each move consist of of the letters UDRLFB optionally followed by one of the suffixes '2.
This notation is called the Singmaster notation. UDRLFB represents one of the 6 faces... |
Define a prepend-append sequence of length n to be a permutation of the numbers 1, 2, ..., n that can be generated by the following procedure:
Start with the number 1.
For each number from 2 to n, place this number to the beginning or end of the sequence (either prepend or append it, hence the name of the sequence).
... |
The king of Ancient Rome is having difficulties determining if a magic square is valid or not, because the magic square he is checking does not include any separators between the numbers. He has hired a software engineer to help him determine if a magic square is valid or not.
Input Description
Input comes in on STDIN... |
Introduction
Tangrams are a classic puzzle involving arranging/fitting blocks into various shapes. From the Chinese 七巧板 - literally meaning "seven boards of skill". Let's take this idea and use the seven Tetrominos pieces to fill a grid.
Challenge
Write a function or program that takes an array of grid coordinates as... |
A short while, ago, @daniel_ernston sent the following challenge to @StackCodeGolf on Twitter:
@StackCodeGolf Your task is to build a program that uses the API of your choice to tweet its own source code. Shortest code wins, of course.
|
When you run your program first, it should print an integer sequence. The
second run should print the 'Mary had a little lamb' song. The third run should
produce an ASCII image file.
Scoring
Your score will be the sum of your bytes of code and any file content at the
start of each of the 3 runs. Lowest score wins.
For... |
You are given a list of (a,b), and a list of x. Compute the maximum ax+b for each x. You can assume a, b and x are non-negative integers.
Your program or function must run in expected (to the randomness if your code involves that, not the input) O(nlogn) time where n is the total input length (sum or maximum of the len... |
You should write a program or function which outputs or returns the sum of the digits in base b representation of the first n natural power of a in ascending order.
Example for a = 2, b = 3 and n = 4
The base10 numbers are 2^0, 2^1, 2^2 and 2^3.
Their base3 representations are 1, 2, 11, 22.
The digit sums are 1, 2, 2,... |
I want to try a new type of regex golf challenge, which asks you to solve nontrivial computational tasks with nothing but regex substitution. To make this more possible and less of a chore, you will be allowed to apply several substitutions, one after the other.
The Challenge
We'll start simple: given a string containi... |
Write a named function or program that accepts a single integer N and prints (to STDOUT) or returns (as a string) the first N bars of the spiral below, beginning with the vertical bar in the center and spiraling clockwise outward.
_______________
/ _____________ \
/ / ___________ \ \
/ / / ___... |
This is an adaption of Core War, a programming KOTH dating back to the 20th century. To be more specific, it is using an incredibly simplified instruction set primarily based off of the original proposal.
Background
In Core War, there are two programs battling for control over the computer. The goal of each program is... |
The original 151 Pokemon, in an array format suitable for initializers:
["Bulbasaur", "Ivysaur", "Venusaur", "Charmander", "Charmeleon", "Charizard", "Squirtle", "Wartortle", "Blastoise", "Caterpie", "Metapod", "Butterfree", "Weedle", "Kakuna", "Beedrill", "Pidgey", "Pidgeotto", "Pidgeot", "Rattata", "Raticate", "Spear... |
99 (pronounced "ninety-nine") is a brand new Esoteric programming language (not to be confused with 99, note the italics). Your task in this challenge is to write an interpreter for 99 that is as short as possible. The submission with the fewest bytes wins. Tiebreaker goes to the submission posted first.
Since this que... |
Introduction
Most of you are familiar with the merge sort algorithm for sorting a list of numbers.
As part of the algorithm, one writes a helper function called merge that combines two sorted lists into one sorted list.
In Python-like pseudocode, the function usually looks something like this:
function merge(A, B):
C... |
This is a tips question for golfing in python.
In multiple golfs I've done in Python, a fixed value is assigned to one of two variables chosen by a Boolean. The chosen variable is overwritten by the given value, and the other is unchanged.
17 chars:
if b:y=z
else:x=z
Assigning a conditional value is easy, but assignin... |
Consider a potentially self-intersecting polygon, defined by a list of vertices in 2D space. E.g.
{{0, 0}, {5, 0}, {5, 4}, {1, 4}, {1, 2}, {3, 2}, {3, 3}, {2, 3}, {2, 1}, {4, 1}, {4, 5}, {0, 5}}
There are several ways to define the area of such a polygon, but the most interesting one is the even-odd rule. Taking any p... |
Challenge
Task
Given a number N, output 2 NxN squares; each line of each square is a random permutation of [0, N); the squares are separated by a newline
Rules
Produce a randomised list of length N, separated by space
Repeat this N*2 times
Separate each output with a newline, with 2 newlines at the midpoint
The value ... |
Given a number N, output a NxN right angled triangle, where each row i is filled with numbers up to i.
Example
n = 0
(no output)
n = 4
1
1 2
1 2 3
1 2 3 4
n = 10
1
1 2
1 2 3
.
.
.
1 2 3 4 5 6 7 8 9 10
(no alignment needed)
n = N
1
1 2
1 2 3
.
.
.
1 2 3 4 .... N
There is no trailing space at the end of each line.
Lea... |
A downhill maze is given as a series of rows of space separated digits from 0 to 9 inclusive, plus one "S" and one "X", where the S denotes the start and the X denotes the finish. In a downhill maze, you may only go to a space that is adjacent to you to the north, south, east, or west (no diagonals), and you may only ... |
Background
I want to build a fence.
For that, I have collected a bunch of poles, and stuck them to the ground.
I have also collected lots of boards that I'll nail to the poles to make the actual fence.
I tend to get carried away when building stuff, and most likely I'll just keep nailing the boards to the poles until t... |
Sometimes, when I'm really bored (really bored), I like to draw a line segment and draw points on it.
First, I draw a line segment of a certain size, which is 2^N for some value of N. The line will be represented by a series of . characters.
................
Then, I plot a point at the left end. Points will be repre... |
(Inspired by an early draft of PhiNotPi's fractal line challenge.)
You're given a width W > 1, a height H > 1 and string consisting of 2(W+H-2) printable ASCII characters. The task is to print this string wrapped around a rectangle of the given width and height, starting in the top left corner, in a clockwise sense. Th... |
The size of the moon mystery
I am sure you have heard that the moon changes its size. When you're in love and you're lucky, the moon is almost twice in size compared to normal situations. Some people say the reason is the atmosphere which acts as a lens. Others think that it is only a matter of comparison to other obje... |
In some cases, often in physics, you have to sum graphs. Your challenge is to write, in a language of your choice, a program or function that takes multiple graphs as images, calculates all possible sums, and outputs the result.
Graphs
The graphs are images that contain a white (rgb(255, 255, 255)) background with a no... |
99 is a programming language I invented earlier this week for my challenge Write an interpreter for 99. (Invented but never needed to implement thanks to half a dozen of you. ;) ) The full language spec is in that challenge so I'm not bothering to repost it all here.
In 99 you can print individual ASCII characters to s... |
Happy Pi Day everyone! For no reason at all, I'm trying to construct a Monte Carlo estimator of Pi that is as short as possible. Can we construct one that can fit in a tweet?
To clarify, what I have in mind is the typical approach of drawing random points from the unit square and calculating the ratio that fall within ... |
Input
The name of a file in the raster graphics format of your choice. The chosen format must support at least 8 bits per channel and 3 channels.
Output
A file in the same format, with the same dimensions and pixels as the first, but whose pixels are grouped in descending order of the number of times they occur, sorted... |
Load an image into this stack snippet and move your mouse over it. A black curve that follows the hue angle, starting at your cursor point, will be drawn:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><style>canvas{border:1px solid black;}</style>Load an image: <input type='f... |
Because I can't concentrate on any task for more than about 5 seconds, I often find myself breaking up words into a sub-strings, each of which is a different length and doesn't contain any repeated characters. For example, the word "pasta" might be broken up in "past" & "a", "pas" & "ta", or "pa" & "sta" and you get th... |
Pyth is a golfing language based on Python. It uses prefix notation, with each command having a different arity (number of arguments it accepts).
Your task is to write a syntax checker for a (non-existent) Pyth-like language, Pith.
Pith's syntax
Pith only has 8 single-char commands:
01234()"
01234 each have arity of t... |
Yes, the good old GIF. Loved for its versatility, hated for its patents and partly obsoleted due to its limitations (and patents), GIF consists, at the core, of a color palette and a palette-indexed image compressed using the LZW algorithm.
Your task is to write a program that reads an image in ASCII PPM format ("P3" m... |
Following on from Monte Carlo estimator of Pi this challenge is to produce the shortest code for the constant Pi. Except here your code must output consecutive digits of pi forever.
This is code golf, so the shortest submission (in bytes) wins except that it must output the first 10,000 digits in less than 10 seconds ... |
Create a program, that converts input string to a palindrome starting with the input string. The program itself must be a palindrome.
For example input: neverod, print neveroddoreven. You should handle multi-word, multi-line inputs as well.
|
This code-challenge is related to the code-golf question Analyzing Collatz-like sequences but the goal is quite different here.
If you are familiar with Collatz-like sequences you can skip to the section "The task".
We define a Collatz-like rule with 3 positive integers:
d > 1 divisor
m > 1 multiplier
i > 0 increment
... |
I'd like to get a list of words that are strongly connected with a particular time epoch, for example, 19th century, 20th century and 21st century. I suspect that nobody used a word like "smartphone" in 19th and 20th century, and, vice versa, nobody still uses a word like "grubble" anymore in 21th century.
Input data
I... |
Consider a grid of NxN unique elements. Each element has a letter (from A to the Nth letter, inclusive) and a number (from 1 to N, inclusive). Hence, each number/letter pair is in the grid exactly once.
Your job is to arrange a grid such that:
Each row, column, and diagonal (including wrapping) contains each letter a... |
Introduction
A palindromic closure of an input string is the shortest palindrome that can be constructed out of the input string where the final palindrome starts with the input string.
For this challenge, we will consider a two-way palindromic closure such that
Left Palindromic Closure of an input string is the short... |
Write some statement(s) which will count the number of ones in an unsigned sixteen-bit integer.
For example, if the input is 1337, then the result is 6 because 1337 as a sixteen bit binary number is 0000010100111001, which contains six ones.
|
There are many types of binary operations, which can be categorized by their associative properties and their commutative properties.
A binary operation () is associative if the order of operations between operands does not affect the result — i.e. if (a(bc)) = ((ab)c).
A binary operation () is commutative if the orde... |
Without changing the actual function, call it in such a way that it prints "True"
void Puzzle(out int x, out int y)
{
x = 0;
y = 1;
Console.WriteLine(x == y);
}
Online Tester
|
Your friend is trying to break into a vault that has a peculiar locking system: it requires a certain number of gentle knocks in a particular spot. Your friend discovered the number (which is in the range 1...99999) and possesses a gadget that produces the required knocks. However, the gadget is a Brainfuck interpreter... |
Write a function or complete program that takes a positive number n and performs n steps of an iterative algorithm for calculating π that has quadratic convergence (i.e. it approximately doubles the number of accurate digits at every iteration) then returns or prints out 2n correct digits (including the beginning 3). O... |
Introduction
This challenge is inspired by Grime, my 2D pattern matching language.
Basically, you are given a "grammar" that describes two-dimensional grids of characters, and your job is to generate a grid according to the grammar.
In addition, the grid should be as small as possible in a certain weak sense.
Input
You... |
Let's get right in to it.
Your challenge is to make a program that does these things depending on its input:
If the input is a number, output "Prime" if the number is a prime number and "Not prime" if the number isn't a prime number. You can assume the number is > 1.
If the input is two numbers, output every single p... |
The challenge is really simple: given a number, you split its digits into an array of smaller numbers such that the resulting numbers are non-decreasing. The catch is that you have to split it such that the array length is maximal.
Confused?
You are given a positive integer via STDIN (or closest alternative), command-... |
Introduction
Local genius Calvin's Hobbies recently challenged us to trace the hue of an image.
It is recommended to read his challenge beforehand, but to highlight the main points:
The trace of hue in an image can be found by starting at one pixel, finding its hue angle(hue = atan2(sqrt(3) * (G - B), 2 * R - G - B)),... |
Write a program or function that takes in a list of positive integers. Each of these integers represents the side length of a square on a 2D plane. Each square can be moved to any integer coordinates in the plane, but it can't rotate and it can't overlap other squares.
Using a different printable ASCII character for ea... |
Background
The so-called "Urinal Protocol", describing the order in which individual urinals are picked in a men's bathroom, has been discussed in multiple places. One version is given in this xkcd blog post. This question concerns a slight variation:
Arrangement: n urinals in a line.
Protocol: each new person selects... |
Write the shortest possible program which takes a numeric input and outputs the result of adding 42 to the input.
f(x) -> x + 42
There's only one restriction. Your program can only be composed of rod logic characters...
The definition for a rod logic character is a one that is composed purely of straight lines. They ... |
Inspired by this question, your goal today is to encode an URL in brainfuck.
My browser has been hacked! The location bar has been turned into a brainfuck interpreter. I need a program that turns an URL into a brainfuck program. My computer is also very slow, so if the brainfuck program is small it's better.
Oh and I o... |
Since it was Pi day recently, I have noticed a number of challenges that ask you to calculate pi.
Of course, a quiche lorraine is not quite a pie (you can claim a Bonus Score¹ of +1 if you guessed the challenge off of the title). As such, your job is to write an algorithm or method that looks like it approximates Pi at... |
A little known fact about vampires is that they must drink the blood of victim that has a compatible donor blood type. The compatibility matrix for vampires is the same as the regular red blood cell donor/recipient matrix. This can be summarized by the following American Red Cross table
Type You Can Give Blood To... |
Duodyadic tiles are kinds of square function blocks that take two inputs, one from their top side and one from their left side, and have two outputs, one on their right side and one on their bottom side. Each of their outputs is a separate function of both of their inputs.
For example, if # represents a generic tile, t... |
Introduction
The Baker's map is an important dynamical system that exhibits chaotic behavior.
It is a function from the unit square to itself defined intuitively as follows.
Cut the square vertically in half, resulting in two rectangles of size 0.5×1.
Stack the right half on top of the left, resulting in one rectangle... |
Given a polynomial, determine whether it's prime.
A polynomial is ax^n + bx^(n-1) + ... + dx^3 + ex^2 + fx + g, where each term is a constant number (the coefficient) multiplied by a nonnegative integer power of x. The highest power with a nonzero coefficient is called the degree. For this challenge, we only consider p... |
There are 21 items in Minecraft that you can craft using only wood and items crafted from wood:
axe
boat
bowl
button
chest
crafting table
door
fence
gate
hoe
ladder
pickaxe
planks
pressure plate
shovel
sign
slab
stairs
stick
sword
trapdoor
This list assumes that the 6 different types of wooden planks/slabs/doors/etc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.