instruction stringlengths 34 53.1k |
|---|
Define that the natural number p is a +1 prime of the natural number n if p is a prime number and the standard binary representation (i.e., without leading zeroes) of p can be obtained by adding (i.e., prepending, appending or inserting) a single 1 to the standard binary representation of n.
For example, the binary rep... |
Who doesn't absolutely love permutations, right? I know, they are amazing––so much fun!
Well, why not take this fun and make it funner?
Here's the challenge:
Given an input in the exact form: nPr, where n is the pool taken from and r is the number of selections from that pool (and n and r are integers), output/return t... |
You saved the day with your prime sequence code, and the math teacher loved it. So much so that a new challenge was posed to the librarian (a/k/a, your boss). Congratulations, you get to code the solution so the librarian can once again impress the math teacher.
Start with the sequence of natural numbers in base-10, \$... |
Pick six cities or villages, one from each of the populated continents, Asia, Africa, North America, South America, Europe and Australia. The forecasts cover 8351174 places, more than 2 million in the US, 150000 in Pakistan, 10000 in Uganda, and 16 places in the Shefa province in Vanuatu, so I think you'll find a place... |
You have been employed by a data analysis company, and have been appointed the task of finding the average character of a string of characters. However, this company has limited funding for code storage, so your code must be as small as possible.
Task
Write a program or function that takes one string of characters as i... |
Your task is to give three different languages A, B, C, and write two different programs P and Q such that:
P is a quine in language A, but not a quine in B nor C;
Q is a quine in language B, but not a quine in A nor C; and
Q concatenated after P (without any new characters added in between) is a quine in language C... |
Across the alphabet
In this challenge, you have trouble remembering the letters of the alphabet. To circumvent this, you go up and down the alphabet, till you get to the letter.
Because you want your code to be portable, you'll be writing it with letter blocks. You have a limited amount of letter blocks because most o... |
These are raindrops:
! | . " :
These are clouds particles:
( ) _ @ $ &
I want you to verify, when given a block of text, whether or not it is raining. It is raining if, for every raindrop, there is a cloud particle somewhere above it. There must be one cloud particle for every raindrop. Output a truthy or falsy value... |
Write a program or function that:
takes in a string from stdio or arguments
replaces all occurrences of true with false and false with true
reverses it, but does not reverse true and false
returns or prints result
Examples (left side is input):
"true" "false"
"2false" "true2"
"tr... |
Lots of people like to play music for fun and entertainment. Unfortunately, music is pretty difficult sometimes. That is why you're here!
Task
It's your job to make reading music much easier for those struggling with it. You need to write a program or function that takes as input a musical staff, and outputs the names ... |
Write a program that accepts a single lowercase word as input and outputs the number of pairs of letters that have the same number of letters between them in the word as in the alphabet.
For example, in the word 'nature', we have 4 pairs:
nr: since there are three letters between them inside the word (a, t, u) and thr... |
In a steam-punk multidimensional world, our boss wants to affix printed index labels to each drawer in our conglomerate's multidimensional file cabinet.
The boss wants to typeset the entire label sheet as a single form, using a font bought only for this purpose, so we have to order the sorts (metal symbol pieces). Sinc... |
Anyone remember these things?
Your challenge today is to make the shortest program that involves your pet growing into 1 of at least 7 different creatures.
Your creature will grow into different forms depending on a random percentage from an RNG and the name you give it (from STDIN or equivalent for your language) a... |
Blade is a PHP templating engine. For this challenge, you only need to implement a modified version one feature -- text replacement.
Challenge Description
Given an input file and a map of keys to their replacements, write an interpreter that reads through the file to find double open braces ({{) followed by a key, foll... |
Write a program or function that takes in a string only containing the characters ^ and v (you can assume there will be no other characters). Read from left to right this string represents the sequence of mouse clicks a single user made while viewing a Stack Exchange question or answer for the first time.
Every ^ repre... |
You're playing TF2, and you want to make a bot that will just put voice commands into the chat box. Typically, to "call" a voice command, one would press a key (Z, X, or C) and a number (1-8) to create an audio dialogue. Here are the text equivalents of the audios displayed when pressing these keys:
Voice Menu 1
Defaul... |
Write the shortest program that takes one input (n) from STDIN (or equivalent) and outputs a simple incrementing function with one argument (x) that returns x + n but the function must be in a different language. Pretty simple!
This is code-golf, normal rules apply, shortest program wins.
Example: ><> to Python (Ungolf... |
Let's define a pristine program as a program that does not have any errors itself but will error if you modify it by removing any contiguous substring of \$N\$ characters, where \$1 \le N < \text{program length}\$.
For example, the three character Python 2 program
`8`
is a pristine program (thanks, Sp) because all the... |
Fibonacci + FizzBuzz = Fibo Nacci!
Your challenge is to create a Fibo Nacci program!
A Fibo Nacci program outputs the first 100 Fibonacci numbers (starting from 1).
If the Fibonacci number is divisible by both 2 and 3 (i.e. it is divisible by 6), then output FiboNacci instead of the number.
Otherwise, if the Fibonac... |
Executive summary
Given input k, find a partition of integers 1 to n into k sum-free subsets for the largest n you can within 10 minutes.
Background: Schur numbers
A set A is sum-free if its self-sum A + A = { x + y | x, y in A} has no elements in common with it.
For every positive integer k there is a largest integer ... |
Write a program or function that takes no input but prints or returns a constant textual depiction of a rectangle made of the 12 distinct pentominoes:
The rectangle may have any dimensions and be in any orientation, but all 12 pentominoes must be used exactly once, so it will have area 60. Each different pentomino mus... |
Your Task
Write a program using ASCII characters. Five alphanumeric (0-9, A-Z, a-z) characters will be inserted at random into your program's source code. Your task is to detect and output these characters inserted into your program.
Conditions
Your code cannot use any form of backup file.
Your code may produce any un... |
Introduction
In this challenge, your task is to write a program that decides whether two given trees are isomorphic.
A tree means a directed acyclic graph where every node has exactly one outgoing edge, except the root, which has none.
Two trees are isomorphic if one can be transformed into the other by renaming the no... |
In my Economics class, my friends and I like to come up with ways to rearrange the digits in the date (in MM/DD/YY) format to create a valid mathematical equation. For the most part, we are allowed to use addition, subtraction, multiplication, division, parentheses, and exponentiation in addition to concatenation.
Your... |
Calculate a product or ratio of SI units.
For example, kg m / s s (kilogram-meter per second squared) should return N (newton).
The input will always be either:
A list of symbols for SI units, space-separated (representing a product) or
The above, /, and the above (representing a ratio).
The input will never contain ... |
Challenge
Given a binary number as input through any means, "simplify" the number using a full program or a function.
Input
[binary]
binary is a number in binary that is over 0.
Output
Take the input, convert it to base 10 without using a builtin, then if that number contains only 1s and 0s, convert it into a base 1... |
Introduction
Write a complete program that rotates a rectangular block of ASCII characters 90 degrees clockwise. When the program itself is rotated 90 degrees clockwise, it rotates a block of ASCII characters 90 counterclockwise.
Rules
You many not use built-ins that rotate or transpose matrices. For example, in MATLA... |
You are given a partially filled Connect 4 grid (7x6).
O X
O X
X O X O O
X O X O X X
O X X X O O X
O O O X X O X
(Input can be given as a 1D or 2D array and as letters or numbers, etc.)
Assume that
X started the game.
Nobody has won yet.
Players may not have played well until now, but now... |
Given a positive integer k > 1 and a non-negative integer i, generate a k-tuple (or k-dimensional vector) of non-negative integers. For every k, the map from ℕ to ℕk, must be bijective. That is, every input i should produce a different tuple, and every possible tuple must be produced by some input i.
You may write a pr... |
Welcome to my first code-golf challenge! :) Let's hop right into it.
Challenge:
Given two floating point vectors, O (origin) and T (target), you have to create a program to print the values L and R to STDOUT.
O is one corner of the square
T is one corner of the square that is located opposite to O
L is the 2D point (c... |
Keep Talking and Nobody Explodes is a local multiplayer game where one player has control over a virtual "bomb", and has to be guided by another player, the "expert", who has access to a bomb defusal manual. One of the modules to be disarmed in the game is the keypad module, which is what we'll be dealing with in this ... |
Today, November 11, 2015, is Veterans Day in the United States. "Taps" is the bugle call played at U.S. military funerals:
("Taps" on SoundCloud from vtmiller)
It is a simple melody, only twenty-four notes long and using only four different notes. Here is the sheet music:
(source)
Challenge
Write a program or funct... |
Your task is to write a program that takes an input image and run it through edge-detection to become an output image.
The edge-detection works as follows (if unclear, see sobel edge detection):
The value for a pixel is the total brightness of a pixel, so if it is in color, you will need to convert it to grayscale fir... |
Calculate the p-adic norm of a rational number
Write a function or a program, that takes 3 integers m,n,p (where p is a positive prime) as input, that outputs the p-adic norm (denoted by |m/n|_p) as a (completely reduced) fraction. Fermat is known to have only very small margins, but what is rather unknown is that he o... |
The Task
I guess everybody loves automatic code generation and saving some time during work. You have to create a lot of classes and members during the day and you don't want to create all those getters manually.
The task is to write a program or function, that generates getters for all class members automatically for ... |
The task
In this challenge, your task is to write three programs that form a kind of mutual quine-like system.
Let's call the programs A, B and C.
If one of the programs is given the source of another program as input, it shall output the source of the third program.
For example, if A is given B as input, it outputs C.... |
You must use one language to write programs that perform the following nine tasks, in any order you want.
Convert an inputted number from base 10 to base 36.
Sample input: 1000
Sample output: RS (output must be upper case)
Convert each character in a string to its base 10 decimal ASCII codes and print the codes con... |
You sit at home, rubbing your hands in a most evil fashion. This time, I'll be able to set the community A-SPIN! I'll merely claim that I have proven this problem (which is of no doubt improvable) inside this book here… You open to the first relevant page. You scrawl those words…
You are, of course, the evil Fermat! Ha... |
I was recently adding up the ages of myself and my wife and kids and realised that at some point in the not-too-distant future our ages will all add up to exactly 100 years.
Challenge
For an input consisting of a combined (total) age and a list of birth dates, output the date on which the combined ages all add up to th... |
Background
It's late Friday afternoon and you and your friends decide to hit the pub later that evening, but before going to the pub you figure you should have a few beverages.
However, things escalate quickly; your friend Shaddock Pamplemousse won the lottery earlier this week and decided to bring crates upon crates w... |
No, I don't mean \$\phi = 1.618...\$ and \$π = 3.14159...\$. I mean the functions.
\$\phi(x)\$ is the number of integers less than or equal to \$x\$ that are relatively prime to \$x\$.
\$π(x)\$ is the number of primes less than or equal to \$x\$.
Let's say that "not pi" is then \$\bar{\pi}(x)\$ and define it to be the... |
Binary search is an algorithm that looks for an element in a sorted data-structure by constantly dividing the search space in half.
Rosetta Code
A binary search divides a range of values into halves, and continues to narrow down the field of search until the unknown value is found. It is the classic example of a "divi... |
First post here! I recently participated in a small friendly competition and this was one of the questions:
A positive integer whose only prime factors are 2, 3, 5 or 7 is called a humble number.
The first 20 humble numbers are:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27
Write a program of... |
Background
In most reasonable programming languages, it's very easy to rotate the rows or columns of a 2D array.
In this challenge, your task is to rotate the anti-diagonals instead.
Recall that the anti-diagonals of a 2D array are its 1D slices taken in the northeast direction ↗.
Input
A non-empty rectangular 2D array... |
Premise
One night, I was just contemplating on numbers. I found out about something unique about numbers like 7, 10, 12, 13, and more. They are squares of squares! Meaning, that when squared, are comprised of squares themselves. The OEIS calls them Squares which are a decimal concatenation of two or more squares.
Exam... |
Your challenge is to write a program that outputs the color of a given square from the chessboard. This is how a chessboard looks:
You can see that the square a1 is dark, and h1 is a light square. Your program needs to output dark or light, when given a square. Some examples:
STDIN: b1
STDOUT: light
STDIN: g6
STDOU... |
Write a program that counts up forever, starting from one.
Rules:
Your program must log to STDOUT or an acceptable alternative, if STDOUT is not available.
Your program must be a full, runnable program, and not a function or snippet.
Your program must output each number with a separating character in between (a newlin... |
Spherical excess of a triangle
As we all know, the sum of angles of any planar triangle is equal to 180 degrees.
However, for a spherical triangle, the sum of angles is always greater than 180 degrees. The difference between the sum of the spherical triangle angles and 180 degrees is called spherical excess . The task ... |
Given a real number t in (-10^9,13) (not including -10^9 or 13) as input, output Γ(t), also known as the Gamma function, which is defined as follows:
You may not use a built-in Gamma function to solve this task, nor may you use built-in numeric or symbolic integration functions. Your output should be accurate to 6 sig... |
The Task
Write the shortest program, that accepts script in brainfuck from STDIN (or equivalent) and outputs to STDOUT (or equivalent) a program written in the SAME language you're using.
For example, if you write in Java, with the input
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<++++++++++++++... |
As someone who can't be bothered to look at their pentominos to see if it makes a rectangular shape, I've decided to make you write a program that does it.
Your task
Given some input split by newlines containing 12 unique characters, decide if it is a valid solution.
A valid solution MUST
Have 5 of each character (exc... |
I'm retiling my kitchen with different coloured tiles. In fact, it's going to have at least 2 colours - and 26 colours as a maximum.
But, I'm fussy. I want this wall to look random, but sometimes random isn't random enough.
So, when I lay out my tiles, I don't want to have any the same colour next to each other in the ... |
This is a rather simple challenge, but I couldn't find any question that was really similar to it. The challenge is to take a frequency in using STDIN or an equivalent, and then output a tone that matches that frequency, in Hz, for 5 seconds. For example
Input: 400
Output: (a tone of 400 Hz with a duration of 5 seconds... |
I came across SVGCaptcha, and immediately knew it was a bad idea.
I would like you to show just how bad an idea this is by extracting the validation code from the SVG images that code produces.
An example image looks like this:
Here is the source of the example image:
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE s... |
If you express some positive integer in binary with no leading zeros and replace every 1 with a ( and every 0 with a ), then will all the parentheses match?
In most cases they won't. For example, 9 is 1001 in binary, which becomes ())(, where only the first two parentheses match.
But sometimes they will match. For exam... |
Given a properly-parenthesized string as input, output a list of all nonempty substrings within matching parentheses (or outside of all parentheses), with nested parentheses removed. Each substring should be the sequence of characters in exactly the same matching parentheses. Substrings should be listed in order of dep... |
In this challenge, you need to parse morgue files from the roguelike game Dungeon Crawl Stone Soup and output it to STDOUT.
What are these morgue files??
When you die, a text file is generated with that character's data inside. You can see what equipment the character had, what happened during the last few turns, and h... |
The Task
You are to write some ASCII Art Text as seen from this website for generating ASCII art!
Rules
Input will only be alphabetical text and spaces, and will be input as a single line. It is also case-insensitive.
You needn't fix if the output text is longer than the terminal width. As long as it would be correct i... |
Time for a new typography challenge! It’s a common problem when copy-pasting between various document formats: hyphenation. While it reduces the raggedness of a left-aligned layout or evens spacing in a justified layout, it’s a complete pain when your PDF is not properly constructed and retains the hyphens in the layou... |
Write a program that fills in the paths of a grid of characters (ASCII 20-7E) according to the following rules.
The path is governed by eight directional characters: -, |, /, \, &, @, %, and *, as specified in the table below. The direction of the path will change when it reaches one of the eight above characters. Note... |
Starry is a funny esoteric programming language in which code consists only of +*.,`' where the actual command represented by each of those characters is determined by the number of spaces in front of it. That makes it tricky even to golf fixed-output challenges, because different commands can account for vastly differ... |
Your task is to write a program that, on input n, outputs the minimal expression of each number 1 through n in order. The shortest program in bytes wins.
A minimal expression combines 1's with addition and multiplication to result in the given number, using as few 1's as possible. For example, 23 is expressed as 23=((... |
Set Theoretic Arithmetic
Premise
There have been a couple challenges already that involve multiplying without the multiplication operator ( here and here ) and this challenge is in the same vein (most similar to the second link).
This challenge, unlike those previous, will use a set theoretic definition of the natural... |
Write a program or function that given some text, a number of columns, and the column width, formats the text into columns. This is plain text typography.
Rules
Input
The text will be a string of printable ASCII and may contain newlines and spaces (but not tabs).
The number of columns will be a positive integer.
The c... |
This serves as a catalog for tips related to golfing in Burlesque.
Burlesque is a lazy, esoteric programming language. It's mostly used on anarchy golf while popularity on Codegolf is not as high. However, this catalog is intended to be used by people golfing on anarchy golf as well.
Please only mention tricks and not... |
Objective Given an input of text that does not contain characters [ or ], perform the following actions:
For every instance of Amen with at least one capital letter (so all instances of Amen excluding amen), output that same Amen (retain capitalization).
For every instance of /all the people said[?: ]/i (that's a Regu... |
Your task is to compile regexes... by specifying a substitution for each character in a regex.
Regexes
The regexes support these
REGEX = (LITERAL REGEX / GROUP REGEX / STAR REGEX / ALTERNATIVE)
LITERAL = 1 / 0
GROUP = '(' REGEX ')'
STAR = (LITERAL / GROUP) '*'
ALTERNATIVE = '('REGEX ('|' REGEX)*'... |
I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in.
Input
Two dates, in any format. The second date will always be later than the first.
A list of chapter numbers. This c... |
I just had a lesson in school about alkanes and figured it would probably make for a great code golf challenge! Don't worry, it isn't as complicated as it may look!
A Quick Rehash
(Please Note: To keep this brief, not all information is 100% accurate.)
Alkanes are strings of carbon and hydrogen. Every carbon atom has 4... |
This is an Irregular Webcomic! themed task.*
Death is a rather extensive orginization, and, although Head Death has had no trouble telling his employees apart, certain other entities connected to the orginization have had trouble keeping track of them all.
Thus, your task here is to, given the title of one of the var... |
Well, turns out Doorknob's
username on GitHub, Reddit, and other sites is
KeyboardFire. That gives me an idea...
The task
You work at KeyboardFire Inc., a company that makes special keyboards. And, by
"special", I mean that, whenever you press a key, something in your house lights
on fire! With the new KeyboardFire Doo... |
There have been many other flag challenges posted but not one for the national flag of France. This week seems like an appropriate time.
Produce this flag in the fewest bytes possible:
The image must be in a ratio of 3:2, with size at least 78 pixels wide and 52 pixels tall.
Each stripe takes up one third of the widt... |
Write, in as few characters as possible, a program that takes zero or six command-line arguments
menorah
menorah YEAR MONTH DAY HOUR MINUTE SECOND
(Both forms must be supported. The zero-argument version shall be equivalent to calling the six-argument version with the current system date and time in the local timezon... |
Bounties
No. 1 (awarded)
I'll throw in 50 rep for the first valid answer
No. 2 (awarded)
I'll throw in another 100 rep for the shortest valid answer.
No. 3 (open for submissions)
I'll throw in 200 rep for the first one with a significant shorter valid answer.
Significant being at most 45% of currently shortest a... |
Write a program that outputs the lyrics to 99 Bottles of Beer, in as few bytes as possible.
Lyrics:
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles of beer on the wall.
98 bottles of beer on the wall, 98 bottles of beer.
Take one down and pass it around, 97 bottles of b... |
There are important differences between Python 2 and 3, so it's often useful to know which version of the interpreter is running your code. The straightforward method is something like this:
def get_python_version():
import sys
return sys.version_info.major
But you can exploit other differences to come up with... |
Given a string as input, output the US state whose capital it is if it is a state capital, the capital of the state if it is a state, or Arstotzka if it is neither.
Examples:
Austin -> Texas
Alaska -> Juneau
The Nineteenth Byte -> Arstotzka
All the capitals and their respective states:
Baton Rouge, Louisiana
Indianapo... |
My cell phone carrier charges a cent per character in a text! I need a program to shorten the words for me, while still being understandable. I will be texting this program to my friends, so it needs to be as short as possible.
Your program will take a String (a word is separated by a non-alphanumeric character) of wor... |
Write a program or function that takes in an odd positive integer N and a string of decimal digits (0123456789). The string represents a ten-state one-dimensional cellular automaton. Each digit occupies one cell and the update rule from one generation to the next is that every cell becomes the digit resulting from the ... |
There are n boxes, numbered 1-n. Each box is locked, such that it can be opened by only one corresponding type of key (also numbered 1-n). These keys are randomly scattered in the boxes (one box may have any number of keys, one key may have any number of duplicates), and then all boxes are shut. A treasure (numbered 0)... |
Inspired by this question:
Make a function (or a full program) that receives a list of numbers and outputs the list rearranged, so that even-indexed numbers appear first, and odd-indexed numbers follow. The values of the numbers themselves don't affect ordering - only their indices do. All indices are zero-based.
For e... |
New Bonus! (See below)
The cartography team of U.S. Republican presidential hopeful Ben Carson is having some trouble with their maps (image via Washington Post):
The problem is they don't have the Right Tool For The Job™. They need the most compact and reliable program possible, so they never have to worry about maki... |
Boustrophedon is a type of bi-directional text where successive lines alternate between reading left-to-right and right-to-left. Character direction was also mirrored with respect to reading direction. In reverse boustrophedon writing systems, characters were rotated 180 instead of mirrored.
Challenge
Write a program/f... |
Given an image that has only black and white pixels and an (x,y) location that's a white pixel, color the white pixels based on their minimal Manhattan distance from (x,y) in a path that only involves traversing other white pixels.
The hue of the colored pixels must be proportional to their distance from (x,y), so the ... |
Requirements
You need to make a smiley face go from smiling to frowning and back. There needs to the below faces in the code: Smiling, no expression, frowning, no expression, and then back to smiling. The new face needs to replace the old face flipbook style so that there's only one face on the screen at a time. There ... |
Statement
You are given a still of a series of balls falling in a 2D grid. This grid is surrounded by immutable and unbreakable walls so all the action is contained within them. Your task is to determine what the state of the scenario will be after gravity does all it's work.
Elements inside grid
- Floor, doesn't alt... |
Write a program or function that takes in a string of the characters -=o. where the -=o's and .'s always alternate, character to character. The string will have an odd length greater than one and always start and end in one of -=o.
Basically, the input will look like a line of emoticon faces that share eyes in various ... |
Introduction
BitShift is an esolang, created by me, to output strings. Sounds boring, is boring. However, the only instructions available to BitShift are 0 and 1. Therefore it can be challenging to golf in it. To make matters even more interesting, the language only supports 4 bitshifting instructions, a clear, a print... |
Introduction
One of the first things I learned in chemistry, was giving the formula for the combustion of alkanes. The most basic example was: 2CH4 + 4O2 -> 4H2O + 2CO2. Note that the equation could have been simplified by dividing every coefficient by 2, we would get CH4 + 2O2 -> 2H2O + CO2. To make things easier, we ... |
(massive thanks to El'endia Starman and Sp3000 for helping me design test cases for this!)
Given a positive integer n and a list of positive integer rotational periods for a number of clock hands (in seconds), output the smallest positive integer x where x seconds after starting the clock with all of the hands aligned,... |
Background
The Rearrangement Inequality is an inequality that is based on rearranging numbers. If I have two lists of numbers of the same length, x0, x1, x2...xn-1 and y0, y1, y2...yn-1 of the same length, where I am allowed to rearrange the numbers in the list, a way to maximize the sum x0y0+x1y1+x2y2+...+xn-1yn-1 is ... |
A man from the stars has come to Earth! Luckily the president of the United States, Donald Trump, has an infinity-sided die. Using this die, he can conjure up a number which you, the mayor of Podunk, must use to determine who should be sent to stop the invader! But be careful, you can only send a limited amount of byte... |
The popular webcomic Homestuck makes use of a programming language called ~ATH to destroy universes. While this code golf challenge is not to write a program to annihilate our existence, we will be destroying some more tame (albeit less interesting) entities: variables.
~ATH (pronounced "til death," notice how ~ath is... |
Take a look at this image. Specifically, at how the holes on the ends are arranged.
(Image source)
Notice how the pipes in this image are packed in a hexagonal pattern. It is known that in 2D, a hexagonal lattice is the densest packing of circles. In this challenge, we will be focusing on minimizing the perimeter of a... |
This is the cops' thread. For the robbers' thread, go here.
Introduction
For this Cops/Robbers challenge, the cops will write output-producing programs and interweave them together. It is the robber's job to pick apart the cops' programs to produce the desired outputs.
Cop rules
The cops may use up to 256 bytes total t... |
This is the robbers' thread. For the cops' thread, go here.
Introduction
For this Cops/Robbers challenge, the cops will write output-producing programs and interweave them together. It is the robber's job to pick apart the cops' programs to produce the desired outputs.
Robber rules
Robbers will try to find the differen... |
Given a list of strings, output a single string formed by taking a character from each string at each position, sorting them by ASCII ordinal, and appending them in order to the output string. In other words, for n input strings, the first n characters of the output will be the first characters of each of the inputs so... |
King Julian needs to get through the jungle, but he's feeling lazy. He wants a computer to be able to calculate a route through the jungle for him.
Using STDIN get a map of the jungle for the computer to crack. It will follow the following format:
01001E
010110
000P00
1100J1
S00111
The way the jungle map works is:
0 i... |
In the PPCG chatroom the Nineteenth Byte, using carets ^ (or carrots) is a way of indicating that you agree with one of the previously made comments just above yours.
A caret message consists solely of N ^ characters (where N is a positive integer) and it means agreement with the Nth previous message. So a single ^ mea... |
Recently, I have found a bijective mapping \$f\$ from positive integers to finite, nested sequences. The purpose of this challenge is to implement it in the language of your choice.
The Mapping
Consider a number \$n\$ with the factors \$2^{a_1}3^{a_2}5^{a_3}\cdots p^{a_i}\$ where \$a_i > 0\$
$$f(n) = \{f(a_2+1),f(a_3+1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.