instruction stringlengths 34 53.1k |
|---|
Challenge description
In this challenge, we only consider love and hate as feelings. If we want to utter a feeling expression of order N, we alternate between these two (starting with hate):
order | expression
1 I hate it.
2 I hate that I love it.
3 I hate that I love that I hate it.
4 I hate t... |
The new xkcd feed bot room gave me an idea for a simple challenge.
Your code will have to monitor the xkcd website and output all the new comics to the user.
Specs
When first run it should just sit around waiting.
Then, when randall posts a new comic, within a minute, it should display the new comic in any of our usua... |
End the tabs versus space war
So, there has been a great deal of debate of whether to use tabs or spaces to indent/format code. Can you help the university settle the dispute, by going to an incredibly crazy unique method of formatting.
Your job is to write a full program or function which expands all tabs into four s... |
Description
Subtract the next P numbers from a N number. The next number of N is N + 1.
Look at the examples to get what I mean.
Examples:
Input: N=2,P=3
Calculate: n - (n+1) - (n+2) - (n+3) //Ending with 3, because P=3
Calculate: 2 - 2+1 - 2+2 - 2+3 //Replacing N with 2 from Input
Calculate: 2 - 3 - ... |
Input:
A string only containing the following characters:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.?! (space at the end) and two special characters (_ and |)
Output:
Mirror the text based on the position(s) of the _ and |.
_ mirrors horizontally and | mirrors vertically.
Mirroring process
The fir... |
Task
The task is to convert a string to a number. It must accept the string via stdin and output the number via stdout.
You convert a string to a number by replacing each letter of the string by its index (mind that you don't need to replace it with the index, that's just an example. You are allowed to replace it with ... |
Long time ago, when I was spending more time playing RPG, one of the issues what some players had, was to track party movement and to draw proper map.
So I come with idea, to check how you guys come deal with this issue.
Task is to write a function, which takes as input parameter list of directions (passed as structure... |
Challenge
Write a program which takes the URL of a PPCG answer as input and outputs the length of the answer's first code block in bytes.
Code Blocks
There are three different ways of formatting code blocks:
Four spaces before the code (- represents a space, here)
----Code goes here
Surrounding the code in <pre> tags:... |
As a terrible Latin student for several years I have learned to hate many things about Latin. However there is one thing I love.
Latin scansion.
Scansion is the act of determining the meter of a particular line of poetry. For Latin this means demarcating each syllable in the line as "light" or "heavy".
In Latin scans... |
Two-dimensional programming languages often have mirror commands like / and \ to redirect the instruction pointer on the grid:
>>>>\
v
v
<<<</
In this challenge, you're given an incoming direction and a mirror and you need to determine the outgoing direction.
Rules
The incoming direction will be given as one o... |
Challenge description
A Smith number is a composite number whose sum of digits is equal to the sum of sums of digits of its prime factors. Given an integer N, determine if it's a Smith number or not.
The first few Smith numbers are 4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438 (seque... |
First, some terminology (source):
A hip roof is (quoting Wikipedia) "a type of roof where all sides slope downwards to the walls, usually with a fairly gentle slope"
A slope is a planar surface that is a part of the roof
A ridge is an edge where two opposite roof slopes meet
A hip is a convex edge where two slopes bel... |
A standard Scrabble board is a 15×15 grid of spaces to place letter tiles. Most of the spaces are blank but some are double word scores (pink), triple word scores (red), double letter scores (light blue), and triple letter scores (blue). There is usually a star in the very center (which counts as a double word score).
... |
Everyone knows the old minesweeper game that shipped with Windows XP. It's a simple grid with a 9x9 matrix of cells containing either a number (indicating how many mines are adjacent to it) or a mine.
The challenge is to generate a random 9x9 grid with 10 bombs given any integer seed (up to whatever your machine/langu... |
Setting the Scene:
It is an average afternoon, as you unwind after a long day by engaging in your favorite pastime: answering the plethora of captivating questions on PPCG. It hasn't been a good day for you; those damned Pyth programmers keep getting best answer and it's killing your vibe. Suddenly, you notice a new qu... |
Here's a relatively simple challenge for you:
Given a list of positive integers:
Line them up in a grid, and sum each column. For example, if the input was [123, 7, 49, 681], the grid would look like this:
1 2 3
7
4 9
6 8 1
And the sum of each column would be [18, 19, 4]:
1 2 3
7
4 9
6 8 1
--... |
Challenge
You must choose one number x (y = x + 9) and create ten unique programs which each print out one of the numbers in the range x to y inclusive. However, there are three twists:
Each program's score is the difference between length of your program in bytes and n (where n is the number that the program outputs)... |
Bibi-binary is a numeric system invented by Boby Lapointe in order to represent numbers in letters which pronunciation seems funny.
Your task is to convert decimal numbers into Bibi-binary!
Conversion
A number is converted to base 16 (hexadecimal) and each character is replaced by its Bibi-binary name:
0 = HO
1 = HA
2 ... |
Your task is to display the below letter "E" shaped ASCII art, given five inputs.
Examples:
Input: 7,2,+,|,- (Note: You don't have to follow this exact input format, and if you don't use it, then you must explain how your own input format works)
Explanation:
7 total width, including the left and right edge characters.... |
This idea is loosely based upon @TùxCräftîñg's chat message.
Take a look at the below example sequence:
INVALID0, INVALID1, INVALID2 INVALID3, INVALID4... INVALID9
After INVALID9, it goes on like this:
INVALI0, INVALI1, INVALI2, INVALI3... INVALI9
And after INVALI9, it's like this:
INVAL0,INVAL1, INVAL2, INVAL3... INVA... |
The Challenge
Given two strings/an array of strings, output the first string slowly shrinking and expanding back into the second string.
You can assume the strings will always start with the same character.
Example
Input:
"Test", "Testing"
Output:
Test
Tes
Te
T
Te
Tes
Test
Testi
Testin
Testing
First you output the fi... |
Write a function f(n,k) that displays the k-dimensional countdown from n.
A 1-dimensional countdown from 5 looks like
54321
A 2-dimensional countdown from 5 looks like
54321
4321
321
21
1
Finally, a 3-dimensional countdown from 5 looks like
54321
4321
321
21
1
4321
321
21
1
321
21
1
21
1
1
Forma... |
In the strategy game "Hexplode", players take turns placing tokens on a hexagonal board. Once the number of tokens equals the number of adjacent tiles, that tile hexplodes, and moves all of the tokes on it to the surrounding neighbors. You can play the game online here.
I like this game, but sometimes it's hard to know... |
As of time of submission to the sandbox, I had 17017 reputation, which you will all be able to factorise as 7×11×13×17, a product of 4 consecutive primes.
Please write a function or program to output all the products of two or more consecutive primes up to an input integer n. For example, given n=143 you should output ... |
Introduction
The four basic math operators (+, -, *, /) can be reduced to just two, due to the fact that:
x + y = x - (-y)
x * y = x / (1/y), y != 0
x * 0 = 0/x
Challenge
The challenge is to take input as a "string" containing:
Numbers
Single character variables ("x", "y")
The four basic math operators (+, -, *, /)
P... |
An abelian sandpile, for our purposes, is an infinite grid with integer coordinates, initially empty of sand. After each second, a grain of sand is placed at (0,0). Whenever a grid cell has 4 or more grains of sand, it spills one grain of sand to each of its four neighbors simultaneously. The neighbors of (x,y) are (x-... |
Introduction
Almost everyone is familiar with the Travelling Salesman Problem (TSP). The task is to, given a list of N cities, find the minimum Hamiltonian cycle which is to say the shortest path that visits each city and comes full-circle back to the start. That is not what this challenge is about. This challenge is t... |
A constructible \$n\$-gon is a regular polygon with n sides that you can construct with only a compass and an unmarked ruler.
As stated by Gauss, the only \$n\$ for which a \$n\$-gon is constructible is a product of any number of distinct Fermat primes and a power of \$2\$ (ie. \$n = 2^k \times p_1 \times p_2 \times ..... |
Challenge
You must write a program which takes a string and a flag as input and performs one of the following functions.
Input
If your language does not support command line arguments, you may take the arguments as input via STDIN.
The flag will be two characters: a dash and an ASCII character such as -d or -c.
Functio... |
Input:
A grid of varying size only containing numbers in the range 00-99, the following four characters: ^; >; v; <, and spaces to fill (and new-lines of course).
Output:
The result of the sum (integer) when you follow the path.
How does this work?
You start at the arrow with the highest number, and follow the path t... |
See also: Rotatagons
Challenge
Given a string as input, output its wordagon.
Wordagons
A wordagon is a way of representing a string in a hexagon. Now, let's create a wordagon from the string hexa:
Firstly, you start with the first character in the string a place it in the centre:
h
Then, you take the next character in... |
Challenge Description
Cycle all letters from the first part of the alphabet in one direction, and letters from the second half of the alphabet in the other. Other characters stay in place.
Examples
1: Hello world
Hello_world //Input
Hell ld //Letters from first half of alphabet
o wor //Letters from second hal... |
I have a list of images grouped numerically (YI0.png, YI1.png...YI20479.png). I want them sorted alphabetically, like so:
YI0.png -> YIA.png
YI1.png -> YIAA.png
without my last image having 20479 As in it.
Input
A directory name.
Output
All files in that directory will be alphabetically renamed.
Constraints
The patte... |
The sequence of segmented numbers or prime numbers of measurement (OEIS A002048) is the sequence of numbers such that each member is the smallest positive (greater than zero) number that can't be made of a sum of earlier consecutive numbers, with a(0) = 1.
Example
To calculate a(7) we first calculate a(0->6) = [1, 2, 4... |
Donald Knuth was born in 1938, on the 20th day of Capricorn.
The first day of Capricorn is the 22nd December.
Donald Knuth was born on the 10th of January (1938).
The challenge
Write a program or function which takes three inputs about a person (any other specified order is fine):
Their (calendar) year of birth (an i... |
A Fragile Quine
A fragile quine is a quine that satisfies the property of having each substring made by removing a single character, when evaluated, produces an error.
For example. If your program asdf is a quine, then for it to be fragile, the following programs must error:
sdf
adf
asf
asd
Your program (and all of it... |
Here is an ASCII-art of a 4-way intersection:
| | |
| |
| | |
| |
| | |
-----+-----+-----
| |
- - -| |- - -
| |
-----+-----+-----
| | |
| |
| | |
| |
| | |
(Note how the horizontal roads are 3 rows tall, while... |
A Rubik's cube has 6 colors: red, orange, yellow, white, blue, and green. Red and orange, yellow and white, and blue and green faces are on opposite sides.
Net of a solved Rubik's cube looks like this:
Y
BRGO
W
And the tiles look like this:
Y Y Y
Y Y Y
Y Y Y
B B B R R R G G G O O O
B B B R R R G G ... |
Last time you made a square of text, but now, can you make a cube of text?
The Challenge
Given a string, output the string in the form of a cube.
You can assume the string will always have 2 chars or more, and will only have printable ascii characters.
How to Make a Text Cube
Test Cases
Input:
Test
Output:
Test
... |
Given a length N string of less-than and greater-than signs (<, >), insert the integers 0 through N at the start and end and in between each pair of signs such that all the inequalities are satisfied. Output the resulting string. If there are multiple valid outputs, output any one (and just one) of them.
For example
<<... |
See also: Wordagons
Challenge
Given a hexagon and a number n as input, output the same hexagon rotated n times.
Hexagon
The hexagon will be a string like so:
a b c
d d e e
f f o g g
h h i i
j k l
The hexagon will always be regular and will only ever contain the printable ASCII characters:
!"#$%&'()*+,-./0123456... |
As if this challenge could be any more Pythonesque in spirit... No prior knowledge of Markov chains or encryption techniques is required.
You are a spy who needs to obtain some crucial information from the British security service M1S. The agents of M1S are well aware that their Wi-Fi signals can be intercepted, their ... |
Disclaimer
This question is not a duplicate of this question. I'm not counting specific digits, as we already have those set in the initial parameters. This question is focusing on the decimal numbers that can be constructed from the binary strings based on the digits provided.
Challenge
Given two integers X and Y, rep... |
The Challenge
Given a string containing a random sequence of unique characters A to Z (all upper case, no duplicates), determine the cut-and-paste" sort and output the sort sequence to a specific format (detailed below).
Definition of Cut-And-Paste Sort, by Example
Example string:
AKJCFEGHDBI
This string contains 11 ch... |
The Challenge
Given the two uppercase hexadecimal strings (both 6 characters long, XXXXXX and YYYYYY) representing RGB values (ranging from 000000 to FFFFFF inclusive), and a positive non-zero integer N, display a linear transition of the N+2 colors generated from XXXXXX to YYYYYY that would result in a color gradient.... |
So I was playing around with my compose key, and found some cool things, one of them being that by pressing compose + ( + alphanumeric + ), you get that character inside a bubble, like so: ⓐ.
Your task in this challenge is simple, to convert ordinary text to bubble letter text.
Here are the ascii chars, the bubble char... |
Write a function or program that awards you SE badges. If an input "Q" is given it means you have asked a question. If no input is given it means you have only visited the site.*
Badges it must support:
Run script 30 days in a row: "Enthusiast"
Run script 100 days in a row: "Fanatic"
Input "Q" first time: "Student"
In... |
In this challenge you've to print multiplication tables by input, Here are some examples:
Input: 2
Output:
0 2 4 6 8 10 12 14 16 18 20
Input: 20
Output: 20 40 60 80 100 120 140 160 180 200
Rules
The shortest code in bytes wins.
This challenge is a code-golf, It follows code-golf general rules (code-golf)
... |
The challenge is relatively simple, but will hopefully lead to some wonderfully creative answers. The task is to take a string as an input (via command line, function parameter etc.) and output/return a stringsploded version of it.
A stringsploded version of a string is its first letter followed by its first 2 letters,... |
As preparation for the nth Exodus, Noah decides to write a program that will decide If he will let animals on his ark. However, Noah wants to go back to grass roots. Thus he decides that the program should be as small and as simple as possible.
GOAL:
Recreate the Contrabulous Choosematron, in a way that follows evange... |
Given an integer, make an expression that produces it from 0 using unary negation - and bitwise complement ~ (~n = -n-1), with the operators applied right to left.
...
-3 = ~-~-~0
-2 = ~-~0
-1 = ~0
0 = 0
1 = -~0
2 = -~-~0
3 = -~-~-~0
...
Your expression must be as short as possible, which means no redundant... |
Output one random character for each character of source code (as illustrated below). The probability of each character is its frequency in the original source code. Thus the output will be fake source code resembling a quine.
Specification
Restrictions
Standard quine constrains apply. No empty programs or functions.... |
Print all the numbers from 0-100 in the right order using the Danish way of counting
How they count
Like English, they have dedicated words for 0-20, 30, 40 and 100
Instead of saying twenty-one and twenty-two, they say one and twenty and two and twenty
Starting with fifty they say multiples of 10 as n*20
50 = half thi... |
Much like this challenge, write a program or function that takes no input and prints or returns the string
Hello, Earth!
with an optional trailing newline.
The catch is that your program must be an even number of characters long, and each two character chunk of your program must consist of identical characters.
For ex... |
Input
verb, a string that matches the regular expression ([a-pr-vyzıöüçğş]*[aeıioöuü][bcçdfgğhj-nprsştvyz]+|([a-pr-vyzıöüçğş]*[aeıioöuü]){2})(mak|mek)
plural, a truthy or falsy value
person, an integer having value either 1, 2, or 3
tense, an integer having value either 1, 2, or 3
Output
The conjugated form of the Tu... |
SageMath is an open-source mathematics software system, built on Python 2. Its extensive math library support makes it a strong choice for golfing in math-based challenges.
What tips do you have for golfing in SageMath? One tip per answer, please. Tips should be specifically for SageMath, and not general golfing tips (... |
I remember people saying that code size should be measured in bytes, and not in characters, because it's possible to store information with weird Unicode characters, which have no visual meaning.
How bad can it be?
In this challenge, you should output the following Lorem Ipsum text, taken from Wikipedia:
Lorem ipsum do... |
Create a function or program that takes two inputs:
A list of integers that shall be sorted (less than 20 elements)
A positive integer, N, saying how many comparisons you should take
The function shall stop, and output the resulting list of integers after N comparisons. If the list is fully sorted before N comparison... |
Challenge
Output the person on PPCG who has cast the most upvotes and the person who has cast the most downvotes.
Voters
You should only look at the people who have cast more than 1000 votes in total.
To find the person who upvotes the most, you should the find the person with the highest upvotes/total votes value. Sim... |
Lots of people on this site use esoteric languages, and since these languages are unusual and hard to understand, they will frequently write an explanation in a certain format. For example, if the code was
abcdefghijklmnop
And this languages uses # for comments, they would write an explanation like this:
a ... |
Challenge
Given an ASCII art shape, you must find out whether the shape is a regular hexagon or not.
Hexagons
A regular hexagon is defined using two rules:
It has six sides
Each side has equal numbers of characters
For example, the following shape is regular but it doesn't have six sides and so is not a regular hexag... |
This challenge is to write a minimax function in a language of your choice, to output the next best move in an NxN game of tic-tac-toe given the current board state. The board input can be accepted as a Matrix, 2D Collection or anything else that makes sense to you, but adheres to the rules. The output being the next b... |
Read this yng Nghymraeg
Challenge
Given a word in Welsh, output all of the possible mutated forms of the word.
Mutations
A mutation is a change of the first letter of a word when following certain words or in certain grammatical contexts.
In Welsh, the following are considered "consonants":
b c ch d dd f ff g ng h l ll... |
Some people count sheep to get to sleep. Others count goats.
Write a program or function that takes in a positive integer N and outputs N-1 awake goats followed by one sleeping goat, as if someone was counting N goats and at the very last one they fell asleep.
Awake goats look like this:
\
___/o>
-(___)"
'' ''... |
Your challenge, should you choose to accept it, is, given an integer K >= 1, find non-negative integers A and B such that at least one of the two conditions following hold:
K = 2^A + 2^B
K = 2^A - 2^B
If there does not exist such A and B, your program may behave in any fashion. (To clarify, A and B can be equal.)
Te... |
Characters
Let’s call these Unicode characters English IPA consonants:
bdfhjklmnprstvwzðŋɡʃʒθ
And let’s call these Unicode characters English IPA vowels:
aeiouæɑɔəɛɜɪʊʌː
(Yes, ː is just the long vowel mark, but treat it as a vowel for the purpose of this challenge.)
Finally, these are primary and secondary stress ma... |
This challenge is based on this video. I recommend that you watch it before trying this challenge.
First we define a function. This function (OEIS) takes a integer n as input and outputs the number of letters in the English representation of n (without spaces or hyphens). For example "three" has 5 letters so 3 maps t... |
The Tangram is a dissection puzzle made from seven shapes: Five differently sized triangles, a parallelogram and a square. Given a shape, the goal is recreating the shape using all the pieces and without overlapping. There are obviously infinitely many ways to arrange this set of pieces in the plane. An interesting sub... |
Introduction
The game of xiangqi, also known as Chinese chess, is a chess-like game
popular in China, Vietnam, Taiwan, and other East Asian countries. The colours
of the two sides in xiangqi are red and black. There are seven pieces in
xiangqi: the general (G), advisor (A), elephant (E), horse (H), chariot
(R), cannon ... |
This is a classic one.
You get a number from the keyboard from 0 to 1000(including) and must print it in text form.
Examples:
Input:5
Output:five
Input:23
Output:twenty three
Input:999
Output:nine hundred ninety nine
|
Decipher Neurotic Frogs
Now that Puzzling.SE has finally cracked my amphibian-obsessed cipher, let's write a program or function to decrypt it!
(If you want to look at the puzzle before having it spoiled for you, click the above link now.)
How the cipher works
In Neurotic Frogs Ought To Relax In Mud Baths ("Neurotic F... |
Challenge
Given a time and a timezone as input, output the time in that timezone.
Time
The time will be given in 24 hour format like so:
hh:mm
Where hh is the two digit hour and mm is the two digit minute. Note that the hour and the minute will always be padded with zeroes like so:
06:09
All the times given are at UT... |
A positive integer n can be represented as a rectangle with integer sides a, b such that n = a * b. That is, the area represents the number. In general, a and b are not unique for a given n.
As is well known, a rectangle is specially pleasing to the eye (or is it the brain?) when its sides are in the golden ratio, φ = ... |
Challenge:
Given a number, take the largest prime strictly less than it, subtract it from this number, do this again to this new number with the biggest prime less than it, and continue doing this until it's less than 3. If it reaches 1, your program should output a truthy value, else, the program should output a false... |
Write a program that takes in a number N from 1 to 9 inclusive. In its native form your program should output N+N. E.g. output 2 if N is 1, 4 if N is 2, 6 if N is 3, and so on.
When every character in your program is duplicated in place, then it should be a program that takes in N (still from 1 to 9) and outputs N×N. E... |
Your task is to, as the title discreetly suggests, make a bad fade animation of one word turning into a second word for yours truly.
What exactly is this "fade animation" you may ask?
To make a spectacular(ly bad) fade animation, you take two strings which will contain only printable ASCII characters. You start by prin... |
Your task is, given a positive integer n, to generate an expression that equals the number n.
The catch is: you're only allowed the number 1 in the output.
The operators at your disposal are:
+, -, * and /
/ is floating-point division (so 5/2 = 2.5).
sqrt (as s)
ceil and floor (as c and f respectively)
! (factorial... |
Introduciton
Some of you might have realised that I am a sloppy typer when using my phone. That's why I want you to write a program which corrects my typos.
Chalkrnge
Given a misspelled word, output all of the possible words which I meant to write.
Typso
The main cause of my typos is down to the fact that I hit the wro... |
(inspired by this challenge over on Puzzling -- SPOILERS for that puzzle are below, so stop reading here if you want to solve that puzzle on your own!)
If a letter in a word occurs alphabetically later than the previous letter in the word, we call that a rise between the two letters. Otherwise, including if it's the sa... |
Write a program or function which receives as input a string representing a Welsh word (UTF-8 unless otherwise specified by you).
The following are all single letters in Welsh:
a, b, c, ch, d, dd, e, f, ff, g, ng, h, i, j, l, ll, m, n, o, p, ph, r, rh, s, t, th, u, w, y
To quote Wikipedia,
While the digraphs ch, dd,... |
Earlier this week, we learned about how to format esoteric languages for commenting. Today, we're going to do the inverse of that. I need you to write a program or function that parses some well-commented esoteric code and parses the comments out, returning just the code. Using some examples from the previous challenge... |
Let's use augmented reality to hunt small creatures hidden in source-code. Write a quine program that outputs its own code source, except for 5 consecutive characters that will be modified and that will display a PCG-mon : (^_^)
The 5 consecutive characters can be positioned anywhere in the source code (from position 0... |
Challenge
Given a three digit octal permissions number, output the permissions that it grants.
chmod
On UNIX OSes file permissions are changed using the chmod command. There are few different ways of using chmod, but the one we will focus on today is using octal permissions.
The three digits in the permissions number r... |
This is thematically similar to Generate keyboard shortcuts for a menu, but its actually a pretty different challenge.
Let's take PHPStorm's menu as an example:
New Project
New
Open Directory
Open
Open URL
New Project from Existing Files
Save As
Open Recent
Close Project
Rename Project
We need to assign a single-lette... |
We define a map as a set of key-value pairs. For this challenge, you need to take each of the values and assign them to a randomly chosen key.
You must randomly shuffle the values, and output the resulting map. This means that each time we run your program, we have a chance of getting a different output
Each possibl... |
This question is written because "Thing Explainer" is fun to read, and gave me an idea.
Write "stuff that makes computer do things" that reads/takes a set of letters, numbers and things like this "#%|? and returns True / 1 if all words are part of this set.
If all words are not part of that set, return the words that w... |
A stem and leaf plot displays a bunch of numerical values in groups, which are determined by all but the last digit. For example, suppose we have this set of data:
0, 2, 12, 13, 13, 15, 16, 20, 29, 43, 49, 101
We could produce this stem and leaf plot:
0|02
1|23356
2|09
3|
4|39
5|
6|
7|
8|
9|
10|1
The first row's stem... |
Given a positive integer n and a number a, the n-th tetration of a is defined as a^(a^(a^(...^a))), where ^ denotes exponentiation (or power) and the expression contains the number a exactly n times.
In other words, tetration is right-associative iterated exponentiation. For n=4 and a=1.6 the tetration is 1.6^(1.6^(1.6... |
Given an integer, output an upside-down tent.
The input determines both the size of the tent (absolute value) and whether the entrance is on the left side (negative numbers) or the right side (positive numbers).
If input = -1:
____
\/_/
If input = -2:
________
\ / /
\/___/
If input = -3:
____________
\ / /... |
The Challenge
GIFs are the most common image format for animation, and are used pretty heavily in today's social media. For the purpose of this challenge, I'm going to redefine what a GIF can be. This challenge will require you to take in a 3D array containing some sort of representation of a 2D 'image' and iterate thr... |
Continued fractions are expressions that describe fractions iteratively. They can be represented graphically:
$$
a_0 +\cfrac 1
{a_1 + \cfrac 1
{a_2 + \cfrac 1
{\ddots + \cfrac 1
{a_n}
}
}
}
$$
Or they can be represented as a list of values: \$[a_0 ; a_1, a_2, \dots, a_n]\$
The challenge:
take a base nu... |
The objective is to produce output of n squares (nxn) of random integers (0-9) with a moving * that rotates clockwise around the corners, starting from the top left. The squares should be side by side and separated by a single space.
If n = 0, the output should be empty.
Output for n=1:
*
Output for n=2:
*3 4*
14 07
O... |
Being programmers, watching us flex aren't very interesting. Today we change that! In this challenge you will lex and flex hexaflexagons.
About
For a video introduction, watch viharts video(s) on flexagons
A flexagon is a shape that you can flex to reveal faces other than the top and bottom one; we are making a hexahex... |
Here is a relatively simple challenge for you.
Given a string of length N, output the string forwards, then backwards, then forwards, then backwards... etc. N times. For example, if your input was
Hello!
You should output:
Hello!!olleHHello!!olleHHello!!olleH
You may also optionally output one trailing newline.
Your... |
In English, there is the fun and simple difference between an and a: you use an when preceding a word starting with a vowel sound, and a when the word starts with a consonant sound.
For the sake of simplicity in this challenge, an precedes a word that starts with a vowel (aeiou), and a precedes a word that starts with... |
The mid-autumn festival has begun!
Unfortunately, all my mooncakes were stolen -- they're getting too expensive for small folk such as myself, and I fear I won't be able to eat any this year!
So I turn to you for help. Would you be able to make me some?
For those unaware, let me educate you on what a mooncake looks l... |
A nice simple one
Input
Given a boolean array (Or an acceptable alternative), you can assume the array will never be more than 32 elements long.
[false, false, true, false, false]
Output
Invert every element of the array and output it.
[true, true, false, true, true]
Rules
You can write a full program or just a func... |
Write a "palipolyquine": a program that is a quine, a polyglot, and a palindrome.
Rules:
The number of polyglot languages is more preferable than code size.
The shortest answer (in bytes) wins, in case of a tie.
Polyglot and Quine rules see here: Write a Polyquine.
My example (I have a repository Freaky-Sources with... |
You sell gold coins. Each gold coin you sell is supposed to be 1 ounce. However, you find out that one of your coin suppliers is cheating you. By alloying the gold material with something else, their coins weigh only 0.9 ounces. With a help of a pointer scale (one that shows the exact weight of a quantity of matter set... |
Given a nonempty list of positive decimal integers, output the largest number from the set of numbers with the fewest digits.
The input list will not be in any particular order and may contain repeated values.
Examples:
[1] -> 1
[9] -> 9
[1729] -> 1729
[1, 1] -> 1
[34, 3] -> 3
[38, 39] -> 39
[409, 12, 13] -> 13
[11, 11... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.