instruction stringlengths 34 53.1k |
|---|
This is code golf. Fewest bytes wins, only standard libraries, etc.
Write code, in any language, to output all possible same-length permutations of all items of an array / list / object in the input format and any order, grouped in whatever way you like. The items can be of ANY type, as allowed by the programming langu... |
This challenge is a tribute to our Legendary Challenge Writer™,
Calvin's Hobbies — now renamed to Helka Homba —, in the same spirit as
Generate Dennis Numbers.
Calvin is a pretty impressive contributor to PPCG, with the 6th most reputation
overall and probably indisputibly the best challenge writing skills out of all
o... |
In the esoteric programming language Curly, programs consist solely of curly braces {} and semicolons ;. Despite this humble toolset, Curly has literals that can represent any nonnegative integer. The format is a little hard for the uninitiated to read, though, so let's write some code to do the conversion for us.
Form... |
INTERCAL is a wonderful language, but it is not always easy to understand other people's code. This is particularly the case if they use the COME FROM statement.
Challenge definition
Write a program or function which take the source code of an INTERCAL program as a text/data stream. If you write a function it is reco... |
Whilst trying to golf several of my answers, I've needed to write large integers in as few characters as possible.
Now I know the best way to do that: I'll be getting you to be writing this program.
The challenge
Write a program that when given a positive integer, outputs a program that prints it to stdout or equivale... |
Challenge
Write a program that reorders the ASCII characters!
It should output a single string containing all of the printable ASCII characters exactly once. The first character of this string is assigned the value 1, the second character the value 2, and so on.
If two characters are normally next to each other (the di... |
Mayan pyramids were (and are) an important part of ancient architecture, that were generally used for religious purposes.
They were usually step pyramids, but the steps on each were too steep to climb. Priests would climb to the tops of them via alternative staircases to perform ceremonies. The pyramids were also used ... |
Where is the Arrow Pointing?
In this challenge, your goal is to follow an arrow and output the character it is pointing to.
Examples
Input:
d S------+ b
|
|
c +--->a
Output: a
Input:
S-----+---a->c
|
V
b
Output: b
The arrow is not point... |
Introduction
Classes have started! And so does the boredom. I decided to doodle in my notebook and started to draw some dots in (IMO) an aesthetically pleasing way. I came up with these numbers:
based on these conditions:
Given (n, m)
1) There must be n dots
2) All dots must lie on an m by m lattice
3) The positio... |
My high school, and many others implement a type of schedule called a Rotating Block Schedule. This is a way for people to have 8 classes, but on have 6 periods in a school day.
There are four days in a block schedule that repeat over and over, and have nothing to do with the actual days of the week. Each are assigned ... |
The hamburger joint maHburger has hired you to write a program for them.
It is simple: make an ASCII hamburger, using the key. Sounds simple right? Well these customers are super picky, but one thing is for sure, they do love onions.
Write a program that accepts the customer's orders, and prints a hamburger with as man... |
Fed up with the reliability of flash storage, you decided to store all your programs on one of those good old 1,440 KiB floppies. However, after copying not even 3,000 programs, the disk was full. How's that even possible? Skilled in the art of code golf as you are, most of your programs aren't even 100 bytes long, so ... |
Write a program that goes through a string of non-whitespace characters (you may assume that they are digits 0 to 9, but nothing in the way they are to be processed depends on this) and adds spaces according to the following rules.
Let the current token be the empty string, and the previously emitted tokens be an empt... |
Loves me, Loves me not
This simple kids' game is old, but still popular. Since we are living in 21st century now, let's digitize it!
Specification
Program must take no input, unless you are using a language that can't generate random seed - in that case you are allowed to take the seed as an input. Your task is to writ... |
Background
LISP programmers have taken over the world!
Parentheses have been declared as sacred characters, and from now on, they can only be used in LISP programs.
It has been decided that parentheses in literary works shall be replaced by footnotes, and it's your job to automate this for simplified Markdown text.
Inp... |
Introduction
Today is my birthday,
Yes my parents spend a lot time at home during the cold December holidays as many others.
So I also want my cake.
But I have a problem: I just sent the invitations today so I'm not sure how many friends will come. Also I don't want to order a big cake because I have been on a diet si... |
This is my first challenge!
Background
Perfect number is a positive integer, that is equal to the sum of all its divisors, except itself.
So 6 is perfect number, since 1 + 2 + 3 = 6.
On the other hand 12 is not, because 1 + 2 + 3 + 4 + 6 = 16 != 12.
Task
Your task is simple, write a program, which will, for given n, pr... |
Some numbers like 64 can be expressed as a whole-number power in multiple ways:
64 ^ 1
8 ^ 2
4 ^ 3
2 ^ 6
Output a sorted array of all possible such powers (here, [1,2,3,6]) in as few bytes as possible.
Input
A positive whole number that's greater than 1 and less than 10000.
Output
An array of whole-number powers... |
This challenge is inspired by a SO question about traversing a matrix by enumerating all its diagonal strips.
Instead of a matrix, consider a block of text:
ABCD
EFGH
IJKL
Traversing this block's SW-NE diagonals from left to right, starting from the top left corner and ending in the bottom right, results in the follow... |
This is my first question, so I hope it goes well.
Background:
It's not the rivers that you might be thinking about. The question revolves around the concept of digital rivers. A digital river is a sequence of numbers where the number following n is n plus the sum of its digits.
Explanation:
12345 is followed by 12360 ... |
Tony Stark is, as we know Ironman (that super awesome guy in metal suit and loads of weapons). However, without the metal suit, he can't claim that title. Tony Stark, having a great ego, wants to finish Norseman, which is considered to be the hardest triathlon in the world (for distances equivalent to those of an Ironm... |
Background
In some possible futures, the world will convert their numerical systems from decimal (base 10 or b10) to some other base (binary b2, octal b8, hexadecimal b16, or even unary b1, in which case we're screwed!). Thus, in preparation for this possible world-changing event, you decide to base-proof all of your p... |
It's back to school season! So for a part-time job, you're helping out at the school's library. The problem is, the head librarian has never even heard the words "Dewey Decimal," let alone implemented that system. Instead, the sorting system in use has grown "organically" as the library has expanded...
In an effort to ... |
The idea here is to produce an almost repeating pattern. That is, the sequence being constructed changes at the last moment to avoid a repetition of some subsequence. Subsequences of the type AA and ABA are to be avoided (where B is no longer than A).
Examples:
I'll go ahead and start by listing all of the small exampl... |
There exists a very simple cipher that replaces a letter with it's position in the alphabet. For example, abc would become 1 2 3 in this cipher.
This challenge is an alternative take on this cipher.
The Challenge
Create a program that takes an input of ASCII characters, and outputs a space-separated string of:
intege... |
Write a program that tests if a number n is prime by checking that none of the integers between 2 and n-1 (inclusive) divide n (you must use this algorithm!). The input to STDIN should be an integer n (strictly) greater than 1. The output to STDOUT should be prime if n is prime and not prime if n is not prime.
Even tho... |
In modern day standards Golfing translates to playing a game of golf, while golf itself translates to a car manufactured by Volkswagen.
So instead of the usual golfing of code, you will today be coding a golf.
Challenge
Write a program (A) in language A which will output the source code of another program (B) of lang... |
You live inside a terminal that is 80 characters wide. You are bored, so you decide to play dominoes. No, not the boring kind that look like Scrabble, the fun kind where you spend an hour setting them to watch them fall in a second.
In terminals, dominoes look like this:
| upright domino
\ left-tilted domino
/ ri... |
The Challenge
Create a function that, when given an input of ASCII art (directing a path that may eventually loop), outputs the length of the loop (if there is one) and the length of the "tail" leading into the loop in one of the forms below.
Input
Your input must be passed to a function. Below is an example of a simp... |
Most of us LOST fans out there remember the computer that Desmond had to type the characters "4 8 15 16 23 42" in every 108 minutes or the world would end (or would it?).
The challenge here is to create a program that would do the same thing by requiring that every 108 seconds the input 4 8 15 16 23 42 is entered or it... |
Write two triangle (i.e. pyramid) shaped programs.
The first one should be an upwards pointing text triangle with a minimum base width of three characters. So it would have a structure like
X
XXX
or
X
XXX
XXXXX
or
X
XXX
XXXXX
XXXXXXX
or larger. Each of the X's is to be replaced with the characters of your ... |
If you remember back to your schooling years, you might remember learning about Truth Tables. They seemed boring, but they are basis for logic and (some would argue) all computing...
Problem
Your mission, should you choose to accept it is to write a program, function, or widget of code that can output a truth table gi... |
Background
Person of Interest is a crime drama on CBS, and my favorite TV show, as of late.
The show is about a man named Harold Finch, a billionaire programmer, and his partner John Reese, a special forces veteran and ex-CIA operative. This programmer created a sentient AI called "The Machine" that predicts violent cr... |
The Rugby World Cup starts in a few hours!
Write a program or function which, given a rugby team score as input, outputs all possible ways the score could have been attained in a Rugby game.
Ways to score in Rugby
Penalty kick/Drop kick: Both penalty kicks and a drop kicks are worth 3 points (We regroup them in this c... |
Computers live by binary. All programmers know binary.
But the 2**x bases are often neglected as non-practical, while they have beautiful relations to binary.
To show you one example of such a beatiful relation, 19 will be my testimonial.
19 10011 103 23 13 j
19 is decimal, included for clarity.
10011 is 19 in binary... |
Introduction
Don't you hate it when someone uploads an album you like to YouTube, but the description only contains a track listing? Like this:
1. Everything in Its Right Place - 4:11
2. Kid A - 4:44
3. The National Anthem - 5:50
4. How to Disappear Completely - 5:55
5. Treefingers - 3:42
6. Optimistic - 5:16
7. In Lim... |
Given any unsigned 16 bit integer, convert its decimal form (i.e., base-10) number into a 4x4 ASCII grid of its bits, with the most-significant bit (MSB) at the top left, least-significant bit (LSB) at bottom right, read across and then down (like English text).
Examples
Input: 4242
+---+---+---+---+
| | | | # |
... |
Cluck cluck. No one knows why the chicken crossed the road, maybe there was a good looking rooster on the other side. But we can figure out how. Write a program, that, left to right, crosses this (or any) "road".
1356 | 1738
3822 | 1424
3527 3718
9809 | 5926
0261 | 1947
7188 4717
6624 | 9836
4055 | 9164
2636 4927... |
Some trading cards have real value and can be sold for money. Bending the cards is frowned upon because it takes away their value and makes them look less new. Say you have a deck of trading cards (Pokemon, Magic, etc.) and you want to shuffle them. Instead of doing the bridge that bends all of the cards, another simpl... |
Introduction
Everyone's heard of sine (sin), cosine (cos), tangent (tan), cotangent (cot), secant (sec), and cosecant (csc). Nearly every angle has them.
Far less known, or remembered, are the exsecant (exsec), excosecant (excsc), versine (versin), and coversine (cvs). Nearly every angle has those as well. There are s... |
You should write a program or function which receives a string representing an ASCII art as input and outputs or returns the number of endpoints in the input.
The input will consist of the characters space - | + (with 0, 2, 2 and 4 endpoints respectively) and linebreaks. E.g.:
-|++-
+
Two adjacent characters are con... |
Blackbeard was an English pirate of the early 18th century. Although he was known for looting and taking ships, he commanded his vessels with the permission of their crews. There are no accounts of him ever harming or murdering his captives.
This challenge is in honor of the infamous Blackbeard and inspired by Internat... |
I am a teacher who was given a problem a few years ago. Every year since I have given it to my advanced students as a bonus assignment, but in ~10 years only 8 solved it, each with a slightly different approach. The problem is as follows:
You have some input (from stdin), in the following format (the //comments are not... |
The Challenge
Write a program that can calculate how many times and how long a ball will bounce based on a few input variables.
Input
There are three variables that will be passed. You can accept these however you like (user input, function call, etc). The variables are as follows:
height
velocity
"bounciness"
They ... |
Consider taking some non-negative integer such as 8675309 and computing the absolute values of the differences between all the pairs of neighboring digits.
For \$8675309\$ we get \$|8-6| = 2\$, \$|6-7| = 1\$, \$|7-5| = 2\$, \$|5-3| = 2\$, \$|3-0| = 3\$, \$|0-9| = 9\$. Stringing these results together yields another, sm... |
Bob the Bowman
o
/( )\ This is Bob.
L L Bob wants to be an archer.
#############
.
/ \ <--- bow So he bought himself a
(c -)-> <--- arrow nic... |
Holy wars have been fought over spaces vs. tabs. (And of course spaces, being
objectively superior, won.) —Alex A.
Some people still refuse to accept that
which is clearly supreme. You've just received
a file using the incorrect, bad, and inferior form
of whitespace, and now the contents of the file are
tainted and... |
Say that you have a string like this:
abaabbbbbaabba
Count the number of times that a specified character appears in the input string, but only if the character appears only once in a row. For example, if the character is a,
abaabbbbbaabba
^ x x ^
The total would be 2 (the aa's wouldn't count because the a app... |
Write a program that converts a mathematical expression to words, evaluates the expression, and prints how the equation would be spoken aloud.
Input
The input must only contain numbers and the symbols +, -, *, and /. There cannot be any whitespace in the input.
The input does not say what the expression is equal to.
... |
I'm sure you know about the $9.99 price scheme, instead of using $10. Well, in your new job as a sys admin at a large retail store, they want prices to adhere to a similar scheme:
All prices are in whole dollars, no cents.
All prices should end with 5 or 9, rounding to the closest but up if the last digit is right bet... |
Groups
In abstract algebra, a group is a tuple \$(G,\ast)\$, where \$G\$ is a set and \$\ast\$ is a function \$G\times G\rightarrow G\$ such that the following holds:
For all \$x, y, z\$ in \$G\$, \$(x\ast y)\ast z=x\ast(y\ast z)\$.
There exists an element \$e\$ in \$G\$ such that for all \$x\$ in \$G\$, \$x\ast e=x\... |
Monday Mini-Golf: A series of short code-golf challenges, posted (hopefully!) every Monday.
A Fibonacci-like sequence is obtained using the same method as the famous Fibonacci sequence; that is, each number F(n) is found by adding the previous two numbers in the sequence (F(n) = F(n-1) + F(n-2)), or by subtracting the ... |
Here is your task, should you choose to accept it: Output (through STDOUT, or whatever is most convenient) some n by m ASCII art that has at least one line of symmetry and is non-empty. Example:
HiiH
iooi
iooi
H!!H
This is a 4x4 example output.
(Note: I define an ASCII character to be in the ASCII range 32-126 plus ne... |
I need a UUID. Your job is to generate one.
The canonical UUID (Universally Unique IDentifier) is a 32 digit hexadecimal number with hyphens inserted in certain points.The program should output 32 hex digits (128 bits), in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (8-4-4-4-12 digits), where x is a random hexadec... |
Write a program or function that takes in two positive integers, a width and a height, and draws an ASCII art houndstooth grid pattern with those dimensions using this 25×26 text grid as the base cell:
.......#.....#####.......
.......##.....#####......
.......###.....#####.....
.......####.....####.....
.......#####..... |
Welcome Back to the Future's fans and enthusiastic codegolfers.
Let's begin with this simple statement : Marty arrives in 2015 in one month (On october the 21st !). Therefore I propose we use the time remaining to pay him and the saga the best homage we can.
Task
Marty left for 2015 on October the 26, 1985. Thus, you ... |
The Challenge
Write a program that can break down an input chemical formula (see below), and output its respective atoms in the form element: atom-count.
Input
Sample input:
H2O
Your input will always contain at least one element, but no more than ten. Your program should accept inputs that contain parentheses, which... |
We all have knowledge of the periodic table, since our days in school.
Something most of us have often tried to do is to spell out your name using elements of the table.
Your challenge is to do exactly this.
You will be given a string to STDIN or equivalent, and you will need to output the formula corresponding to the ... |
Currently, the Stack Exchange network has nearly 150 sites. These sites are as follows:
Computer Graphics
Portuguese Language
elementary OS
Open Source
Law
Русский язык
Mythology
Health
Stack Overflow на русском
CiviCRM
Woodworking
Music Fans
Vi and Vim
Coffee
Engineering
Lifehacks
Economics
History of Science and Math... |
The Challenge
Write a program that can take an input of a single-line string containing any ASCII printable characters, and output the same string encoded in Base85 (using a big-endian convention). You can assume that the input will always be ≤ 100 characters.
A Guide to Base85
Four octets are encoded into (usually) ... |
Some time ago, the following question was asked: GolfScript, CJam, or Pyth?
Based on the title only, I thought that it would be a very nice challenge, but unfortunately, it turned out to be a question asking for tips.
Here is the challenge I wanted to read:
Who said golfing languages were not used in the Real World?
... |
Challenge:
Create a program that compresses a semi-random string, and another program that decompresses it. The question is indeed quite similar to this one from 2012, but the answers will most likely be very different, and I would therefore claim that this is not a duplicate.
The functions should be tested on 3 cont... |
As we all know, the Zelda series are one of the best game series ever made. In honor of that, let us play some songs on the ocarina.
Challenge:
Write a program which, given a song, outputs the score to stdout for that particular song.
Input:
The song which you will have to output the score of will be given by a unique ... |
Overview
In this challenge, your task is to randomly generate a monotonic mathematical function between two sets.
Input
Your inputs are two positive integers s and n.
After getting these inputs, your program shall generate a random mathematical function f from the set {0,1,...,s-1}n to {0,1,...,s-1}.
In other words, f ... |
Your job is to take a string input and a number and align the string to the right, making the width of the text the number. When a line is too long, break it and put the rest on the next line, repeating until it's not necessary. If a line is shorter than the width, then pad it with spaces. Multiple newlines can occur, ... |
Write a program that outputs
Do not repeat yourself!
Your program code must respect the following constraints :
its length must be an even number
each character that is in position 2n (where n is an integer > 0) must be equal to the character in position 2n-1. The second character of the program is equal to the firs... |
Scores
This section will be filled in as submissions are entered.
Normal
1. bopjesvla Perl 54
2. edc65 Javascript (ES6) 91
3. name language score
4. name language score
5. name language score
Bonus Round
1. name language score
2. ... |
The Challenge
Write a program or function that takes two input integers, i and j, and outputs their greatest common divisor; calculated by using the Euclidean algorithm (see below).
Input
Input may be taken as a space-delimited string representation of i and j or as two separate integers. You can assume that integers ... |
Your company is just getting started on a project, and for the first time you decided to go use a functional programming code-style. However your boss is really diffident and doesn't want to use built-in functions, and requires you to implement yourself the main functions. In particular you need to write the functions:... |
(First challenge, please let me know if there are any problems with it.)
A heterogram is a word where no letter of the alphabet occurs more than once, and a palindrome is a phrase that is the same backwards and forwards.
The challenge here is to write a piece of code that takes in a word (just letters) as input, and o... |
The goal of this challenge is to write a program that visualizes a dependency graph in the form of a tree.
While "dependency graph" in this context means nothing more than a directed graph, the visualization method described here works best for graphs describing some dependency relation (as an exercise, after you've re... |
The Challenge
Create a program or function that takes no input, and outputs (or returns):
I'm a programming paradox — no I'm not.
Without using a character twice in any string, or digit twice in any integer.
Rules
You may not use any character twice within a string. For example, the word "test" would violate this ru... |
Introduction
In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other catalogue challenges, there is "Hello World!" and "Is this number a prime?".
Challenge
Write a program that prints the decimal ... |
Confidant Numbers
Let x be an integer of an arbitrary base, such that D is an array of its digits. x is a Confidant Number if, for all n between 1 and the length of D:
D[n+1] = D[n] + D[n-1] + ... + D[1] + n
Take, for example, the number 349 in base 10. If we label the indices for this number, we have the following.
... |
The famous C64 basic one liner
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
prints a maze of slashes and backslashes.
\\/\\\//\/\////\\/\/
\/\///\\///////\//\/
/\\\//\//\////\\//\\
\////\//\//\/\\\\\\/
/\/\\///\\\\/\\\\/\\
\/\//\\\\\\//\/\////
/\//\\///\/\///\////
\/\\\//\\/\\\//\\/\/
//////\\/\\/\/\/\///
\\/\/\\////\/\/\\/... |
Create a program that does the same thing forwards and backwards, in different languages. “Different languages” does not include different versions of the same language.
Challenge
This program can take any input and write anything to stdout and stderr.
However, the program must output exactly the same things for the sa... |
Prime numbers have always fascinated people. 2300 years ago Euclid wrote in his "Elements"
A prime number is that which is measured by a unit alone.
which means that a prime is only divisible by 1 (or by itself).
People have always looked for relations between prime numbers, and have come up with some pretty weird (a... |
Being short of cash, you have signed up to build donuts for The Doughnut Shop™, the biggest digital doughnut company in the world, mostly because they sell every size of doughnut imaginable.
Now, given that trading standards nowadays is very tough, you need to write a piece of code as short as possible to create these ... |
You've just been hired by a German car manufacturing company. Your first task, as an engineer, is to write a program that computes the ecological footprint of ASCII strings.
The ecological footprint of character is computed as follows:
Write the character's ASCII code in binary, and count the number of 1's.
For examp... |
Introduction
Remember the roaring 80's? I mean, you know, like 30 years ago? No cell phones, no internet, no ATM's, fluorescent clothing (what was that?!) and scrolling marqee's! No, no, no! Not the online ones, but real ones, With LED lights.
Since I'm in a nostalgic mood, I'd like you to create a scrolling marquee.
... |
Bonjour, PPCG ! Quelle heure est-il ? This means what time is it in French, for that is exactly what this challenge is about.
Telling time in French (at least formally) is a bit different from telling time in English. Telling the time starts out with Il est (It is). Then, you put the hour followed by heures (o'clock). ... |
Input will consist of the following characters:
^: Go up one
v: Go down one
▲ or k: Go up two
▼ or j: Go down two
For example, the following input:
^^▲^v▼▲^^v
would produce the following output:
^
^ ^ v
▲ v ▲
^ ▼
^
Escape sequences that move the cursor such as \e[B are not allowed. You must produ... |
Introduction
We all love StackExchange, therefore it would be essential to download all gems hidden on Stack Overflow repositories in the simplest possible way.
Challenge/Task
Your task is to write a script or program which would:
Fetch the list of all (within current page) repositories under Stack Overflow GitHub acc... |
Congratulations! You've just been hired by NASA to work on the new Horizons 2 project.
Sadly, there have been huge budget cuts recently, so the top management has decided to fake the whole planned Pluto flyby (as they did for the moon landings in the 70s).
Your task is to write a program that will accept as input a dat... |
This challenge is a slightly different kind of Code Golf challenge. Rather than coding to match IO, you code to match an interface.
Background
Finite state machines are very useful design models for modeling event-based programming. A state machine is defined by a set of states and tranitions between them. The machine ... |
Given a dictionary file (a text file containing a word or phrase on each line, with possible punctuation but no numbers; lines are alphabetized), you must output each combination of words where one letter can be removed from a word to make another; the removed letter should be encased in parentheses.
For example, the i... |
The shortest reliable password testing code
Introduction
I started playing Empire of Code recently, and there was some challenge. The player is supposed to write a piece of Python or Javascript code to detect if the string passed to it is reliable password, that is, it contains at least one lowercase Latin letter, one ... |
In Lisp style languages, a list is usually defined like this:
(list 1 2 3)
For the purposes of this challenge, all lists will only contain positive integers or other lists. We will also leave out the list keyword at the start, so the list will now look like this:
(1 2 3)
We can get the first element of a list by usin... |
One of the reasons I've always loved Pokemon is because for such a simple-seeming game, it has so many layers of complexity. Let's consider the move Hidden Power. In game, the type and power (at least before Generation VI) of Hidden Power is different for every Pokemon that uses it! That's pretty cool, right? Now, woul... |
(Previously on "Print the __ without using __" ... this one and this one)
The game of Hearts has a popular scoring variant called "Shooting the Moon," whereby instead of trying to not acquire penalty cards (and thus penalty points), as is the usual gameplay strategy, if you acquire all of the penalty cards you actually... |
We all know that if you google the word "google" it will break the internet.
Your task is to create a function that accepts one string and returns its length, in the fewest possible Unicode characters.
However, if the given string is google (lowercase), it will cause an error.
For example, g('bing') will return 4 but g... |
Inspired by a chat conversation I lurked.
I am an adventurer on the far away land of Zendikar. I truly enjoy traveling the land. Bushwhacking, weathering the roil and encountering strange and exotic flora and fauna are the highlights of any good adventure. Unfortunately, my duties as an adventurer do not always allow m... |
Monday Mini-Golf: A series of short code-golf challenges, posted (hopefully!) every Monday.
Many web applications (especially social media) automatically truncate long passages of text so they fit within the app's formatting. In this challenge, we're going to create an algorithm to automatically trim a passage of text ... |
A while ago, we had a challenge related to antiferromagnetism (AF) in two dimensions. Now, on a 2-d square lattice, antiferromagnetic is antiferromagnetic, and that is all there is to it. Moving to other lattice types or higher dimensionality, things get more interesting. Here, we will explore the second route: mag... |
Challenge
Write a program/function that accepts an "image" and outputs a picture maze formed from that image.
Input
Your program should accept two arguments:
I, the image to form the maze from
S, a boolean specifying whether or not to display the solution to the maze
I is given in the following form:
.......
.#####.
... |
Write a program in a language with name A that, given a string S, outputs the name of a different programming language B. The length of B must be equal to the Levenshtein distance (abbr. "LD") between A and S. To be considered a programming language, B must have an esolangs page or a Wikipedia page.
Example:
(Suppose t... |
Minesweeper is a popular computer game that you have probably wasted time playing where you try to reveal the cells that are mines in a rectangular grid based on hints of how many neighboring mines each non-mine cell has. And in case you haven't played it, do so here.
A nifty mathematical fact about a Minesweeper grid ... |
Monday numbers, as defined by Gamow in this question over on Puzzling, are positive integers N with the following three properties:
The decimal representation of N does not contain the digit 0
The decimal representation of N does not contain any digit twice
N is divisible by every digit D that occurs in its decimal re... |
A kitten is much like a cat. Some of the main differences are cuteness, lack of intelligence, and size. Similarly, the cat command is different from the kitten command. Fortunately, there is only one difference in this case. In the kitten command, all uppercase letters are replaced with lowercase letters.
Objective
To... |
The Banach–Tarski paradox states that, given a ball in 3‑dimensional space, you can decompose the ball into a finite number of point subsets. These disjoint sets of points can then be reassembled to produce two copies of the initial ball. You would then, theoretically, have two identical balls.
The process of reassembl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.