instruction stringlengths 34 53.1k |
|---|
Challenge
In this challenge, you will be writing the first program, p1, of an infinite sequence of programs, in which running pn outputs/generates program pn+1. When concatenating the first n >= 2 programs, the sequence should output n.
Example
Let's say the first 4 programs are:
p1 p2 p3 p4
If I were to run p1, it sh... |
I didn't check the sandbox before posting this challenge - it looks like this challenge was proposed by Cᴏɴᴏʀ O'Bʀɪᴇɴ.
Given an integer input, write a program that prints the "four is a magic number" riddle
Four is the magic number
Five is four and four is the magic number
Six is three and three is five and five is fo... |
Colonies of bacteria labelled 1 through 9 live on a segment of equally-spaced cells, with empty cells indicated by 0
0 0 2 0 0 0 1 2 0 0 3 3 0 0
Every second, each colony spreads to adjacent empty cells. If two colonies reach an empty cell at the same time, the larger-labeled colony takes it.
t=0: 0 0 2 0 0 0 1 2 0 0... |
The challenge is simple:
Write a function or program that takes an input x, and outputs the lower case alphabet if x is part of the lower case alphabet, outputs the upper case alphabet if x is part of the upper case alphabet and outputs just x if it's not part of either.
Rules:
The input can be function argument or fr... |
This challenge consists of two parts. The winner will be the solution with the lowest total byte count. The same language must be used for both challenges.
Part 1:
Write a function or program that takes a sentence with only valid words as input, and outputs a list of the used characters, the number of times each letter... |
In an effort to level the playing field between languages with built-in date libraries and those without, let's work with a fictional calendar. The Forgotten Realms are a (the?) campaign setting for Dungeons & Dragons. Of course, each have their own calendar.
The Calendar of Harptos
Conveniently, a year in the Forgott... |
You must do a program that reads a file given in first argument and print it's content to STDOUT and number the lines on the file, the numbers should be followed by a space.
For instance, assuming that your program is named cat, we could write
./cat "myfile.txt" (or execute it with its interpreter)
With myfile.txt:
Hel... |
The idea of this challenge is to find all the words from a dictionary on a grid of letters. Your input should come from stdin or function arg and will come in the following format:
[your dictionary as a list of space sep words]
[a grid of letters]
Example:
The cool car
looc
thea
jopr
Rules for finding a match
A matc... |
Given a deck consisting of N copies of cards with integer values [1,M] for a total of N*M cards, compute the probability that a card with the value of 1 is adjacent to a card with the value of 2.
Your solution may be exact or approximated, and it does not need to be the same for every run given the same inputs. The giv... |
Introduction
Imagine that line of chars is in fact two rows. Upper row - dots - represents hours (24 hour system), while lower - commas - represents minutes. One character can represent hour, minute or both - whenever it's possible.
At first probably you'd have to convert minutes since midnight to hours and minutes.
... |
Trump needs the wall constructed and you are going to do it! To most efficiently build his wall I have created a simple, repeatable pattern for you to use:
__ __
| |_| |
___| |___
- - - -
- - - - - - -
- - - - - - - -
———————————————
Trump will tell you how many wall segments he needs... |
When making a Dungeons & Dragons character, an alternative to rolling ability scores is to assign them within a power budget called point buy. Higher ability scores cost more points, especially towards the upper end: a score of 8 is free, and raising a score by 1 costs 1 point, except raising to 15 or 16 costs 2 points... |
While there are many edit distance questions, such as this one, there isn't a simple question to write a program that calculates the Levenshtein distance.
Some Exposition
The Levenshtein edit distance between two strings is the minimum possible number of insertions, deletions, or substitutions to convert one word into ... |
The Binary Sierpinski Triangle sequence is the sequence of numbers whose binary representations give the rows of the Binary Sierpinski Triangle, which is given by starting with a 1 in an infinite row of zeroes, then repeatedly replacing every pair of bits with the xor of those bits, like so:
f(0)= 1 ... |
This challenge is based on Downgoat's Adjust your chair.
Challenge
You just adjusted your new chair! It fits you perfectly. However, the wheel is squeaky and you know the repair people will change the adjustment. Problem is, you don't have a ruler, so you'll have to write a program to measure it for you.
The repair pe... |
Introduction
Of course, we've got a lot of sequence challenges, so here is another one.
The Kimberling sequence (A007063) goes as following:
1, 3, 5, 4, 10, 7, 15, 8, 20, 9, 18, 24, 31, 14, 28, 22, ...
This is produced by shuffling the normal iteration:
[1] 2 3 4 5 6 7 8
The first term of the sequence is 1. Aft... |
Overview
Run-length encoding — sequences in which the same data value occurs in many consecutive data elements are stored as a single data value and count
When using run-length encoding:
Input: ABBBCCACB
Output: 1A3B2C1A1C1B
This sample has an output that is larger than the input.
Instead, it can be simplified for... |
Introduction
As ToonAlfrink says: "Me thinks there aren't enough easy questions on here that beginners can attempt!". So the task is very simple. Given a string, output a truthy or falsy value whether the name is official or not.
A name is "official" if it is a single title-case word, that is:
If the first letter is c... |
If you've ever played Spacewar!, you know it was a fun game. If you haven't, know this: it was (and is) one of the very first and most important computer games. And it's still fun! The clone I grew up on is this one, which is, apparently and unfortunately, Windows only. So I recreated it!
The KotH is hosted here: PPCG... |
In this challenge, you are passed two things:
A string length, N
A list of strings, L, each with an assigned point value. Any string that is not passed in has a point value of 0
You need to construct a string of length N such that the sum of all substring points is as large as possible.
For example:
5 [("ABC", 3), (... |
Many important topics in abstract algebra involve a binary function acting on a set. A number of properties of such functions have been defined in the investigation of such topics.
Your challenge will be to determine whether a given binary function on a given domain possesses five of these properties.
Properties
Closur... |
Given a string input, your task is to write a program that prints a truthy value to STDOUT or equivalent if the input contains "2016" anywhere in it without using any built-in contains, match, replace, split or other functions that use patterns or regexes.
A truthy value also must be printed if the input contains "2016... |
Paper stars are a big thing in my family at christmas, so I thought a virtual one would be cool.
Below is an image of a regular dodecahedron (from https://en.wikipedia.org/wiki/Dodecahedron, attributed to the author mentioned there.)
The process of stellation (wikipedia) when applied to a polyhedron involves extending... |
Santa needs some help determining how many elves he will need to help him deliver gifts to each house.
Coal is considerably heavier than presents, so santa will need three elves for every naughty person in the house. Only two elves are needed to help santa carry presents.
On santa's map, a house is represented by a *, ... |
Quipus are an ancient device used by the Inca in the Precolumbian era to record numbers in a base ten positional system of knots on a cord, which works as follows:
Each cluster of knots is a digit, and there are three main types of knots: simple overhand knots; "long knots", consisting of an overhand knot with one or ... |
It's almost Christmas, so Santa has to plan his route. You're helping him, for reasons unknown.
Santa needs help planning the route and wants you to give him a solution, but since you're all ungrateful and unwilling to give to the man who has given you so much, so have decided to give him a program with as few bytes as... |
Introduction:
Before the task, here is what every element does on the map:
Plain land (X): This does nothing.
Destroyed land (-): This is the same as plain land, but destroyed by a bomb.
The active bomb (!): On a map, this will destroy everything in a 3x3 square:
XXXXX XXXXX
XXXXX ... |
Recently I've been writing a new language, to avoid needing to handle order of operations, I simply parenthesize each expression properly to avoid this entirely.
Because parenthesis are at char-codes 40-41, your code will need to be as short as possible.
Examples
1+2*3
(1+(2*3))
2*(3+4)
(2*(3+4))
2*3/4+3
(((2*3)/4)... |
The goal of this challenge is to compute one kind of numerology digit from strings containing characters and numbers.
The input may be through any convenient method (standard input, arguments, separated file).
The input may contain any printable ASCII chars, but only alphanumerical (A-Z, a-z, and 0-9) have to be consi... |
Background
Inspired by this Unix.SE question (and of course my own answer).
When an IP address is specified for an interface, it is often given in this dotted-decimal form:
a.b.c.d e.f.g.h
where a.b.c.d is the actual address and e.f.g.h is the netmask.
The netmask, when represented in binary, is basically a bunch of 1... |
Donald Trump is very impressed with the work of the people on this site. He saw how amazing of a job you did helping Ben Carson, so he even hired you to build his wall. He thinks you're terrific. Now he needs your help again. While he has successfully built his wall, now he needs the Mexican government to pay for it. H... |
The aim is simple: given the string of resistance values, draw the part of "electrical circuit" of those resistors. Examples follow.
Input: 3. Output:
--3--
Input: 1,2,3. Output:
--1----2----3--
Next, the resistors can be joined parallel (by 2 or 3 resistors per join), but the required depth of parallel joins is on... |
First of all ... I would like to wish everyone a Merry Christmas (sorry if I am a day late for your timezone).
To celebrate the occasion, we are going to draw a snowflake. Because the year is 2015 and Christmas is on the 25th (for a large portion of persons), we will draw a Pentaflake. The Pentaflake is a simple fracta... |
In this challenge you and your friends are debating on which case is better, uppercase or lowercase? To find out, you write a program to do this for you.
Because esolangs scare your friends, and verbose code scares you, your code will need to be as short as possible.
Examples
PrOgRaMiNgPuZzLeS & CoDe GoLf
0.52 upperca... |
The goal of this challenge is to create a program that outputs a string depending on the time of year.
Output
If the date is December 25, output:
Merry Christmas!
If the date is December 31 or January 1, output:
Have a Happy New Year!
If the date is between December 25 and December 31 (exclusive), output:
Happy Hold... |
Objective
Write the shortest program possible that adds semicolons to the end of all lines of code in a file unless:
it already has a semicolon at the end
the line is blank.
Must be a complete program.
Bonuses
Write the program so it won't produce any compiler errors when running the program on a C Header File.
|
Your challenge is to determine whether the given input is an integer, a string, or a decimal.
Rules
A string is any input that is not an integer or a float
An integer must contain only numeric characters and must not start with a zero
A decimal is any input that contains the period (.) and the period is surrounded by ... |
A fountain is arrangement of coins in rows so that each coin touches two coins in the row below it, or is in the bottom row, and the bottom row is connected. Here's a 21 coin fountain:
Your challenge is to count how many different fountains can be made with a given number of coins.
You will be given as input a positi... |
This is the cops' thread. The robbers' thread goes here.
Write a program or function consisting only of printable ASCII characters (that excludes tab and newline) that outputs at least 5 printable ASCII characters in ascending order (from space to tilde / 32 to 126). Characters can be outputted several times, as long a... |
This is the robbers' thread. The cops' thread goes here.
In the cops thread, the task was to create a program that outputs printable ASCII characters in ascending order. The robbers task is to unscramble the code the cops used to produce this output.
The cracked code doesn't have to be identical, as long as it has the ... |
Introduction
Number theory is full of wonders, in the form of unexpected connections. Here's one of them.
Two integers are co-prime if they have no factors in common other than 1. Given a number \$N\$, consider all integers from 1 to \$N\$. Draw two such integers at random (all integers have the same probability of bei... |
Normally, challenges are scored in bytes, or sometimes Levenshtein distance, but for this one we're using keyboard distance -- the number of keys between the keys used to type the program (use the above keyboard as the definitive reference). For example, the distance between A and F is 3, because the path is A=>S=>D=>... |
Introduction
I Ching is an ancient divination text and the oldest of the Chinese classics. It uses a type of divination called cleromancy, which produces apparently random numbers.
The basic unit of the Zhou yi is the hexagram (卦 guà), a figure composed of six stacked horizontal lines (爻 yáo). Each line is either broke... |
Introduction
XOR is a digital logic gate that implements an exclusive or. Most of the times, this is shown as ^. The four possible outcomes in binary:
0 ^ 0 = 0
0 ^ 1 = 1
1 ^ 0 = 1
1 ^ 1 = 0
This can also be seen as addition modulo 2 in binary. In decimal, we need to convert the decimal to binary, 35 = 100011 and 25 =... |
Some background
In math, a group is a tuple \$(G, *)\$ where \$G\$ is a set and \$*\$ is an operation on \$G\$ such that for any two elements \$x, y \in G, x * y \in G\$.
For some \$x,y,z\in G\$, basic group axioms are as follows:
\$G\$ is closed under \$*\$, i.e. \$x * y \in G\$
The operation \$*\$ is associative, i.... |
Inspired by this xkcd
You work for Shazam and they have a project for you. Some customers are complaining about their app taking up too much space on their phone, so they want you to code a lite version of the app. Unfortunately, your existing code can only understand the word "na", and you have to ship soon. That's o... |
You're designing a new esoteric programming language and
one feature you've decided to add is a dynamic memory allocator. Your language specifies a special dedicated virtual address space for the user's program space. This is separate from the address space used by the memory allocator for any internal state.
To help r... |
The challenge is simple: given two parameters, x and y, output y staircases with x steps. For example:
f(3,1) - 1 staircase with 3 steps.
_
_|
_|
f(5,2) - 2 staircases with 5 steps.
_ _
_| _|
_| _|
_| _|
_| _|
Make sure you output the staircases just like,... |
Recently I've been having some trouble with the new TeaScript interpreter. The biggest problem is identifying whether or not a string contains any special characters.
Challenge
A special character is defined as a character with codepoint 160 to 255. You will be given an input which is a string of characters with codep... |
Input: A single word as a string (matches [a-zA-Z]+). If the input doesn't follow these guidelines, print "Error" (but no error should be thrown)
Output: The NATO pronunciation of the word. Print out a space separated list of the NATO word that matches each letter of the input word. Trailing white space is accepta... |
I think the question as above is clear, but just in case:
Write a full program (not just a function) which prints a positive base 10 integer, optionally followed by a single newline.
Qualifying programs will be those whose output is longer (in bytes) than the source code of the program, measured in bytes (assuming AS... |
Explanation:
Last year in math class, on homework we would occasionally get these extremely simple, although equally annoying questions called diamond puzzles. These were basically questions where we would be given a sum, and a product then were asked to find the two numbers which when multiplied give the product, and ... |
Time for another Pyth practice. I present here 8 problem statements with a Pyth solution each. These solutions are written by a Pyth beginner. He is quite happy about these solutions, since they are a lot shorter than his Python answers. Your task however is to show him better. Create equivalent but shorter programs.
T... |
Introduction
The Parsons code is just a simple way to describe pitch variations in a piece of music, whether a note is higher or lower than the previous one.
Even if you suck at remembering tunes, you can still pretty much remember if a note goes up or down, thus the Parsons code can help you to identify a music using ... |
Recently, I made a made a typo and I wrote unicorn instead of unicode, I did what any normal person would do and I made an esolang out of it. In this challenge you will be writing a Unicorn interpreter.
Because Unicorn programs are horrible long, you'll have to write a short interpreter to compensate for this.
Example
... |
In my room, I have this geeky clock (click for full size):
Most of these are not difficult to figure out, but the one for 4-o-clock is particularly tricky:
Normally, a fraction like 1/2 doesn't make sense in modular arithmetic since only integers are involved. The correct way, then, is to see this as the inverse of 2... |
In physics, like electric charges repel, and unlike charges attract.
The potential energy between two unit charges separated by a distance d is 1/d for like charges and -1/d for unlike charges. The potential energy of a system of charges is the sum of the potential energies between all pairs of charges.
Challenge
Deter... |
Conceptually, this challenge is really simple. You're given a list of non-negative integers ai. If possible, find a non-negative integer N, such that the list consisting of bi = ai XOR N is sorted. If no such N exists, output should be anything that can't be mistaken for a valid N, e.g. a negative number, nothing at al... |
We've had a lot of challenges on differentiation and integration, but none on just solving related rates problems. So in this challenge, you will get a bunch of derivatives (They will be numeric, not in terms of any variables) and have to find another derivative.
The input will come in a newline separated list of equat... |
In long multiplication, after multiplying the numbers, you are left with the partial products, in this challenge you will output those partial products.
Because long multiplication is long, to compensate your code will need to be as short as possible.
Examples
34, 53
102, 1700
48, 38
384, 1440
361, 674
1444, 25270, ... |
Given a word consisting of lowercase letters only, do the following:
For each letter, get the prime factorization of its position in the alphabet.
For each prime factor, p, draw a diamond of side length p and stick the letter in the middle of the diamond.
The biggest diamond is in the middle, subsequent smaller diamon... |
Given an input string, determine the number of regions that a page will be split into.
Consider the letter P. It has one enclosed region within the letter. Assume that each letter splits the page by one or more regions (i.e. a box is drawn around the character).
Input
A string of 0 or more characters. You may assume th... |
Input
A matrix M represented as two space separated lines of integers. Each line will have the same number of integers and each integer will be either -1 or 1. The number of integers per line will be at most 20. M will therefore be 2 by n where n is the number of integers on each of the two lines.
Your code should be... |
Introduction
The Enigma was one of the first electro-mechanical rotor cipher machines used in World War II. That means that after a single letter is coded, it would change the key for the next letter. This was considered unbreakable by the Germans, due to the enormous key space. Even brute-forcing was almost impossible... |
If you have ever travelled with kids more than about 20 minutes, you will have no doubt heard cries of "Are we there yet?" and "How much further?"
So we play games like "I Spy" to help pass the time as the miles go by.
There is a variation on "I Spy" whereby instead of spotting arbitrary named things, you must spot int... |
Yes, this is old and probably very simple, but I really want to be mindblown by things that I thought were obvious, so here's the challenge:
You're given a positive integer as the input and you need to output the exponents of all of the prime factors up to the highest factor in base 36 ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a... |
In the game Terraria, one of the game mechanics involves building houses so that an NPC can move in. There is a strict set of rules for what counts as a valid house or not. Here is the list of rules:
The total area in the house must be at least 60 square tiles, but less than 750. Also, the size of the house including ... |
Challenge
Here's a simple one.
Write a function or program when given a number in base 10 as input, it will return or print that number's value in Hexadecimal.
Examples
15 -> F
1000 -> 3E8
256 -> 100
Rules
No built-in Hexadecimal functions whatsoever
Letters may be lowercase or uppercase
You will only need to worry a... |
The challenge is to follow (draw) the path:
^n - up by n lines
vn - down by n lines
>n - right by n character positions
<n - left by n characters positions
n is an integer, greater than zero (i.e. you can't receive a command like >-2).
There're no separators between the commands, the well-formed input looks like th... |
It's well known that corrupted JPEG files or NTSC/PAL streams will appear as distorted versions of the true images, or versions covered in random-looking blocks of pixels.
Consider the below image (from here):
If we run it through this filter (with settings 44, 7, 21, 83, for anyone who wants to reproduce it), it end... |
Task
Constantly having to check on television, or the time on your computer to see if its 2016 is a tedious task. Being programmers, we should be able to automate this task. Write a program that will output 2016 when the system time hits Friday, January 01, 2016 00:00:00. or rather 1451624400000 ms since midnight Janua... |
Anomalous Cancellation (from Wolfram Alpha):
Anomalous cancellation is a "canceling" of digits of a and b in the numerator and denominator of a fraction a/b which results in a fraction equal to the original. Note that if there are multiple but differering counts of one or more digits in the numerator and denominator t... |
Given an input of a color in #rrggbb hex format, output its RGB complement in
the same format.
The RGB complement R2G2B2 of any color
R1G1B1 is defined as the color with
R2 value 255 - R1, B2 value 255 -
B1, and G2 value 255 - G1.
Hex digits may be either in uppercase (#FFAA20) or lowercase (#ffaa20). The
case of the i... |
2015 was the year of the goat! In this challenge, you will figure out which animal represents the year. To avoid making this challenge to complex you won't need to calculate Chinese new year.
Because they are only 12 animals in the Zodiac, your code will need to be as short as possible.
Examples
Your program must get t... |
In the Bitcoin protocol, 2016 is a very special number. The "difficulty" of finding a hash to create a new block is adjusted every 2,016 blocks to approximate changing once every two weeks.
This number was chosen is because the difficulty adjusts itself so that every block takes about 10 minutes to be found, and in two... |
Given a decimal in the form of <float>, <precision>, you draw the graphical representation of the decimal part (i.e. fraction) of the float. Examples:
Input: 6.75, 4, output:
6||| 7
----
6.75 (first number from the input) is the number to explain, 4 (the second number from the input) is the number of dashes below t... |
Background
The greatest common divisor (gcd for short) is a convenient mathematical function, since it has many useful properties.
One of them is Bézout's identity: if d = gcd(a, b), then there exist integers x and y such that d = x*a + y*b.
In this challenge, your task is to visualize this property with simple ASCII a... |
In this challenge you will need to determine whether it's Pi Day, Pi Minute, or Pi Second.
Because Pi is irrational, it wants your code to be as short as possible.
Examples
No input is provided, your program should use the system time. I've just added it for clarity
March 14, 2016 0:00:00
Pi Day
December 25, 2015 3:14:... |
The Rules
Each submission must be a full program or a function.
The program must take all instances of the string 2015 from the input (1 string), replace it with <s>2015</s>* (with <s> or <strike>). At the end, if there has been at least one 2015 in the string, you must add a newline and this string: *2016. I'm a year... |
Your task is simple. Post a snippet in any language that if the snippet is repeated n times, will output n in decimal, octal, and hexadecimal, in that order, separated in spaces. n is an integer larger than zero. There is no leading zeroes. Shortest answer wins
Example
If the snippet is ABC then the test case is
ABC
1... |
Your challenge:
You are on the 0th floor of a infinitely tall building. At any floor, you can walk to the window and drop an egg. Your goal is to figure out the highest floor that the egg can withstand without breaking. However, you have a maximum of 3 eggs to use to figure this out, but you need to minimize the numb... |
What general tips do you have for golfing in Forth (and its clones)? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Forth (e.g. "remove comments" is not an answer).
|
Task
Take a single Unicode character as input.
Output a program in the same language that also obeys this specification, but which does not contain the input character.
If your program is run with input a, and then the output program is then run with input b, then the program it outputs is ALLOWED to contain character... |
Given an input of a "hotel" in ASCII art with a single room marked, output the
room number according to certain rules.
Here's an example of an ASCII hotel:
##
##
##### ##
##### ###### ##
##### ###### ##
##### ###### ##
Here are a few more things about the ASCII hotels:
Eac... |
Write a function or program than can do simple arithmetic (addition, subtraction, multiplication and division) in both base 10 and base 2.
The function will take a mathematical expression as input, and output the correct result in the correct base. The input will be n numbers separated by one or several operators (+ - ... |
Some friends and I have played some DSA (a mainly german tabletop RPG much like D&D). I was wondering what the chance on passing rolls are, so you will have to write some code to calculate it.
Your character is defined by stats (from 8 to 14) and (TV) Talent values (0 to 21). For now we will use climbing as an example.... |
Introduction
For the ones wondering what Befunge exactly is, it is a two-dimensional stack based language made in 1993 by Chris Pressy. I made 7 brain teasers that need to be solved in Befunge-93. This is quite an experimental challenge, but I thought it's worth a shot :). A full list of all commands used in Befunge-93... |
In this challenge, you will be "reversing" the alphabet or swapping a-z with z-a. This is commonly known as the Atbash cypher.
Because this transformation makes the output look like some foreign language, your code will need to be as short as possible.
Examples
abcdefghijklmnopqrstuvwxyz
zyxwvutsrqponmlkjihgfedcba
Pr... |
You are to write a sequence of 10 programs p1 p2 ... p10 that satisfy the following properties:
pK prints pK+1 for K from 1 to 9
p10 prints p10
When the first K programs are concatenated, the resulting program p1...pK prints p1...pK.
Each program pK must be larger in byte size than the previous program pK-1.
All progr... |
The challenge
Write a function or a program that takes a string composed of one or more subjective personal pronouns, separated by + signs, as an argument. The output must be a single pronoun, that is the result of the relation defined in the next paragraph.
Of course, feel free to edit as you wish to correct those gra... |
The challenge
Well, I think it is quite clear, isn't it? You have to make a function or a program that takes a string as an argument and outputs the corrispondent Yoda-speaking.
This is code-golf, so least number of bytes wins.
The input
The input could be any string without linefeed. You can translate a string if it i... |
Your code is going to generate a very simple ASCII-art representation of DNA, forever. It will take two numbers as input in any format you want: as a list, as arguments to a function, on stdin, etc.
A floating-point interval I in seconds between 0.0 and 1.0 (inclusive)
A zoom level Z as an integer from 1 to 64 (inclus... |
Given an input of a Spanish verb in its infinitive form, output the verb
conjugated in all 6 forms of the indicative imperfect.
To conjugate an infinitive in the imperfect, remove the infinitive ending (-ar,
-er, -ir, and sometimes -ír) and add the imperfect endings listed below. There
are three irregular verbs in the ... |
Consider a sequence based on recurrence relations, f(n) = f(n-1)+f(n-2), starting with f(1) = x1, f(2) = x2. For x1 = 2, x2 = 1, the sequence begins like this:
2 1 3 4 7 11 18 29 47 76 123 199 322 521 843
Concatenating this into a string will give:
213471118294776123199322521843
Now, divide this list i... |
You must make the shortest program to always find the optimal solution to a simplified Frogger game on a 9x9 grid.
Course Elements:
L - Log (Length: 3-4). When you hop on a log, it carries you with it.
V - Vehicle (Length: 1-2)
Speed (1-2): On the left hand side of the row will be the speed that elements in the row... |
Inspired by this SciFi.SE question.
Background (with minor spoiler):
In the movie The Martian, protagonist Mark Watney uses an ASCII table to look up hexadecimal values of ASCII characters so he can attempt to communicate back to Earth.*
Challenge
With no input, output the following ASCII table exactly like this:
D... |
You have been chosen to make a program that creates some pretty ASCII bar charts. Here is the input format:
[List of words (they can have spaces)] [an integer >= 0]
Bar 3
This is so cool 4
IDK-Why 6
The input will have multiple lines in this format, each one representing one bar in the graph. The output format of a gr... |
This challenge was xnor's idea, taken from Digital Trauma's challenge donation thread.
Your challenge is to write a program that, as xnor put it, "procedurally generate[s] the splotchy black-and-white marbled pattern on the covers of composition notebooks":
Your program can either display it on the screen or save it ... |
Inspired by this excellent challenge (from which the bulk of this text is blatantly duct-taped) – and my highschool philosophy project...
I define the following operators:
Fuzzy Conjunction a ×F b is a × b
Fuzzy Division a ÷F b is a ÷ b
Fuzzy Negation –F b is 1 – b
Fuzzy Disjunction a +F b is –F ((–F a) ×S (–F b) which... |
There exists a brain game called Enumerate (which I made, based on Takuzu). Your challenge is to play this game.
Task
Solve a game of 4x4 Enumerate/Takuzu.
Receive a starting grid via STDIN or command line.
Output the solved grid via STDOUT or writing to file.
Rules
A game is characterized by a 4x4 board, made up o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.