instruction stringlengths 34 53.1k |
|---|
Write a program or function that takes in a single-line string. You can assume it only contains printable ASCII. Print or return a string of an ASCII art rocket such as
|
/_\
|E|
|a|
|r|
|t|
|h|
|_|
/___\
VvV
with the input string written from top to bottom on the fuselage. In this case the input was Earth.... |
Currently at my work we moved to a new building. It's supposed to be state of the art and has automatic lights, automatic roll-down shutters, and is now known as the most eco-friendly building in this town.
However, it doesn't really work all that well.. The roll-down shutters sometimes go down on cloudy days and up wh... |
Write a program that prints the name of its source file. REPL environments are not allowed for this challenge. Your code must work in any file that your language's interpreter will accept. Your answer must also be a full program, not just a function. The source code's file extension must be printed. Leading or trailing... |
Is there any better way to golf this (other than removing newlines/indentation)?
function(a,b,...)
local c=s(a,b)
local d=c
for i,v in ipairs{...} do d=d:push(v) end
return c
end
I'm particularly bothered by the double local usage, but as Lua does not have multiple assignment, and I cannot use function paramet... |
The International Standard Atmosphere (ISA) is a model of the Earth's atmosphere at "reference" conditions. It includes information on pressure, temperature, and density change vs. altitude.
The ISA tabulates these properties at various layers, and an estimation of the value of interest can by found by the following pr... |
As we know, a quine is a program that outputs its own source code. However, it's also possible to write a program that outputs another, different program, that outputs the first program again. For example, the Python 2 program
x = '''x = {}
print 'print '+'"'*3+x.format("'"*3+x+"'"*3)+'"'*3'''
print 'print '+'"'*3+x.fo... |
I have a problem for a cyber club that asks you to print:
ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"!
Using Brainf**k in 29 bytes or less without using the ',' character.
I have a working code:
++++++++++[>++++++>+++++++++<<-]>-->.<[>-.<-]
However my loop is too long, sending me 16 bytes over the limi... |
In cryptography, PKCS#7 padding is a padding scheme which adds a number of bytes N ≥ 1, where the value of each added byte is equal to N.
For example, Hello, World!, which has 13 bytes, is the following in hex:
48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21
If we choose to PKCS#7 pad to length 16, then the result is:
48 65 6C... |
This puzzle is derived from CodinGame SamSi's "Heart of the City" puzzle.
Description
You decide to take a walk in an n * n tile city and go to the center tile. All of the buildings are infinitely small, but you have super vision and can see everything close up and far away.
Constraints
n is always odd
You can see any ... |
This challenge is related to Flipping Pancakes.
You may have heard of pancake sorting, where a stack of pancakes is sorted by size by inserting spatula into the stack and flipping all of the pancakes above the spatula, until the pancakes are sorted smallest to largest on the plate. The burnt pancake problem is slightly... |
Given a list of paths, output the correct path.
Example of path:
/\
----+/
|
- and | are horizontal and vertical paths.
/ and \ are 90° turns.
+ is treated as a - or a | depending of the current direction.
Paths may go in any direction and a character may be used in multiple paths.
Input will be like this:
... |
For a positive integer n with the prime factorization n = p1^e1 * p2^e2 * ... pk^ek where p1,...,pk are primes and e1,...,ek are positive integers, we can define two functions:
Ω(n) = e1+e2+...+ek the number of prime divisors (counted with multiplicity) (A001222)
ω(n) = k the number of distinct prime divisors. (A001... |
Consider the infinite string of all nonnegative decimal integers concatenated together in order (akin to Champernowne's constant):
0123456789101112131415161718192021222324252627282930...979899100101102103...
Write a program or function that takes in a nonnegative integer that indexes (0-based) into this infinite strin... |
Implement a simple integer operation scriptable calculator.
Concept
The accumulator starts at 0 and has operations performed on it. At the end of the program output the value of the accumulator.
Operations:
+ adds 1 to the accumulator
- subtracts 1 from the accumulator
* multiplies the accumulator by 2
/ divides the a... |
Disclaimer
While I know there is this particular related question, my question uses two garage doors, a randomizing component, and I'm also basing this on real life events, seeing my son accidentally lowered one of said garage doors whilst I was walking out of the garage last week... Nothing like a blow to the head to ... |
You're given a hexagonal grid of the characters . and #, like this:
. . . . . . . .
. . . . # . . .
. # . . . # . .
. . . # . . . .
. . . . . # . .
. . . . . . . .
Your task is to fill the entire axis-aligned bounding box of the # with further #:
. . . . . . . .
. . # # # # . .
. # # # # # . .
. . # # # # # .... |
The stock market is all about the speed of knowledge. Unlike previous challenges, the current stock price is not random: it is determined by those playing the game. If you can identify an under-priced stock before anybody else, then you've written yourself a money-making program.
Price refers to the how much people ar... |
Inspired by this CR question (please don't kill me for browsing CR)
Spec
The probabilities of misspelling a word are:
1/3 of the time don't change the output
1/3 of the time remove a random character
1/3 of the time duplicate a random character
The chance for removing/duplicating a given character in the input should... |
In a programming language of your choice, write a full program that, when run, prints a positive integer N and then modifies its own source file such that the next time it is run it will print N+1.
For example, this (ungolfed) Python 3 program satisfies this behavior:
N = 1
print(N)
with open(__file__, 'r+') as f:
... |
You will be given a list of radii, you must output the area of the smallest rectangle which they will all fit in.
For example, given the list [5,3,1.5] you would output 157.460.
This is the image:
The width is 15.7460 and the height is 10, so the area is 157.460
Rules:
You get the list via stdin or function argument,... |
Write a program or function that takes in a positive integer. You can assume the input is valid and may take it as a string. If the number is any of
123
234
345
456
567
678
789
then output a truthy value. Otherwise, output a falsy value. For example, the inputs
1
2
3
12
122
124
132
321
457
777
890
900
1011
1230
1234
... |
Background:
In finance, the binomial options pricing model (BOPM) is the simplest technique used for option pricing. The mathematics behind the model is relatively easy to understand and (at least in their basic form) it is not difficult to implement. This model was first proposed by Cox, Ross, and Rubinstein in 1979. ... |
Challenge
You must write an encoder (and a separate decoder) which takes a string as input and outputs the string encoded in the style of a strand of DNA.
DNA
DNA is made up of four types of nucleotide:
Adenine (A)
Thymine (T)
Cytosine (C)
Guanine (G)
Adenine and thymine pair up together to make AT or TA. Similarly, ... |
Challenge
Write a program that takes an array of 4 integers (which represents a sequence of numbers generated by a certain algorithm) and returns the next integer that would follow.
We will only be using simple addition, subtraction, multiplication and division algorithms with a constant (i.e non-variable) variation.... |
Challenge description
We've had a few challenges involving the Look-and-say sequence. Quick reminder:
The sequence starts with 1,
Subsequent terms of this sequence are generated by enumerating each group of repeating digits in the previous term,
So the first few terms are:
1 "one"
11 "one one" (we look a... |
It is time to embark on a perilous quest to defeat the British Intelligence. The aim of this challenge is to write the shortest code that will solve a Nonogram.
What is a Nonogram?
The rules are simple.
You have a grid of squares, which must be either filled in black or left blank. Beside each row of the grid are... |
Introduction
A quixel is a quantum pixel. Similar to a classical pixel, it is represented with 3 integer values (Red, Green, Blue). However, quixels are in a super position of these 3 states instead of a combination. This super position only lasts until the quixel is observed at which point it collapses to one of three... |
All credits to Adnan for coming up with this challenge.
My last challenge, before I go on break.
Task
Given positive integer n, if n is odd, repeat / that many times; if n is even, repeat \ that many times.
(Seriously, the testcases would be much clearer than this description, so just look at the testcases.)
Specs
Any... |
Write a program or function that, when given n, will print a spiral n characters long made up of the Latin alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZ repeated as needed. This spiral should run through the alphabet only forwards.
Related to Alphabet Spiral, though the spiral runs through the alphabet forwards and backwards, an... |
Given an input string, output that string with all vowels a, e, i, o and u swapped at random between each other.
For example, in the string this is a test, there are 4 vowels: [i, i, a, e]. A valid shuffling of those vowels could be [a, i, e, i] therefore yielding the output thas is e tist.
About shuffling
All shuffles... |
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
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.