instruction stringlengths 34 53.1k |
|---|
In 2015 the Portland International Airport began the replacement of their iconic carpet. I want you to write a program to draw their old carpet in as few bytes as possible.
The carpet:
Specifications
Here is a link to a scalable pdf image of one tile. Your output should match the relative dimensions and placement o... |
First puzzle from me, suggestions for improvement gladly received!
The scenario is;
You work as a manager for a whitewater rafting company. Every morning, you are given a list of bookings, and you have to sort them into raft loads. Write a program or function in your chosen language that does this for you.
Each raft ho... |
Mama Say Mama Sa Mama Coosa
I'm sure all of you have heard of Michael Jackson and some of you have listened to MJ's song "Wanna be starting something". The line "Mama Say Mama Sa Mama Coosa" is repeated throughout the song.
Specification
In this line, the word "Mama"occurs three times, "Say", "Sa", "Coosa" occurs once... |
On a recent episode of QI, the first 5 multiples of 142857 were described as anagrams of the original number. Of course, anyone with more than a passing knowledge of that number will know that those numbers are actually cyclic, not just anagrams. But that got me thinking.
Please write a program or function that outputs... |
Goal:
Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.
Example solutions (TI-Basic):
A+B+1
not(A+B)
Invalid solutions:
A+B-1 (for inputs 0,0, it returns -1, which is not natural)
"ABC" (ABC is not a number)
Notes:
The output... |
Animate the text in your terminal
The goal
The goal is to "animate" the string "Hello world" in your output so that each character gets capitalised after each other.
Your program can exit after each letter has been capitalised.
For example;
# Iteration 1
Hello world
# Iteration 2
hEllo world
# Iteration 3
heLlo worl... |
Your challenge is to draw/plot one of the hearts below. The size must be at least 50x50 pixels (vector graphics is OK). You may choose which of the hearts you want to draw/plot. Axes, grid lines etc. are accepted. There must be at least 100 distinct coordinates/points on the graph. The heart can be filled with color if... |
Here's one generalized version of the famous Eight Queen's Puzzle:
Given an n × n chess board, and an integer m (≤ n). Find all possible ways to put nm Queens such that
there are m Queens at each row
there are m Queens at each column
(note that we do not impose any restriction on the diagonals).
As you might see, ... |
This is a cops-and-robbers challenge. For the robbers thread, go here.
This challenge involves two OEIS sequences chosen by the cops -- S1, S2 -- and how well those sequences can be golfed and obfuscated.
The Cops' Challenge
Your challenge as a cop is to pick a freely available language, and two OEIS sequences. Then, w... |
This is a cops-and-robbers challenge. For the cops thread, go here.
This challenge involves two OEIS sequences chosen by the cops -- S1, S2 -- and how well those sequences can be golfed and obfuscated.
The cops are constructing code A that produces S1 and giving a number X that they claim is the best Levenshtein distan... |
Your task will be to take a balanced-string and a integer representing a Levenshtein distance (the number of characters that have to be inserted, deleted or changed to make one string into another) and you must find the number of balanced strings with that distance from the original string (i.e. the neighborhood of tha... |
Background
Suppose that there are 2*n people to be married, and suppose further that each person is attracted to exactly n other people under the constraints that:
Attraction is symmetric; i.e. if person A is attracted to person B, then person B is attracted to person A.
Attraction is antitransitive; i.e. if person A ... |
The challenge
Your task is to decode the first character in a UTF-8 byte sequence. The input is a byte array or a byte string holding a UTF-8 byte sequence.
If the (start of the) sequence is valid, the output is the Unicode code point of the first character in the sequence which is a number between 0 and 0x10FFFF. Your... |
Right hand brace is a style of code bracketing in which curly braces and semicolons are all aligned to a single point on the right side of a a file.
Generally, this is considered bad practice, for several reasons.
The Challenge
Take a multiline string through any method, and convert it's brace style to Right Hand Brac... |
The lambda calculus is a system of functional programming. Lambda calculus consists of variables, abstractions, and applications.
A variable is simply a name denoting a function parameter. It is a single letter. An abstraction is a "function literal" of sorts, it consists of a backslash \ followed by a variable name, a... |
Inspired by this challenge
Goal:
The goal is to draw waves crashing onto a beach.
Input:
You will be given 3 integers (in whatever format you want) as input.
The first integer will be the length of the drawing
The second integer will be the index of the sandbar, where the waves start to crest (at least 3 spaces from ... |
Sound synthesizers use envelope generators to control how certain parameters of the sound (such as overall loudness) change with time. In many synthesizers an envelope is defined by four parameters, as represented in the following figure from Wikipedia:
Attack time (A): time taken for the envelope to reach its maximum... |
Your task is to write a program that:
Runs indefinitely
Produces no output
Consumes an unbounded amount of memory
Specifications
You must list the implementation used for your program. This is relevant because some implementations might preform optimizations while others do not. For example, the LISP code (defun f (... |
A Woodall Prime is a prime which can be calculated, given a positive integer n, with n * 2^n - 1.
Your task is to, given a integer k, generate a Woodall Prime with k digits. If no such Woodall Prime exists, you must generate a Woodall Prime with the closest amount of digits. If two primes exist with the same digit coun... |
Your task is to find how many distinct Blackjack sequences can be found in an ordered list of 12 cards.
A Blackjack sequence is defined as a sequence of consecutive cards whose sum of points is exactly 21. Points are counted according to the following table:
Symbol | Name | Points Symbol | Name | Points
-------+-... |
This is a cops-and-robbers if you are not familiar with the format click the tag to go to the wiki. There will not be a robbers' thread for this question.
Cops
Your task as Cops is to select two sequences from the Online Encyclopedia of Integer Sequences and write a program that takes the nth element of one sequence a... |
This challenge is to output to your terminal, window, canvas or screen the numbers zero to 10 inclusive. Each outputted number must be shown as a 4-bit wide nybble, so zero must show as 0000 and so on.
You may separate each number outputted with a space, comma or carriage return. Smallest solution wins but the numbers ... |
I'm a developer, and I don't feel like doing my work. I know from XKCD that the best excuse for slacking off is that your code's compiling. Because of this, I think I need some code that will compile forever! And because I'm lazy and don't want to have to type much, this has to be done with the shortest code possible.
... |
Gray Code is a number system where only 1 bit of the number changes from one number to the next number. Print the 8 bit Gray Code values of 0 to 255.
Shortest Code wins!
Start of output:
0 00000000
1 00000001
2 00000011
3 00000010
4 00000110
5 00000111
6 00000101
7 00000100
...
You only have to print the Gra... |
Input
A string that contains at most one of each of the letters A, B, and C. They may be in any order. The empty string is valid input.
Note: A previous version of this challenge used the letters LEJ instead of ABC and they may still be used if desired.
Output
A string of the A, B, C letters that were not present in th... |
Objective
Given an input list of 6 distinct digits, find 3 numbers a, b and c such that a × b = c, with a having 2 digits, b having 1 digit and c having 3 digits. In a more visual way, your program must arrange those 6 digits in the boxes of this image:
If more than one solution exists, you may output any of them.
Inp... |
The task
Write a program or function that given three strings A, B, C produces an output string where each instance of B in A has been recursively substituted with C.
Recursively substituting means repeating a substitution where at each step all non-overlapping instances of B in A (chosen greedily from left to right) a... |
Challenge:
Create a function or program that will take an input N (a number from 0 - 24) which represents the HOUR.
Output should draw an analog clock out of asterisks showing the hour N.
Notes:
•The minute hand must be longer than the hour hand (in terms of number of asterisks used)
•The minute hand must be at least... |
AWG (American Wire Gauge) is a common way of specifying wire sizes. Your task in this challenge is to convert from a given gauge to the diameter of the wire in inches.
The size in inches for the gauges from 4/0 to 40 are shown in the table below:
Gauge to inches table
| AWG | Diameter (Inches) |
|-----|----------------... |
A Graceful Graph is a type of Simple Graph. Graceful graphs are special because there is a way to label all their nodes with positive integers so that when the edges are also labeled with the differences of the nodes they connect, no two edges have the same label and every label up to the number of edges is used.
Work... |
I find NullPointerException to be interesting since there are no explicit pointers in Java. Here is a program that throws such an exception.
class c {
public static void main(String[]s) {
throw new NullPointerException();
}
}
What is the shortest Java program that throws NullPointerException?
|
Make a function, method, program or routine that will accept two interger parameters (say x and y) and the total of the two values multiplied. Except straight multiplication is not allowed so you must not simply do something like:
int multiply (int x, int y) {
return x*y;
}
Also you must not use a for () loop, lik... |
Inspired by this listing from the Commodore 64 User's Guide:
10 PRINT "{CLR/HOME}"
20 POKE 53280,7 : POKE 53281,13
30 X = 1 : Y = 1
40 DX = 1 : DY = 1
50 POKE 1024 + X + 40 * Y, 81
60 FOR T = 1 TO 10 : NEXT
70 POKE 1024 + X + 40 * Y, 32
80 X = X + DX
90 IF X <= 0 OR X >= 39 THEN DX = -DX
100 Y = Y + DY
110 IF Y <= 0 OR... |
This challenge is inspired by Mathematics is fact. Programming is not.
The mathematical notation for a factorial, or a fact is an exclamation mark !. The exclamation mark is also a common symbol for not in many programming languages.
Challenge:
Take a string, containing numerals, and the characters: + ! as input and o... |
Objective
Generate the original scrambled list, from the movements that an Insertion Sort would do to sort it.
The original list will have all numbers from 0 to N-1(inclusive) where N is the size of the input.
Input
A list containing the necessary moves to sort the list. Each value represents the amount of slots displa... |
Here's a scenario:
A grandmother and grandfather forget what their GMail password is. They know the word, but can't remember which letters are capitals.
The challenge is to take a word given and print(stdout) every combination of capital letters possible, essentially "brute-forcing" but only on a given string.
Example... |
In any programming language, create a program that takes input and animates the text being typed on a keyboard.
The delay between each character should be varying to simulate true typing on a keyboard. The delay shall be 0.1, 0.1, 0.5, 0.1, 0.1, 0.5 ... seconds, until the last character is printed. The final output sha... |
The Euclidean algorithm is a widely known algorithm for calculating the greatest common divisor (GCD) of two positive integers.
The algorithm
For the purpose of this challenge, the algorithm is described as below:
Display the two input as adjacent lines of a certain character
e.g. an input of 3,4 can be represented by... |
The first Predecessor-completed Ascii Cube (PAC 1) is a simple cube with side length 1 and looks like this:
/////\
///// \
\\\\\ /
\\\\\/
The PAC 2 is a geometric shape such that combining it with its predecessor (the PAC 1) completes a side length 2 cube:
front back
/////////\ /... |
Your task is to write code that will leak at least one byte of memory in as few bytes as possible. The memory must be leaked not just allocated.
Leaked memory is memory that the program allocates but loses the ability to access before it can deallocate the memory properly. For most high level languages this memory ... |
Background
Consider a sequence defined as follows:
The first element is 0;
The second element is 4;
From the third element onwards, its value can be calculated by:
Taking the set of integers from 0 up to the previous element of the sequence (inclusive or exclusive, it doesn't matter);
Removing any integers that have... |
Summary
The goal of this challenge is to create an undone image-version of a 15-puzzle / sliding puzzle also called taquin in french.
Details:
Given an input composed of:
an image,
an integer n,
an other integer r,
your program, or function, or anything else that fits, must output the same image (i.e. same size and f... |
There have been a couple of previous attempts to ask this question, but neither conforms to modern standards on this site. Per discussion on Meta, I'm reposting it in a way that allows for fair competition under our modern rulesets.
Background
A palindrome is a string that "reads the same forwards and backwards", i.e... |
Given two integers greater than one, A and B, output four mathematical expressions in this order:
The plain expression A^B (A to the power B). e.g. if A = 2 and B = 3, 2^3.
The expansion of A^B in terms of repeated multiplications of A. e.g. 2*2*2.
The expansion of A^B in terms of repeated additions of A. e.g. 2+2+2... |
Introduction
According to the Riemann Hypothesis, all zeroes of the Riemann zeta function are either negative even integers (called trivial zeroes) or complex numbers of the form 1/2 ± i*t for some real t value (called non-trivial zeroes). For this challenge, we will be considering only the non-trivial zeroes whose ima... |
Inspired by Expand exponentation.
Knuth's up arrow notation is used for big numbers such as Graham's number.
If we look deeper, we can see how it makes big numbers.
One arrow means exponentiation. e.g. 2↑3 equals 2^3 = 8.
Two or more arrows means repeating the instructions of n-1 arrows. e.g. 2↑↑3 equals 2↑2↑2 equals 2... |
Summary:
For any given language, what is the smallest amount of unique characters for your language to be Turing-Complete?
Challenge:
For any language of your choice, find the smallest subset of characters that allows your language to be Turing-Complete. You may reuse your set of characters as many times as you want.
... |
An Abundant number is any number where the sum of its proper divisors is greater than the original number. For example, the proper divisors of 12 are:
1, 2, 3, 4, 6
And summing these results in 16. Since 16 is larger than 12, 12 is abundant. Note that this does not include "Perfect numbers", e.g. numbers that are equa... |
You've recently made an account on a dodgy gambling site, where for a fee of 25 dollars, they will pay you back a random amount between 0 and 50 dollars. After getting around 5 dollars twice, you decide to prove the site is a scam. After accessing their external firewall with the default password, you find your way ont... |
Given a semiprime N, find the smallest positive integer m such that the binary representation of one of the two factors of N can be found in the binary representation of N * m.
Example
Let's consider the semiprime N = 9799.
We try different values of m, starting at 1:
m | N * m | N * m in binary
---+--------+------... |
The Recursively Prime Primes is are sequence of primes such that
p(1) = 2
p(n) = the p(n-1)th prime
Here is an example of how one might calculate the 4th Recursively Prime Prime.
p(4) = the p(3)th prime
p(3) = the p(2)th prime
p(2) = the p(1)th prime
p(1) = 2
p(2) = the 2nd prime
p(2) = 3
p(3) = the 3rd prime
p(3) = 5... |
FizzBuzz is so simple, bet you can do it backwards. In this challenge, you will be given the length of the FizzBuzz string and must give the positive integer that produced that string.
Description
To break this down, a FizzBuzz string for n is generated by the following algorithm.
Start with an empty string and, for e... |
Your task is to calculate the expected chance of winning for 2 players in some game, each with their own ELO Rating. Player A has ELO Ra and player B has ELO Rb
The expected score for Player A (Ea) is: 1 / (1 + 10(Rb - Ra) / 400). There is a similar equation for Player B (Eb): 1 / (1 + 10(Ra - Rb) / 400).
If you want a... |
When I was a kid, and wanted to count the dollar bills in my life savings, I would count out loud:
one, two, three, four, five, six, seven, eight, nine, ten;
eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty;
twenty-one, twenty-two, twenty-three, twenty-four, twenty-five..... |
A word search is a matrix of letters as defined in Word Search Puzzle Generation. For a word search to contain a word, it means that that word appears somewhere in the matrix horizontally, vertically, or diagonally.
Your task is to write a program that takes a list of strings and outputs the dimensions of the smallest-... |
Sometimes, when writing a program, you need to use a prime number for some reason or other (e.g. cryptography). I assume that sometimes, you need to use a composite number, too. Sometimes, at least here on PPCG, your program has to be able to deal with arbitrary changes. And in circumstances conveniently contrived to m... |
Your task is to slowly calculate exponentiation, with the following steps:
Given two inputs (in this example, 4 and 8), you must calculate the exponentiation by calculate the equation bit by bit. You would do 4^8, have a greater base value (4) and a smaller exponent (8). You can do this using more exponentiation and di... |
Challenge
Make the shortest program to determine if the figures in the input will fit into the space in the input.
Requirements
The input will be in the format of this example:
Input:
+----+ -- +--+
| +----+ | |
| | +--+
| |
+---------+
Output:
+----+
|+--++----+
|| |-- |
|+--+ |
... |
Input
Two words separated by a space. It is assumed that the first is a verb.
Output
The "Soviet counterpoint" to the input phrase, in the form of a punchline to an "in Soviet Russia" joke.
"break law" --> "In Soviet Russia, law break you!"
Accounting for correct grammar is unimportant.
Shortest program wins!
|
Task is to output this text:
ABCDEFGHIJKLMNOPQRSTUVWXYZA
A 00000000000000000000000 Z
B Y
C 101010101010101010101 X
D W
E V
F 2101210121012101210 U
G T
H S
I R
J 123210... |
Your input will be a string consisting of small english letters.
Your task is to determine the number of distinct permutations of the original string that are a palindrome.
The input string has up to 100 letters. In the case of a longer string the result might be very big so the output should be the number of permutati... |
In the wake of the many (two?) FizzBuzz-related challenges posted recently on PPCG, I've been tempted to come up with my own. Behold...
Fizz Buzz Lightyear
Write a program or function that takes an integer n and prints out FizzBuzz for any number divisible by 15, Fizz for any number divisible by 3, and Buzz for any num... |
Most computer keyboards feature a small integrated LED light,
indicating the current input mode, as controlled with the CAPS LOCK button.
Your task is to blink it:
Turn it on;
Wait for 0.5 (+/-0.1) seconds;
Turn it off again.
Video footage of the LED blinking is highly appreciated !
Rules
You can blink a different ... |
Background
On this site, we occasionally have questions requiring programs to be "radiation hardened"; this means that the program has to be able to survive the deletion of one or more bytes, no matter which bytes are deleted.
As is common for tasks that frequently get set in programming challenges, it's natural to wan... |
When using a tool such as git to merge two files, a conflict could be detected and added to the result of the merge.
A merge of these two files:
my file:
Common line of code 1
Common line of code 2
my lines
Common line of code 3
Common line of code 4
their file:
Common line of code 1
Common line of code 2
their lines
... |
Intro
When you search in google, it always shows you a result with a sample text from the found webpage.
For example if you search for "Madonna greatest vinyl", google will show you one line link, and below a short excerpt from that found webpage:
Madonna Greatest Hits Records, LPs, Vinyl and CDs
Madonna - Greatest Hi... |
Some of you may be familiar with the way that a motorcycle shifts. But for those who don't, It looks like this
6
5
4
3
2
N
1
Now I want to know what gear I am in after performing a few up and down shifts.
The program should work from neutral.
Sample input:
V^^
Sample output:
2
As you can see I downshifted once from ... |
You're in charge of distributing T-Shirts to everyone. Simple enough, right? But remember, there are different sizes of T-Shirts, and you have to keep that in mind...
Challenge Specifications
There are N T-Shirt sizes. There are K people. Each person may wear any T-Shirt that is larger than them, but they can only wear... |
You know those Windows boxes where you can only do one thing?
Let's take this to the next level!
Challenge
Make a dialog box with a button that follows your cursor everywhere!
Specs
No input may be taken. There may be output to either STDOUT or STDERR. You must open a window with one button (no text is necessary, but ... |
In this challenge, you need to simulate a frog jumping back and forth on lily pads. The pond is infinitely big, has a line of an infinite number of lily pads, and the frog can jump across as many lily pads as he likes.
This frog likes to jump back and forth: after jumping forward, he always jumps backwards, and vice ... |
Determining whether a Language is Turing Complete is very important when designing a language. It is a also a pretty difficult task for a lot of esoteric programming languages to begin with, but lets kick it up a notch. Lets make some programming languages that are so hard to prove Turing Complete that even the best ... |
PPCG hasn't had enough of quines already...
Challenge:
Your task is to create a program "A0". When this program is run with no input, it outputs nothing. When this program is run with input, it outputs "A1". When "A1" is run with no input, it outputs "A0". When "A1" is run with input, it outputs "A2". Pretty much, "A(k... |
I'm a narcissist. (Not Really)
I'm also very lazy... (Not Really)
So I want to know the score of this question, and how many people have viewed it.
But I'm too lazy to check myself...
Challenge
Your challenge is to output the score of this question, and how many views there are. No input may be taken, and output may... |
I think is about time to do another Pokemon challenge! Even if Pokémon Go is not as mainstream as it used to be...
The task.
Just draw a MISSINGNO. MISSINGNO is an unofficial Pokémon species found in the video games Pokémon Red and Blue. IGN has noted MISSINGNO appearance in Pokémon Red and Blue as one of the most fam... |
Code Golf Challenge
I have an isdue, my fingrrs are fat and I freqintly jave an isdue of ty[ing one keystrpke to the right on my kryboard.
I'm afraid the isdue is getyng worse anf worsr as time goes on.
Sopn every keystrpke I make wil; be shiftrd pne to the right!
Befpre then I'd like a program (or functipn) to autp sh... |
Draw this Ascii coffee cup:
o
o
o
__________
/ \__
| J | \
| A | |
| V | |
| A |__/
\__________/
Brownie points for coffee-script or java :)
Shortest code in bytes, function or program, trailing newline or white space is acceptable, drink up!
|
3D-modeling software mainly uses UV Mapping to map textures onto a 3D object. The valid values for both U and V are usually located in an inclusive [0..1] range.
Challenge
You bought a new 3D-modeling software which is super-easy to use. However there is one issue with it: it adds or subtracts a random integer number f... |
This is a cops-and-robbers challenge the Robbers' Thread can be found here
Your challenge is to write a program that outputs an anagram of its source code but not the original source code itself.
For example the following Python program,
print`'print*2``'*2`
prints
'print*2``print*2``'
which has all of the same chara... |
This is a cops-and-robbers challenge the Cops' Thread can be found here
Your challenge, as robbers is to take outputs from the cops' thread and find anagrams of the output that when run as a program output the original output provided.
The winner will be the person with the most valid cracks on this question.
Rules
Yo... |
Given a ruler length in inches and fractions of an inch, and a granularity in fractions of an inch, output the values of all marks on the ruler, starting from 0, in ascending order.
Input ruler length will be a mixed fraction (integer and proper fraction)
Input granularity will be a proper fraction in the form 1/(2ⁿ), ... |
Consider the positive integer powers of five in decimal. Here are the first 25, right aligned:
X 5^X
1 5
2 25
3 125
4 625
5 3125
6 15625
7 78125
8 390625
9 1953125
10 ... |
Write code that takes a string as input, and outputs a truthy or falsey value depending on whether or not the string follows these rules:
If you stack each character on top of each other, convert to binary and sums each column, then all the sums should be identical. You may assume the input string contains only printab... |
A challenge I thought that would be very cool is to make an interpreter for a Turing-complete language of your choosing.
The rules are simple:
You may use any language to create this interpreter even if it is newer than this challenge.
You may use any Turing-complete language as long as it is not the same as the one y... |
The New York Times periodically runs a puzzle they call the "Spelling Bee" in which they list six "allowed" letters plus one "mandatory" letter and challenge the reader to form as many five-letter-or-longer dictionary words as possible out of those letters. Each "allowed" letter can appear 0 or more times. The mandator... |
This is a repost of Evolution of “Hello World!”, originally written by user Helka Homba
It should not be closed as a duplicated, due to meta consensus here.
The original was asked over two years ago and was last active more than six months ago. I have permission from Helka Homba to post this here
Since the original, ma... |
There are 97 ASCII characters that people encounter on a regular basis. They fall into four categories:
Letters (52 total)
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
Numbers or Digits (10 total)
0123456789
Symbols & Punctuation (32 total)
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
Whitespace (3 total)
Space , tab ... |
This challenge is inspired by Blink the CAPS LOCK by zeppelin.
Most webcams feature a small integrated LED light, indicating if the webcam is in use, as controlled by a hardware mechanism to prevent spying.
Your task is to blink it:
Turn it on.
Wait for 0.5 (±0.1) seconds.
Turn it off again.
Wait for 0.5 (±0.1) secon... |
Following the best security practices, I keep a plain text file with my passwords on my hard drive. In fact, I just copied and pasted one of them to access my PPCG account.
In a lucid moment, I decide that the password should better not remain in the clipboard after its use. Since this happens to me often, I could use ... |
Mr Seckington is a mobile grocer. He drives his van door-to-door selling his produce all around the nearby villages. Mr Seckington needs a method to weigh the produce he is selling so he knows how much to charge his customers. Because space is at such a premium on his van, he uses an interesting sequence of weights ... |
I was messing around with Pyth's url request feature, and noticed that google always gave a response with a slightly different length for me, usually ~10500 characters.
So your task in this challenge is to print out the average length of the html response from http://google.com.
Specs
You will take an input n which is... |
Code Golf
Totally real backstory: I'm a contractor working on a website www.Sky.Net and one of our tasks it to create some self-aware program or something, I don't know I wasn't really listening to the boss. Anyways in an effort to make our code more self-aware we need IT to be able to know what code is on each line-nu... |
Not a dupe to this. That question asks specifically for counting up forever, while this question allows many other approaches.
Write a program or function which, given infinite time and memory, would print an infinite non-periodic output.
Clarifications
'Infinite' means the solution keeps outputting something without ... |
This challenge is a tribute to the winner of Best Picture at the Oscars 2017, La La Land Moonlight!
Write a function/program that takes a string containing only letters [A-Za-z], the four symbols that are common in every day sentences .,'? and spaces, and outputs the string in the style of La La Land.
To be more spec... |
This challenge is in tribute to the winner of Best Picture at the Oscars 2017, La La Land Moonlight!
Your challenge is to print the text La La Land pause one second, then change the text to show
La La Land MoonlightThe original text (La La Land) must have a strikethrough. This can be achieved either by clearing the s... |
We've had problems to generate minesweeper games.
We've had problems to solve these minesweeper games.
Now...
It's time to battle other people on a minesweeper game!
Your program must be run in Java. Essentially, each player can do an action every turn.
You may move to any space touching yours including corners. The b... |
Task
Given a positive integer n less than 2^30 specified as input in any way you choose, your code should output a random integer between 0 and n, inclusive. The number you generate should be chosen uniformly at random. That is each value from 0 to n must occur with equal probability (see Rules and Caveats).
Rules an... |
In: Enough memory and a positive integer N
Out: N-dimensional N^N array filled with N, where N^N means N terms of N-by-N-by-N-by...
Examples:
1: [1] which is a 1D array (a list) of length 1, containing a single 1
2: [[2,2],[2,2]] which is a 2D array (a table) with 2 rows and 2 columns, filled with 2s
3: [[[3,3,3],[3,3,... |
The Penrose triangle, also known as the Penrose tribar, or the impossible tribar, is an impossible object.
The goal in this challenge is to display a Penrose triangle in the fewest bytes possible.
Source: Wikipedia
Rules:
You must display the Penrose Triangle digitally after generating it.
They must look the same as ... |
Slightly more than an inverse of this.
In: Multi-line DSV data and a single delimiter character. The DSV may be taken as a file, a filename, line-break separated string, list of strings, etc. All records have the same number of fields, and no field is empty. Data does not contain the delimiter character and there is no... |
Golf the leaderboard of this question (id=111735). Your program should issue one HTTP or HTTPS request to StackExchange API, parse it and present to user in form similar to a typical Leaderboard Snippet
Sample output (for the question 47338 instead of this):
Leaderboard
Author Language Size
1. FryAmTheEggman ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.