instruction stringlengths 34 53.1k |
|---|
The Discordian calendar is an alternative calendar used by Discordians.
The discordian year has 5 seasons, each lasting 73 days: Chaos, Discord, Confusion, Bureaucracy, and The Aftermath.
The discordian week has 5 days: Sweetmorn, Boomtime, Pungenday, Prickle-Prickle, and Setting Orange. Every year begins with Sweetmo... |
Task
Given two positive integers, output the number of carries needed to add them together in long addition in base 10.
Examples
¹¹¹ <-- carries
999
+ 1
----
1000
Three carries are needed.
¹
348
+ 91
----
439
One carry is needed.
Testcases
999, 1 -> 3
398, 91 -> 1
348, 51 -> 0
348, 52 -> 2
5, 15 -> 1
9... |
Challenge
Given the formula of a chemical, output the Mr of the compound.
Equation
Each element in the compound is followed by a number that denotes the number of said atom in the compound. If there isn't a number, there is only one of that atom in the compound.
Some examples are:
Ethanol (C2H6O) would be C2H6O where ... |
Thanks to MD XF's recent challenge, we can now read passwords in many different languages! The problem is, now we need to port our applications to mobile devices, and they do password entry a little differently.
Challenge
Read a string from the keyboard.
Each time a characterk is entered, display it for a short time i... |
A while ago, I posted a challenge asking to determine whether or not it's possible to arrange arbitrary rectangles to fill a rectangular space, here. That got answers, so clearly it was too easy. (Just kidding, it was fairly challenging, congrats to the answerers :D)
Challenge
Given a bunch of arbitrary shapes (consist... |
Despite having 17 questions tagged anagrams, we still don't have this question, so here it is.
Your Task
You must write a program or function that, when receiving a string, prints out all possible anagrams of it. For the purposes of this question, an anagram is a string that contains the same character as the original... |
Your Task
Write a program that displays a dot that moves toward the position of your mouse at 4 pixels per second. The dot must be 100 pixels big and the window must fill the computer screen.
Input
None
Output
A window showing an animated dot moving towards the mouse at a fixed, non-changing speed.
Scoring
This is code... |
This question is heavily based off this question, but should pose a number of additional difficulties.
Your Task
You must write a program or function that, when receiving a string, prints out all possible anagrams of it. For the purpose of this question, an anagram is a string that contains the same character as the o... |
Given an input string S, print S followed by a non-empty separator in the following way:
Step 1: S has a 1/2 chance of being printed, and a 1/2 chance for the program to terminate.
Step 2: S has a 2/3 chance of being printed, and a 1/3 chance for the program to terminate.
Step 3: S has a 3/4 chance of being printed,... |
Your Task
You will write a program or function to return a truthy value if the integer inputted to it is a square repdigit, and a falsy value if it is not. A repdigit is an integer that contains only one digit (e.g. 2, 44, 9999). For the purpose of this challenge, a square repdigit is a repdigit that is the square of... |
Given an input integer n, draw a number snake, that is, a grid measuring n x n consisting of the numbers 1 through n^2 that are wound around each other in the following fashion:
Input n = 3:
7 8 9
6 1 2
5 4 3
Input n = 4:
7 8 9 10
6 1 2 11
5 4 3 12
16 15 14 13
Input n = 5:
21 22 23 24 25
20 7 8 9 10
19 6... |
Your job is to output the html of the current version (at the time of this writing) of the Wikipedia page for Kolmogorov complexity: https://en.wikipedia.org/w/index.php?title=Kolmogorov_complexity&oldid=781950121&action=raw (backup)
This is code-golf, so the shortest code wins.
|
You should code a piece of code that looks like it outputs the language name but actually outputs the name reversed.
E.g. a Python program should look like it outputs Python but should actually output nohtyP.
The winner is the answer with the most upvotes in a week!
|
Your challenge is to write a program or function to output this sequence of numbers.
Output requirements:
Must contain numbers specified above
Must be in order as specified
Numbers must be delimited by whitespace
Shortest code in bytes wins.
|
Create a bijective function between the syntactically valid BF programs and the natural numbers
This means that you will assign each BF program a nonnegative integer (0,1,2,...) in such a way that each number gets a BF program without syntax errors (and without whitespace or comments).
Note that something like Binaryf*... |
In this question each answer will get a "toolbox" that can be used to construct a program/function. The toolbox will consist of two things:
a list of programming languages
a list of valid characters
You must write a valid program/function in one of the languages provided using only the characters in the toolbox. Yo... |
A quotation is "the repetition of one expression as part of another one". In American English, a quotation is surrounded by double-quotation marks ("), as in the previous sentence. However, this rule differs when a quote appears inside another quote. In this case, the inner quote is surrounded by single-quotation marks... |
The Reuleaux triangle is the shape formed by the intersection of three circles, with each circle passing through the others' centers. Regardless of rotation, a Reuleaux triangle's width will always equal the radius of the circles:
Image: Wolfram MathWorld
Write a program that takes a width r as input and displays a Re... |
Problem
Starting from n=2 dice:
Roll n dice, with each number 1 to 6 equally likely on each die.
Check if their sum equals the most probable sum for n dice, that is 3.5*n.
If they're equal, terminate.
Otherwise, print n, and repeat from the start with n+2 dice
Your code doesn't have to do this procedure exactly... |
Intro
So I've been wasting my time again researching suffix sorting algorithms, evaluating new ideas by hand and in code. But I always struggle to remember the type of my suffixes! Can you tell me which type my suffixes are?
Left-most what?
A lot of suffix sorting algorithms (SAIS, KA, my own daware) group suffixes int... |
Problem
Inspired by a previous challenge doing something similar
Given positive integer input n output a shape that follows this pattern:
input n=1:
* *
*
* *
input n=2:
** **
****
**
****
** **
input n=3:
*** ***
*** ***
*****
***
*****
*** ***
*** ***
and so on...
It has these properties:
n*2+1... |
Given a list of integers, group the elements which occur most first, then group the next most and so on until each unique element in the list has been grouped once.
Examples:
Input: [1,2,3]
Output: [[1,2,3]]
Input: [1,1,1,2,2,3,3,4,5,6]
Output: [[1],[2,3],[4,5,6]]
Input: [1,1,1,4,5,6,6,6,7,7,8,8,8,8,8,8,8,9,5,6,5,6,... |
Given a number n, generate the first n columns of this pattern:
#
# #
# # # #
# # # # # # # #
# # # # # # # # # # # # # # # #
################################ ...
The height of the column at (1-indexed) n is the numb... |
Note: the title was misspelled intentionally.
Given a string s, swap the first vowel runs of every 2 words. For this challenge, y is considered a vowel.
For example, given an input of "great day sir":
1. Input: "great day sir"
2. Identify pairs of words: "[great day] [sir]" (No word for sir to pair with)
3. Identify th... |
Challenge
My challenge, is for you to generate a Menger Sponge based on the level/iteration given. You need to draw it in 3d, anyway you can.
Examples
Inputs: 0, 1, 2, 3
Outputs:
Background Information
What is a Menger Sponge
In mathematics, the Menger sponge (also known as the Menger universal curve) is a fractal c... |
Adam West passed away, and I'd like to honor his memory here on PPCG, though I doubt he knew of our existence. While there are many, many different things that this man is known for, none are more prominent than his role as the original batman. I'll always remember my step-father still watching the old-school Batman an... |
Overview
Your goal is to implement RC4 encryption. RC4 encryption, invented by Ron Rivest (of RSA fame), was designed to be secure, yet simple enough to be implemented from memory by military soldiers on the battlefield. Today, there are several attacks on RC4, but it's still used in many places today.
Your program s... |
Your Task:
You all know what a magic square is! But what about a magic cube? A magic cube is the 3D version of a magic square, and is a set of numbers in a cube, where the sums of every straight (not diagonal) line are equal. You must write a program or function that receives an integer, and returns the number of va... |
Background
Ramanujan's number, \$1729\$, is called a taxi-cab number due to the (possibly apocryphal) tale of Hardy boarding a cab to visit Ramanujan in hospital having this number, which seemed bland to him.
It's since known as the most famous of a class of integers known as "taxicab numbers" which are expressible as ... |
Problem
given input a,b,c
where a,b,c are positive even integers
and a > b > c
Make a box of any allowed character with dimensions a x a
Center a box of a different allowed character with dimensions b x b within the previous
Center a box of another different allowed character with dimensions c x c within the previous
... |
Your challenge is given an input of a prison layout to work out whether any of the prisoners can escape.
Input
Input may be in any reasonable format such as a string, array, array of arrays etc. The input will consist of three characters, in this case #, P and space. The input will not necessarily contain all three cha... |
Write a function (not a full program), so that if the function is called with a single global variable (or your language's closest equivalent) as its argument, it outputs (i.e. prints or returns) the name of that variable. If the argument is not a variable, output a falsey value instead. (You don't have to handle the c... |
Calculate the area of a polygon.
Inspired by this shoelace algorithm video.
Task
Your job is to create a program or function that calculates the area of a polygon. Program or function is defined according the the default definition in meta.
Input
You will receive the X and Y coordinates of each vertex of the polygon. Y... |
Your Task:
Write a program or function to check if a number that is inputted is a Fibonacci number. A Fibonacci number is a number contained in the Fibonacci sequence.
The Fibonacci Sequence is defined as:
F(n) = F(n - 1) + F(n - 2)
With the seeds being F(0) = 0 and F(1) = 1.
Input:
A non-negative integer between 0 a... |
In Haskell the list notation:
[a,b,c]
Is just syntactic sugar for:
a:b:c:[]
And the string notation:
"abc"
Is just syntactic sugar for:
['a','b','c']
This means that the string:
"abc"
Is the same as:
'a':'b':'c':[]
Task
Given a string you should output what the de-syntaxed version would look like in Haskell.
Rule... |
A simple one:
Take a list of positive integers as input and output the numbers modulus their 1-based index in the list.
If the input integers are {a, b, c, d, e, f, g} then the output should be {a%1, b%2, c%3, d%4, e%5, f%6, g%7} where % is the modulus operator.
Test cases:
10 9 8 7 6 5 4 3 2 1
0 1 2 3 1... |
Given Google's recent announcement of official Kotlin support for Android development, I thought it might be timely to poll the community for some awesome golfing tips for this relatively new JVM language.
Kotlin includes a unique combination of features among it's JVM siblings which makes it potentially attractive for... |
Backstory:
I think that my boss might finally realize that I don't any enough work, despite being paid by the hour. I want to throw him off track, by writing as many valid programs as I can to send to him. Unfortunately, due to budget cuts, my keyboard only allows each key to be pressed once.
Specification:
Write as ma... |
Challenge
You must write a program that takes a positive integer n as input, and outputs the nth Fibonacci number (shortened as Fib# throughout) that contains the nth Fib# as a subtring. For the purposes of this challenge, the Fibonacci sequence begins with a 1.
Here are some examples that you can use as test cases, or... |
First, a mathematical interlude, short, and worth your while:
If 0 < a < 4, the logistic function f(x) = ax(1-x) maps the interval [0,1] inside itself. This means that one can play the iteration game; for instance, if a=2, the initial value 0.3 becomes 0.42, then 0.4872, etc.
As the parameter a increases, the quadratic... |
– of crisis and martyrdom
(that's the subtitle because subtitles are cool)
In this king-of-the-hill challenge in python (yup; you need go no farther to know you may not submit in java), you need to create a bot that plays a game very similar to welcome to the dungeon
Game Rules
(note that this is not the original game)... |
Your Task:
Write a program or function that, when given a number, outputs its persistence. The persistence of a number is the number of times you can add its digits before arriving at a one-digit number. All one digit numbers have a persistence of 0. Note that this is different from questions about finding the digit... |
Challenge
Given an integer n (where 4<=n<=10**6) as input create an ASCII art "prison door"* measuring n-1 characters wide and n characters high, using the symbols from the example below.
Example
╔╦╗
╠╬╣
╠╬╣
╚╩╝
The characters used are as follows:
┌───────────────┬─────────┬───────┐
│ Position │ Symbol │ Char ... |
From the sandbox!
I2c or TWI, is a 2 way stream that uses 2 signal lines: SDA and SCK. This is used in sensors to communicate between a master and a slave.
So, how does this work? Well, here's the boilerplate:
Input:
1 I2c command represented by 2 strings where - is a high signal, and _ is low. SDA is always the fi... |
Choi Hong Hi died on the 15th June 2002 at the honorable age of 83. He founded Taekwondo.
15 years after his death, I would like to be a Taekwondo master. This is my time to shine !
Task
Given a string you should output a Taekwondo version.
Rules
You will receive a non-empty string/sentence by any valid input
You mus... |
Given three integers >= 2, create an ASCII cube in an orthogonal (cabinet) projection.
The three integers represent height, width and depth (measured in visible characters) including the corners. The corners should be 'o's or '+', free choice.
w: 10, h: 5, d: 4
Thus gives:
o--------o
/ /|
/ / |
o... |
Given a positive square number as input. Output the number of values between the input and next highest square.
Example
Input: 1
Output: 2
Reason: The numbers 2 and 3 are between 1 and 4, the next highest square
Input: 4
Output: 4
Reason: The numbers 5, 6, 7, 8 are between 4 and 9
|
Take a positive integer n as input, and output a n-by-n checkerboard matrix consisting of 1 and 0.
The top left digit should always be 1.
Test cases:
n = 1
1
n = 2
1 0
0 1
n = 3
1 0 1
0 1 0
1 0 1
n = 4
1 0 1 0
0 1 0 1
1 0 1 0
0 1 0 1
Input and output formats are optional. Outputting the matrix as a list of lists i... |
You're a farmer and your flock of sheep has escaped! Oh no!
Round up those sheep by building fences to contain them. As a farmer on a budget you want to use the least amount of fence possible. Luckily for you though, they aren't the smartest sheep in the world and don't bother moving after having escaped.
Task
Given... |
In 2014, demoscener Jakub 'Ilmenit' Debski released a 250-byte(1) procedural graphics demo for the Atari XL called Mona. It's drawing the following picture(2):
Your task is to generate the exact same picture, using the language of your choice.
(1) Breakdown: 136 bytes of data + 114 bytes of code.
(2) The original pic... |
I'm supposed to sort a list of numbers, but I'm super lazy. It's really hard to figure how to swap all the numbers around until all of them are in increasing order, so I came up with my own algorithm that will guarantee that the new list is sorted¹. Here's how it works:
For a list of size N, we'll need N-1 iterations. ... |
Overview
In the US, the common denominations are the penny ($0.01), the nickel ($0.05), the dime ($0.10), the quarter ($0.25), one dollar, two dollars (less common but lets pretend it's common), five dollars, ten dollars, twenty dollars, fifty dollars, and one hundred dollars. ($1 to $100 respectively).
Your goal is ... |
You are an enterprising dot who wants to increase the land under its control. This is quite simple - travel outside your current land and loop back into your land and everything in that loop is now owned by you. But there is a catch. If some other dot somehow finds your loop and crosses it, you die.
If you haven't alre... |
The challenge
The plastic number is a number related to the golden ratio, with many interesting mathematical properties. As such, there are many approaches that can be used to calculate the number.
In order to precisely specify the number for the purposes of this challenge, we'll use the following definition (although ... |
Task
Given two integers \$d\$ and \$n\$, find the number of ways to express \$n\$ as a sum of \$d\$ squares. That is, \$n = r_1^2 + r_2^2 + ... + r_d^2\$, such that \$r_m\$ is an integer for all integers \$1 ≤ m ≤ d\$. Note that swapping two different values (e.g. \$r_1\$ and \$r_2\$) is considered different from the o... |
Challenge
Given a single letter (a-z) as input, output the 2 lines of Blackalicious' Alphabet Aerobics that correspond to that letter (ignoring the intro & outro).
Rules
You may take input by any reasonable, convenient means as long as it's permitted by standard I/O rules.
Input must either be case insensitive or con... |
Introduction
On the 26th of August, 2017, Floyd Mayweather, Jr. will face up to Conor McGregor in a boxing match.
Both participants will receive the phenomenal amount of 100 million dollars!
Unfortunately, we do not have the money yet, but we can already prepare the big briefcase that will contain all the banknotes.
... |
The task is to compute OEIS A005434 as quickly as possible.
Consider a binary string S of length n. Indexing from 1, we can determine if S[1..i+1] matches S[n-i..n] exactly for all i in order from 0 to n-1. For example,
S = 01010
gives
[Y, N, Y, N, Y].
This is because 0 matches 0, 01 does not match 10, 010 mat... |
The N-bonacci sequence, originally invented by @DJMcMayhem in this question, is a sequence generated by starting with the integers 0 and 1, and then adding the previous N numbers to generate the next number. The special N-bonacci sequence is an N-bonacci sequence beginning with a pair of numbers other than 0 and 1, wh... |
This is code golf. For this challenge, I will accept a method (you don't need a full program), but the method signature does count towards the byte count and I want to see the full signature (not a lamdba). The input for the method is an integer array with 81 elements. The output/return value from the method is a strin... |
Given a string as input, output the string with the following algorithm applied:
1. Split the String by " " (find the words): "Hello World" -> ["Hello","World"]
2. Find the vowel count of each component: [2,1] ( ["H[e]ll[o]","W[o]rld"] )
3. For each of the components, output the first n letter where n is the number
... |
As is well known,
Chuck Norris counted to infinity. Twice
Besides,
Chuck Norris can count to infinity backwards.
Also, although perhaps less known, Chuck Norris can speak a little Spanish in addition to English.
The challenge
Write a program (or function) that can be run in two different languages. In one language ... |
This question is based on a question I asked in Spanish language. Yes, I asked for an algorithm in Spanish Language. :)
In Spain, current license plates have this pattern:
1234 XYZ
where XYZ are three consonants taken from the full set of Spanish consonants (except the 'Ñ', I think).
Sometimes, when traveling with ... |
Write a program/function/script that takes a natural number i from 1 to 10 as input and outputs the URL of the Question with the i th hottest question on the Code Golf Portal
The ordering should be like in https://codegolf.stackexchange.com/?tab=hot.
For example:
input 1
output https://codegolf.stackexchange.com/quest... |
The task
Your program will be given the following inputs: a number n, and an array of n positive integers. Your program only has to work when n=1000.
The program must do the following:
If the input array is a permutation of the range [1, 2, …, n], output Huh!?
Otherwise, return a three-element array [i, j, n], where i... |
A Cullen Number is any number that is contained in the sequence generated using the formula:
C(n) = (n*2^n)+1.
Your Task:
Write a program or function that receives an input and outputs a truthy/falsy value based on whether the input is a Cullen Number.
Input:
A non-negative integer between 0 and 10^9 (inclusive). ... |
The least common multiple (LCM) of a set of numbers A is the smallest integer b such that b/a is an integer for all integers a in A. This definition can be extended to rational numbers!
Task
Find the smallest positive rational b such that b/a is an integer for all rationals a in the input.
Rules
Standard loopholes are... |
Given n numbers in an array (you can't assume they are integers), I would like to compute the product of all subsets of size n-1.
You can do this by multiplying all the numbers together and then dividing by each one in turn, as long as none of the numbers is zero. However, how quickly can you do this with no division... |
It's really frustrating when I'm working and I have a ton of windows open that are completely or partially hidden behind other windows. To make things worse, I'm still using two 1024x768 monitors.
Your task is to take a list of coordinates that designate the area, in pixels, on a screen, that a list of windows occupy a... |
Introduction
A farmer needs help calculating the least time it will take him to pick his fruit each day.
Challenge
This farmer has X orchards.
Each orchard has Y fruits in it. If the orchard has no fruits, then it will contain the string "none".
The farmer has a list, this list contains the fruit he must pick.
The f... |
Define a 1-indexed sequence as follows:
A083569(1) = 1
A083569(n) where n is an integer greater than 1, is the smallest integer m not occurring earlier such that m+n is a prime number.
Your task is to take in n and return A083569(n).
n A083569(n)
1 1
2 3
3 2
4 7
5 6
6 5
7 4
8 9
9 8
10 13
11 12
12 ... |
Andrew is a chemist, interested in the acidity of solutions and in agriculture. After months of research (Google is not his friend), he came up with the following table* regarding the human-readable level of acidity in terms of the pH (potential of Hydrogen):
Denomination | pH range
... |
Let n and b be positive integers larger than 1.
Output the distance from n to the next power of b.
For n=5 and b=3, the next power of 3 from 5 is 9 (3^2 = 9), so the output is 9 - 5 = 4.
For n=8 and b=2, the next power of 2 from 8 is 16 (2^4 = 16), so the output is 16 - 8 = 8. Note that n is a power of 2 in this exampl... |
See also: Granma loves Ana
You will be given a string of lowercase ASCII letters. Using this dictionary file (UPDATED), your task is to solve the anagram. To solve an anagram, you must output all words or groups of words that can be formed using each letter from the input string exactly once, separated by newlines. Gro... |
Write a function or program that determines the cost of a given string, where
the cost of each character equals the number of how many times the character has occurred up to this point in the string, and
the cost of the string is the sum of its characters' costs.
Example
For an input of abaacab, the cost is computed... |
Let's for once do something useful.
Given the text from a Try It Online codegolf submission, produce the equivalent Chat Mini Challenge submission, which is of the form
Language, N bytes: [`code`](URL)
or (if submission is a single byte – TIO will add a trailing s on the first line only if needed)
Language, 1 byte: [`... |
Task:
Return an array with all possible pairs between the elements of an array.
Example
From a=["a", "b", "c", "d"]; return b=[["a","b"],["a","c"],["a","d"],["b","c"],["b","d"],["c","d"]].
Pairs can be in any order as long as all possible combinations are included and obviously ["b","d"] is the same to ["d","b"].
Inpu... |
It's not too important anymore, but occasionally somebody needs to know.
Here is a simple golf: Taking no user input, tell me if the computer on which the code is run is on a 64-bit operating system, or a 32-bit operating system!
If the code is run on a 32-bit operating system, print "32", if the code is run on a 64 bi... |
Background
A Lyndon word is a non-empty string which is strictly lexicographically smaller than all its other rotations. It is possible to factor any string uniquely, by the Chen–Fox–Lyndon theorem, as the concatenation of Lyndon words such that these subwords are lexicographically non-increasing; your challenge is to ... |
This is a pretty run of the mill question. I will define a sequence and you golf some code to output a entry given a index.
The first item in the sequence is 2.
The nth item in the sequence is the smallest positive integer other than n and 1 sharing at least one factor with n (other than 1) that has not already appea... |
Challenge
Given a positive integer, determine whether that number is currently being used to represent a question on PPCG.
The question must not have been removed, but may be open or closed.
The number is the one being used in the URL of the question, such as:
https://codegolf.stackexchange.com/questions/[input]
Note... |
Consider three sets A, B and C each containing n integers. From this we can make the set
S_n = {a * b + c | a in A, b in B, c in C}.
Given an n, there are one or more minimal sized S_n which depend on which sets A,B and C have been chosen.
The sets can contain any n distinct integers (positive, zero or negative). ... |
We start with a blank 1-indexed sequence:
_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,...
In the nth step, we fill in every a(n) blanks with the integers greater than 1 starting at the first remaining blank, where a(n) is the nth entry in the sequence.
After the first step:
2,_,3,_,4,_,5,_,6,_,7,_,8,_,9,_,10,_,11,... |
The challenge: output this exact ASCII art of a spiderweb in a window:
_______________________________
|\_____________________________/|
|| \ | / ||
|| \ /|\ / ||
|| /\'.__.' : '.__.'/\ ||
|| __.' \ | / '.__ ||
||'. /\'---':'---'/\ .'||
||\ '. /' \... |
Problem
Given no input write a program or a function that outputs or returns the following string:
(<(<>(<>.(<>.<(<>.<>(<>.<>)<>.<>)>.<>).<>)<>)>)
Rules
Shortest program wins.
Trailing whitespace allowed.
Trailing newlines allowed.
Unused parameters for functions allowed.
|
The task
In this challenge, your task is to determine whether some string occurs as a substring of a given string both surrounded by another string and reversed.
Your input is a non-empty string S of lowercase ASCII letters.
If there exist non-empty strings A and B such that the concatenation ABA and the reversal rev(B... |
Given a string, return a table where the first column has the unique letters of the string in order of occurrence and subsequent columns list the indices of that letter in the string, using zero or one-based indexing. Horizontal whitespace does not matter, as long as the left-most column is vertically aligned. Indices ... |
Vim is a great text editor for unix systems, but it's notorious for being difficult to exit.
Write a full program that will output :q to exit Vim. It should then read a single line of input, as it will then either be given a bash prompt, in which case the exit was successful, or an error, in which case there are unsave... |
Okay, so everyone is familiar with the ASCII-table, correct? I'd hope so. I've been going to that site for my asciitable reference for as long as I can remember needing one. We'll be doing some fun source-code manipulating using the ASCII keyspace.
The Task
Your task is to write a program that, when executed, prints t... |
You host the Olympic Games, and need to build a fantastic pool for the sake of the occasion, but the supervisors often change their mind regarding the dimensions, and need a quick way to rebuild it with the requested size!
Given two integers, L and x, your task is to build a swimming pool of length L and x lanes.
How ... |
Background
The number 1729 is the Hardy-Ramanujan number. An amazing property of it was discovered by S. Ramanujan (who is widely regarded as the greatest Indian mathematician1), when G.H. Hardy paid a visit to him in a hospital. In Hardy's own words:
I remember once going to see him when he was ill at Putney. I had r... |
Create a program which when run displays the text below:
)-*-*-*^_^*-*-*-(
| Welcome User! |
)-*-*-*^_^*-*-*-(
Use any functions or language to answer this, have fun. Shortest code wins
|
Assuming StackExchange doesn't decide to restore my account after deleting it due to age restrictions (even though I'm 14 already and almost 15 ಠ_ಠ), a lot of people on this site just lost reputation from my upvotes being deleted. This happened at around 5:30 PM on June 20th, 2017, UTC.
So, your challenge is to show ho... |
Given a non-empty string s, with even length, and a positive integer n, representing its height, compose a pyramid using the following rules:
The pyramid should contain n non-empty lines; trailing newlines are allowed. For each 1 <= i <= n, the i-th line should contain the string with each individual character repeated... |
Objective
To flip the rows and columns of a table in a code-golf challenge.
Instructions
You will be passed a "table" of 3 arrays/lists with 3 items each as input. Your job is to flip the rows and columns on it by writing a program that can do this efficiently and creatively. You will flip the "table" according to the ... |
Story
I need to remember a lot of passwords and don't want to use the same one for multiple websites so I came up with a rule, but the rule shouldn't be transparent so what I do is:
Think of a long word or concept such as breadpudding.
Replace the first letter with the site we are logging into. If we are logging into ... |
Given a string whose length is divisible by 4, make a triangle as demonstrate below.
If the string is abcdefghijkl, then the triangle would be:
a
b l
c k
defghij
If the string is iamastringwithalengthdivisiblebyfour, then the triangle would be:
i
a r
m u
a o
s f
... |
Stewie's Game of Life and Fatigue is quite similar to the more famous Conway's Game of Life.
The universe of the Stewie's Game of Life and Fatigue (GoLF) is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of three possible states, alive, dead or tired. Every cell interacts with its... |
Apparently, we really like printing the alphabet in different languages.
How about the Russian Cyrillic alphabet?
Print/output/return this exact text (trailing whitespace is permitted)
АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя
This is the Russian Cyrillic alphabet with upper and lower case int... |
This question is based on what I came up with to answer another question.
Sometimes the questions here ask to draw some ASCII art. One simple way to store the data for the art is RLE (run-length encoding). So:
qqqwwwwweeerrrrrtttyyyy
becomes:
3q5w3e5r3t4y
Now to draw a big ASCII art you maybe be getting data like t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.