instruction stringlengths 34 53.1k |
|---|
Your task is to write a program or function that detects accents in UTF-8 input. The catch is that your code must be written entirely in an 8-bit character encoding. The code will output a single integer which is the count of the number of accented letters in the input. Since Unicode is huge, the test input will consis... |
As a spin-off to my challenge over at Puzzling, your goal is to output 2016.
Rules:
You must include the numbers 10 9 8 7 6 5 4 3 2 1 in that order. They can be used as individual integers or concatenated together (like 1098), but the 10 may not be separated into 1 and 0 - no character(s) may be present between the di... |
Inspired by the Lego gear ratios challenge by Keith Randall.
I, too, plan on building a giant lego robot that will eventually be able to destroy the other robots in the never-before-mentioned competition.* In the process of constructing the robot, I will be using a lot of gear trains to connect different parts of the r... |
Introduction
Everyone knows the game tic-tac-toe, but in this challenge, we are going to introduce a little twist. We are only going to use crosses. The first person who places three crosses in a row loses. An interesting fact is that the maximum amount of crosses before someone loses, is equal to 6:
X X -
X - X
- X X
... |
The Champernowne constant is a number that is constructed by concatenating the first n numbers, with n tending to infinity. It looks something like this:
0.123456789101112131415161718192021222324252627282930...
Now, I will describe to you the Rien number. It can be thought of as a minimization of the Champernowne cons... |
Japanese kana characters correspond to a single sound in the Japanese language. With the exception of ん (n), every other kana consists of a consonant part and a vowel part. There is a natural ordering to Japanese kana, a sort of "alphabetical order", which is typically arranged in a 10 by 5 table:
| a i u ... |
When I was younger, I use to play a word game called Word chain. It was very simple. The first player chooses a word; the next player says another word that starts with the same letter the previous word ended with. This goes on forever until somebody gives up! Trick is, you cannot use the same word twice (unless everyb... |
Given any of the following characters (or a newline):
`1234567890-=~!@#$%^&*()_+qwertyuiop[]\QWERTYUIOP{}|asdfghjkl;'ASDFGHJKL:"zxcvbnm,./ZXCVBNM<>?
Your program must output the row that it is on the keyboard
Because my keyboard is (almost) out of battery, your code must be as short as possible
The keyboard your pro... |
The purpose of this challenge is to find the general term of a given arithmetic or geometric sequence.
Explanation
The formula for an arithmetic sequence is as follows
an = a1 + (n-1)d
where a1 is the first term of the sequence, n is the index of the term, and d is the common difference between the terms. For a geomet... |
Introduction
In the field of mathematics known as topology, there are things called separation axioms.
Intuitively, you have a set X and a collection of subsets of X, which we can think of as properties.
The system is well separated, if one can distinguish between all items of X based on their properties.
The separatio... |
Given an input of four integers x1, y1,
x2, and y2, output whether a white king in chess
(with coordinates (x1, y1)) could catch a black pawn
(with coordinates (x2, y2)) and capture it if the
pawn is moving to promote to a queen as fast as possible.
The coordinates of the board are as follows:
first coordinate... |
Consider the Atbash transformation:
A|B|C|D|E|F|G|H|I|J|K|L|M
Z|Y|X|W|V|U|T|S|R|Q|P|O|N
Where A ⇔ Z and L ⇔ O, e.g. There is an interesting property that some words share. When some strings are translated to their atbash-equivalent, said translation is the original word reversed. I call these Atbash Self Palindromes.
... |
If you're not familiar, Diceware is a method for creating passwords using an ordinary die from a pair of dice as a hardware random number generator.
For the sake of fun, let's ignore anything about the security of computer's random number generators.
Write a function or program that prints or returns a single five-cha... |
Making a versatile integer printer is nice and all, but writing a single code that prints a lot of different numbers is cumbersome. Wouldn't it be easier to make a script that outputs a number, but also gives you a new script to get the next number?
Challenge:
Write a code that outputs a single integer N and an executa... |
The first Letters, Get Moving! was very popular, but had limited participation. This one will be easier to solve, but hopefully involve some tricks in golfing.
You are given a string of only lowercase letters. For each letter, with position in the alphabet m, move it so it becomes the mth letter from the end. If the va... |
Your task is to create a program which takes a black-and-white outlined image (example images are below) and fills it in with colour. It is up to you how you section off each region and which colour to fill it with (you could even use an RNG).
For example:
As you can see I am clearly an artist of a superior calibre wh... |
Given a unicode character C (or the first character of a string input), output that character's hex representation. Case does not matter. The output ranges from \u0000 to \u9999.
Test cases
A => 41 (65_10 === 41_16)
ʣ => 2A3 (675_10 === 2A3_16)
Ω => 3A9 (937_10 === 3A9_16)
7 => 37 (55_10 === 37_16)
(null byte) => 0 (... |
Every programmer knows that brackets []{}()<> are really fun. To exacerbate this fun, groups of interwoven brackets can be transformed into cute and fuzzy diagrams.
Let's say that you have a string that contains balanced brackets, like [{][<(]})>(()). Step one is to rotate the string 45 degrees clockwise. (In Mathema... |
Description
Here's a very superstitious hotel elevator in Shanghai:
It avoids the number 13, because thirteen is unlucky in the Western world, and it avoids the digit 4, because four is unlucky in parts of Asia. What if this hotel was taller?
Read a positive even integer n from STDIN, representing the n... |
Given the ASCII art of two vectors, find the resultant vector's magnitude and degree.
Input
This can be received via STDIN, read from a local file, or provided through a function call. Here is an example of a two vector input:
^------>
|
|
|
x
This represents a change of 4 units north and 7 units east. Every input's ... |
There are many puzzles with matches that involve adding, removing, or moving a certain number of matches to create new numbers or shapes. This is like that with a digital clock.
Given a valid time on a 12-hour digital clock, output the digit that requires moving the fewest lines to make it so every visible digit on the... |
Every programmer knows that rectangles □ are really fun. To exacerbate this fun, these cute and fuzzy diagrams can be transformed into groups of interwoven brackets.
This challenge is the inverse of my previous.
Let's say you have a group of interlocking rectangles like so:
+------------+
| |
+--+-+ ... |
Actually not inspired neither by Atbash Self Palindromes nor by Generalized Gematria Calculator.
Given a string s of length n, output the Revu'a sequence, which is the first character of s, the first two characters of s, ... the first n–2 characters of s, the first n–1 characters of s, the entire s.
The string will onl... |
You may remember in first or second grade using expanded form to learn about place value of numbers. It's easier to explain with an example, so consider the number 123. In expanded form it is represented as 100 + 20 + 3, which helps a young mind visualize place value. It is reminiscent of how you say it: one hundred (p... |
Inspired by this conversation in chat.
Your goal in this challenge is to emulate a ninja and count how many deaths he has left.
Specs
You ninja starts out with 9 deaths left. He also gets an integral starting health as an input.
Then, he takes as input a list of events in his life that alter his health. These can be ne... |
Based on Chunky vs. Smooth Strings.
Squiggles /\_/\/\__/\/\/\/\_/\_/\ are fun to make on a keyboard when you are really bored. But not all squiggles are created equal. Some squiggles are smooth, like \___/, and some are chunky, like /\/\/\/\. Others are just downright broken, like ////_\\\
Inside every squiggle of N... |
Given an input of two integers n and m, output an ASCII ladder of length
n and size m.
This is an ASCII ladder of length 3 and size 3:
o---o
| |
| |
| |
+---+
| |
| |
| |
+---+
| |
| |
| |
o---o
This is an ASCII ladder of length 5 and size 1:
o-o
| |
+-+
| |
+-+
| |
+-+
| |
+-+
| |
o-o
This is an AS... |
7-segment digits can be represented in ASCII using _| characters. Here are the size 1 digits:
_ _ _ _ _ _ _ _
| _| _| |_| |_ |_ | |_| |_| | |
| |_ _| | _| |_| | |_| _| |_|
Larger sizes are formed by making each segment proportionately longer. Here are a couple size 3 digits.
___ ... |
A list of positive integers can be visualized as a quantized mountain range where each list entry represents the height of one vertical section of the mountains.
For example, the list
1, 2, 2, 3, 4, 3, 5, 3, 2, 1, 2, 3, 3, 3, 2, 2, 1, 3
can become the range
x
x x
xxxxx xxx x
xxxxxxxx xxxxxx x
x... |
This challenge is about printing the abacaba sequence of a specific depth.
Here is a diagram of the first 5 sequences (a(N) is the abacaba sequence of depth N, upper/lowercase is just to show the pattern, this is not needed in the output of your program):
a(0) = A
a(1) = aBa
a(2) = abaCaba
a(3) = abacabaDabacaba
a(4) =... |
Hexagonal grids have been become a fairly popular twist for challenges about 2-dimensional data recently. However, it seems that the equally interesting triangular grids have been largely neglected so far. I'd like to rectify that with a rather simple challenge.
First, how do we represent a triangular grid? Consider th... |
Mr. William Shakespeare wrote plays. A lot of plays. In this tarball containing every single one of his works, each one of his plays is one long file.
It needs to be split into Scenes for a stage production. Because actors are impatient, your code needs to be as short as possible.
Task:
Your task is to write a program ... |
The split-complex numbers, also known as "perplex numbers" are similar to the complex numbers. Instead of i^2 = -1, however, we have j^2 = 1; j != +/-1. Each number takes the form of z = x + j*y.
In one attempt to limit the complexity of this challenge, I will use the symbol - to represent negation, as there will not... |
Introduction
In the strategy game Starcraft 2, there are three "races" to choose from: Terran, Zerg, and Protoss. In this challenge we will be focusing on the Protoss and the iconic phrase "You must construct additional pylons!" This message is stated when you run out of supply to build your army. So, to help out the S... |
A leaper is a category of fairy chess piece which moves by "jumping." A normal knight is a (1,2)-leaper, meaning each move involves moving a distance of 1 square in an orthogonal direction and 2 squares in the perpendicular direction.
.o.o.
o...o
..N..
o...o
.o.o.
There are many different leapers. The (1,3)-leaper is... |
[I decided to salvage Ben Reich's question How many unique ways are there to achieve a score in Football? but it ended up being so different that it's only suitable as its own question not spliced into his.]
Challenge: Given a number, calculate how many order-independent ways there are to score that number as a winning... |
Because rickrolling is the greatest meme on Earth, you [know the rules and so do I] are to write the shortest code that can textually rickroll the unsuspecting reader. Let [you down] there be an input text which contains letters, punctuation, and spaces. Anytime a [lie and hurt you] phrase from the first two stanzas ... |
Your challenge is to format a list of words across multiple lines that are no longer than a given number of characters, so that each line contains as many words as possible and no words are unnecessarily cut off.
Input
The input will be a space-separated list of words and then a number that is at least 4.
Output
The ou... |
While we're on a triangular grids kick, I'd like to point out that there is an equivalent to polyominoes on a triangular grid. They are called polyiamonds, and they are shapes formed by gluing equilateral triangles together along their edges. In this challenge you are going to be deciding which subsets of a triangular ... |
I've been working on another stack-based golfing language called Stackgoat. In this challenge you'll be writing a Tokenizer for Stackgoat (or really any general stack-based languages).
Examples
"PPCG"23+
["PPCG", '23', '+']
'a "bc" +
['"a"', '"bc"', '+']
12 34+-"abc\"de'fg\\"
['12', '34', '+', '-', '"abc\"de'fg\\"']... |
Overview
Given an image in plain PPM (P3) format as input, for each pixel p in the image, replace each of the following 4 pixels' red, green, and blue with the floored average value of the respective channels of all 4 pixels:
p itself
The pixel located at p's location when the image is flipped vertically
The pixel loc... |
Given a number n > 77, write a program or function that finds a set of distinct positive integers such that the sum of the set equals n, and the sum of the reciprocals of the set equals 1.
Example for 80:
80 = 2 + 4 + 10 + 15 + 21 + 28 ⟶
1/2 + 1/4 + 1/10 + 1/15 + 1/21 + 1/28 = 1
Your program or function must... |
Background
Your friend, a linguist, has recorded and analyzed some simple conversation snippets in various languages.
Being quite absent-minded, they have forgotten which language each snippet was in.
You must help them by creating a program that analyzes the sentence structures and rules out impossible cases.
Input
Yo... |
Here's a deceptively challenging geometry puzzle for you!
Given a circle A, and n other circles B[n], find the total area contained within A that is not within any circle of B.
Your code should be as short as possible.
Input
Your input should contain the following information:
A floating-point number to represent the ... |
What could be more polar opposites than chess and demolition derby. You would think that no one who enjoys one would enjoy the other... until today.
Rules
The starting position is a standard chess board:
RNBQKBNR
PPPPPPPP
PPPPPPPP
RNBQKBNR
Looks normal enough, until you find out it's an EVERY PIECE FOR ITSELF, ... |
I like ascii art and I get bored a lot, so I found some ascii characters and started to make random things, 8-bit mario castle, mazes, and arches. I found that the arches could easily be stacked in a neat way.
╔═══════╗
║╔═════╗║
║║╔═══╗║║
║║║╔═╗║║║
╨╨╨╨─╨╨╨╨
Challenge
Create a program, function, or any other standard... |
Given an input of an integer n and a list of positive integers m1,
m2, ..., output a list of integers m1',
m2', ... where mx' is defined as the average of
mx-n through mx+n.
When calculating these averages, ignore indices that are out of bounds (and
adjust what you are dividing the sum by accordingly). n will always be... |
Write a function or program that outputs Quater-imaginary base displayed as binary digits. The number base is 2i, where i is the square root of -1. See Complex Number for more details on i. Each digit position can go from 0 to 3 (quaternary), as each real and imaginary part is -4 times as large as the previous real and... |
Countries own a series of territories on a 1D world. Each country is uniquely identified by a number. Ownership of the territories can be represented by a list as follows:
1 1 2 2 1 3 3 2 4
We define a country's edgemost territories as the two territories closest to either edge. If the above list was zero indexed, cou... |
In Salesforce CRM, every object has 15-character alphanumeric ID, which is case-sensitive. If anyone's curious, actually it's base-62 number.
However, tools used for data migration and integration may or may not support case sensitivity. To overcome that, IDs can be safely converted to 18-character case-insensitive alp... |
Two rows of a matrix are orthogonal if their inner product equals zero. Call a matrix with all rows pairwise orthogonal an orthogonal matrix. A circulant matrix is one where each row vector is rotated one element to the right relative to the preceding row vector. We will only be interested in matrices where the entries... |
Introduction
We've have a few base conversion challenges here in the past, but not many designed to tackle arbitrary length numbers (that is to say, numbers that are long enough that they overflow the integer datatype), and of those, most felt a little complicated. I'm curious how golfed down a change of base code like... |
Challenge:
Write a function or program that accepts a list of boolean values and returns all of the ranges of True's.
Test Cases:
f [F] = []
f [T] = [[0,0]]
f [T,T,F,T] = [[0,1],[3,3]]
f [F,T,T,F,F,T,T,T] = [[1,2],[5,7]]... |
LOOP
This challenge is based around a modified version of the programming language LOOP.
A program may be of any of the following forms:
P;Q, where P and Q are subprograms
Subprogram P is executed, then subprogram Q is executed.
x++, where x is a variable
Variable names are the letter x followed by a whole number... |
The scenario
After a long day's work slogging in the office and browsing stackexchange.com, I finally walk out the door at 16:58, already weary with the day. Because I am still only an intern, my current mode of transportation is on bicycle. I head over to my trusty Peugeot Reynolds 501, but before I can sail away on i... |
Introduction
You're probably familiar with zip bombs, XML bombs, etc. Put simply, they are (relatively) small files which produce enormous output when interpreted by naïve software. The challenge here is to abuse a compiler in the same way.
Challenge
Write some source code which occupies 512 bytes or less and which com... |
This challenge is pretty simple. As input, you take in a regular expression.
Then, you output a truthy/falsey of whether or not your source code matches the regular expression. It's that simple! Just two more things:
No quine builtins; you may, however, access the code's source code by file IO, etc.
This is code-golf,... |
Powerball is an American lottery that has recently gained attention because the current jackpot (as of January 11, 2016) is the largest lotto prize in history, at about $1.5 billion (USD).
Powerball players choose 5 distinct numbers from 69 numbered white balls, and 1 one "Powerball" number from 26 numbered red balls. ... |
You probably do know that the different reputation levels on Stack Exchange are formatted differently when seen from the questions page / a post. There're all the rep-formatting rules:
if a user has 1 to 999 (one to three digits) rep, it's left as-is.
if a user has 1000 to 9999 rep (four digits), it receives the comma... |
Introduction
A229037 has a quite intriguing plot (at least for the first few terms):
There is the conjecture, that it might indeed have some kind of fractal property.
How is this sequence constructed?
Define a(1) = 1, a(2) = 1 then for each n>2 find a minimal positive integer a(n) such that for every arithmetic 3 term... |
Given a string with a multiple people's investment data, find out how much profit/loss they recorded.
The string only contains capital and lowercase letters, like this:
AABaBbba
Each letter represents a person - a capital letter means buy, a lowercase letter means sell. The price of the stock they are investing in (C... |
There's a really important problem in cellular automata called the Majority problem:
The majority problem, or density classification task is the problem of finding one-dimensional cellular automaton rules that accurately perform majority voting.
...
Given a configuration of a two-state cellular automata with i + j cel... |
Introduction
This challenge consists in finding the greatest number removing y digits from the original number n which has x digits.
Assuming y=2 n=5263 x=4, the possible numbers removing y=2 digits are:
[52, 56, 53, 26, 23, 63]
So, the greatest number is 63 which must be the output for this example.
Another logic wo... |
In a fictional 2D world, a set of 2D printing instructions for an object can be represented by a list of integers as follows:
1 4 2 1 1 2 5 3 4
Each number represents the height of the object at that particular point. The above list translates to the following object when printed:
#
# # #
# ###
## ####... |
Sometimes it is useful to run a math problem with multiple inputs. The goal of this challenge is to make a program that eases this task.
Number-generating expressions
You must support 3 types of expression:
Single number generator: Very simple, just a literal number
Multi-number generator: A tad more complicated. Thee... |
People, it's a popularity contest, you have to do somthing cool here.
Think about cool ways of breaking the code in most languages, not about validating for everyting!
Initially this challenge is NOT for esoteric languages. But I didn't disabled them as I expect voters to be fair enough to downvote answers based... |
I was intrigued by the design of this graphic from the New York Times, in which each US state is represented by a square in a grid. I wondered whether they placed the squares by hand or actually found an optimal placement of squares (under some definition) to represent the positions of the contiguous states.
Your code... |
Your goal is to map a piece of text to a sine curve of the form:
a sin ( mx - b )
Where a and m are non-zero rational numbers, b is a rational number, and the calculations are in radians.
It doesn't really matter where the origin of your graph is, as long as you fit all the letters in your output. Also, it must be ASCI... |
Today you need to solve a very practical problem: How many loops do you need to have a certain number of sheets on your toilet paper roll? Let's look at some facts:
The diameter of a bare toilet paper cylinder is 3.8cm
The length of one sheet of toilet paper is 10cm.
The thickness of one sheet of toilet paper is 1mm. ... |
There is an existing "game" where pirates rationally divide gold coins according to certain rules. Quoting from Wikipedia:
There are 5 rational pirates, A, B, C, D and E. They find 100 gold coins. They must decide how to distribute them.
The pirates have a strict order of seniority: A is superior to B, who is superior... |
Given two words, spoonerise them by switching their initial consonant clusters. Fewest bytes wins.
plaster man -> master plan
blushing crow -> crushing blow
litigating more -> mitigating lore
strong wrangler -> wrong strangler
def ghi -> ghef di
few years -> yew fears
The consonants appearing before the first vowel (a... |
Given an input of a list of days of the week, output the shortest sorted
representation of the list.
The format of the input is a string consisting of one or more of the
two-character substrings Su (Sunday), Mo (Monday), Tu (etc.), We, Th,
Fr, and Sa. The input may not necessarily be given in sorted order.
To convert t... |
Task
Write a program that will output another distinct program, and so on, while using as few distinct characters (and as few bytes) as possible.
For example, program 1 should output program 2, and when program 2 is executed, it should output program 3. This can be nested as deeply as needed, but must be at least 3 dis... |
Time for another easy challenge in which all can participate!
The multinomial theorem states:
$$(x_1 + x_2 + \cdots + x_m)^n = \sum_{k_1 + k_2 + \cdots + k_m = n} \binom n {k_1, k_2, \dots, k_m} \prod_{1 \le t \le m} x_t^{k_t}.$$
The expression in parentheses is the multinomial coefficient, defined as:
$$\binom n {k_1,... |
The goal of this challenge is to complete a list of consecutive nested header numbers when given a start and an end. When given 1.1.1 and 1.1.5 you should generate 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5
Specific Rules
Your entry must take in a start, end, and multiple optional range parameters. Parameters can be taken fo... |
Challenge:
Some ascii-art is a pain to make, but makes code comments easier to read, especially when the code is dense. The challenge is to make a simple tool that converts comments to simple ascii-art with arrows. The comments to modify are delimited by empty comments.
For example, supposing Haskell comment syntax, co... |
Newton's theory of gravitation says that the gravitational force between two point masses is
F=(Gm1m2)/ r2
Where
G is the gravitational constant: 6.674×10−11 N · (m/kg)2
m1 is the mass of the first object
m2 is the mass of the second object
r is the distance between their centers of mass
Challenge
You need to simul... |
I've been around for a while, watching you golf and I really enjoy it.
I came up with a challenge for you all so let's begin!
Challenge
I assume that everyone knows what Finite State Machine (FSM) is, I will edit the the description if needed.
Your program will take only one input consisting in a string that represent... |
A while ago I purchased a new wallet which is able to hold 8 cards (4 on both side). However, I seem to have way more cards than that and I need to make choices on which ones I want to carry with me. Some cards I use more often than others, but the cards I prefer to carry with me are not necessarily the ones I use most... |
We've had a couple of challenges about the Ulam spiral. But that's not enough.
In this challenge we will plot a triangular Ulam spiral (as opposed to the usual, square Ulam spiral). Here's a sketch of what the spiral looks like.
As we know, the Ulam spiral arranges all natural numbers in an outward spiral, and marks o... |
Inspired by this question over on Math.
Let the prime factorization of a number, n, be represented as: \$P(n) = 2^a\times3^b\times5^c\times\cdots\$. Then the number of divisors of n can be represented as \$D(n) = (a+1)\times(b+1)\times(c+1)\times\cdots\$. Thus, we can easily say that the number of divisors of \$2n\$ is... |
A nonogram is a Japanese puzzle game in which the goal is to draw a black-and-white picture according to a list of contiguous regions, like so:
Define the nonographic magnitude of a row or column to be the number of contiguous black regions in that row or column. For example, the top row has a nonographic magnitude of... |
Given an input of a string consisting entirely of qs representing quarter
notes and es representing eighth notes, output the indices of the quarter
notes that are syncopated.
Syncopation is complex, but for
the purposes of this challenge, our definition of "syncopated" will be very
simple: a quarter note that starts on... |
In this challenge, you will write a program which outputs a program which is the double the length of the original program. The outputted program should output a new program a program double its length.
Examples
If my program is a:
< a
> aa
< aa
> aaaa
< aaaa
> aaaaaaaa
Rules
No quine built-ins
The original program... |
About Functional-Basic
Functional-Basic (FB for short) is a language that only allows numbers and lists. Basic features, such as the if statement are missing in an attempt to simplify the language.
Everything in this language is immutable. input is always assigned to the script input, which can be either a number or a ... |
Task
Read the contents of a table given a set of coordinates.
Table formatting
Tables will be in this basic format:
|[name]|[name]|
---------------------
[name]| [val]|[val] |
[name]| [val]|[val] |
Column names are always unique within columns. Row names are also unique within rows. This includes names that are ... |
Your challenge is extremely simple. Given a year as input, print all the months in that year that will contain a Friday the 13th according to the Gregorian calendar. Note that even though the Gregorian Calendar wasn't introduced until 1582, for simplicity's sake we will pretend that it has been in use since 0001 AD.
Ru... |
Introduction
RNA is the less famous cousin of DNA.
Its main purpose is to control the production of proteins in cells through a process called translation.
In this challenge, your task is to implement a part of this process where the RNA is split into codons.
This challenge is thematically related, but concentrates on ... |
CleverBot is a conversational AI that works fundamentally by repeating responses from real humans it has heard previously. It starts off pretty dumb, but once the database becomes (a lot) larger it begins sounding more like an actual person!
How your program should work
Output Hi!
Receive the user's reply as a string
... |
Introduction
Right now I'm participating a chess tournament. I got inspired by the tournament schedule. Right now, I'm in a competition with three other players. That means with the four of us, we are playing 3 rounds. The schedule goes as following:
Round 1: 1-4 3-2
Round 2: 3-4 2-1
Round 3: 1-3 4-2
This is also know... |
This challenge is based on the idea of Plouffle's Inverter.
Write a program in any language that does the following:
Takes as input a non-negative rational number X written in decimal, for example 34.147425.
Returns a mathematical expression using only non-negative integers, whitespace, parentheses, and the following ... |
For this challenge, you need to print out the fingerings for various brass instruments.
The notes an instrument can play (as well as their fingerings) are listed below:
Cornet Baritone
Trumpet Bugle French Horn Euphonium Tuba
A#0 0
B0
C1 ... |
You have a phone plan that lets you talk 180 minutes a day. Every day that you go over your daily limit you have to pay a fine of F = Men, where M is the number of minutes you went over and n is the number of days you have gone over (e.g if I went 20 minutes over the daily limit and it's my 2nd day going over, I have t... |
John Doe used to be one of the fastest QWERTY keyboard typists in the world, but a recent head injury caused by a stampeding herd of downgoats has critically hampered his ability to type accurately. In a desperate effort to retain his reputation as a typing prodigy, he has tasked us with the creation of a spellchecker ... |
The task is to display ascii table for a given array.
Input
The input is an 2D matrix. The matrix's row length is same with the length of an array. Alternatively, you can take input of an 2D matrix with the first row is a header. The outer dimension is the row.
Example Input:
[["License","2008-05-08","2009-03-11","2011... |
The Sylvester-Gallai theorem says: Suppose you have a finite list of points in the plane. Suppose further that not all of those points are collinear (lie in a single line). Then there is some line containing precisely two of the points. (That is, there's some line on which two of the points lie, but not more than two.)... |
Write a program or function to estimate as closely as possible the number of syllables in English words.
The input list is here: 1000 basic English words. There are only 997 words because a few duplicates were removed.
For each word, output a line containing the word, a comma (,), and the number of syllables and no oth... |
Let z be a complex number. z is an nth primitive root of unity if for a certain positive integer n and for any positive integer k < n .
Challenge
Write a full program or function that, given a positive integer n as input, outputs all of the nth primitive roots of unity. You may output them in polar form (e^θi or e^iθ,... |
Introduction to Bézout's identity
The GCD of two integers A, B is the largest positive integer that divides both of them leaving no remainder. Now because of Euclid's property that each integer N can be divided by another integer M as follows:
there exist pairs u,v such that ... |
Given an input of a string consisting of any message from our site
chatroom taken
from the list described and linked below, output either a truthy or a falsy
value attempting to predict whether that message was starred or not in 50 bytes
or less.
You may use any truthy or falsy
values, but they must be
identical (i.e. ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.