instruction stringlengths 34 53.1k |
|---|
Create a program that, given an integer N, outputs the number of years we have to get to N A.D. or how many years it has been since N A.D, as a string or int. For example, given 2014, the program should output 5 as it has been that many years since 2014. Input of the year in which you run the program should result in 0... |
Make a program that outputs the number of seconds from the beginning of today (00:00:00 of the day you run it) to the second you ran it. However, if this number is divisible by three, print Fizz instead. If it is divisible by five, print Buzz instead. If it is divisible by three and five, print FizzBuzz.
Don't pad the ... |
In the board game Pandemic, an outbreak occurs when a city contains more than 3 disease cubes. When the outbreak occurs, any disease cubes in the city in excess of 3 are removed, and each city connected to it gains one disease cube. This means that chain reactions can, and will occur.
Important note: Each city may onl... |
The Sixers sequence is a name that can be given to sequence A087409. I learned about this sequence in a Numberphile video, and it can be constructed as follows:
First, take the multiples of 6, written in base 10:
6, 12, 18, 24, 30, 36, ...
Next, concatenate the numbers into a stream of digits:
61218243036...
Finally, r... |
Make a snake fill any maze (until it gets stuck).
The snake
The snake starts at a given starting point, pointing EAST. It moves by always having a wall or a part of its body immediately to the LEFT of its head ("left-hand rule wall follower"), until it gets stuck because all four directions around its head are occupied... |
The new site header has some bits of source code from various questions as the background. Here are the first 3 lines:
--<-<<+[+[<+>--->->->-<<<]>]<<--.<++++++.<<-..<<.<+.>>.>>.<<<.+++.>>.>>-.<<<+. Hello, World! IT'S SHOWTIME TALK TO THE HAND "Hello, World!" YOU HAVE BEEN TERMINATED "9!dlroW ,olleH"ck,@ 72a101a+7aa+3a4... |
Given a grid of directions and a start and end position, determine the minimum number of substitutions in the direction grid that needs to be made to complete the path between the two points. The grid is doubly-cylindrical. This is clearer given an example.
Example
Let's take the following grid as an example:
>>>>v
>>>... |
What is the best BrainFuck code (in terms of code size) to print 'A' 1000 times ?
My approach is:
set 'A' to p[0]
set 255 to p[1] to display 255 'A', 3 times
set 235 to p[1] to display 235 'A'
This is not effective but I cannot find a way to use tow counters simultaneously like a multiplication
Is there a better appr... |
Rules
In this challenge, I'm going to redefine the definition of "quotes" a bit.
Quotation marks (AKA quotes) are any identical characters used in pairs in various writing systems to set off direct speech, a quotation, or a phrase. The pair consists of an opening quotation mark and a closing quotation mark, which is t... |
A traveler needs to stay for n days in a hotel outside town. He is out of cash and his credit card is expired. But he has a gold chain with n links.
The rule in this hotel is that residents should pay their rent every morning. The traveler comes to an agreement with the manager to pay one link of the golden chain for e... |
Challenge:
Given an NxN matrix where \$N\geq2\$ and one of eight distinct 'folding options', output a 2D array/list with the subtracted values.
The eight folding options are: left-to-right; right-to-left; top-to-bottom; bottom-to-top; topleft-to-bottomright; topright-to-bottomleft; bottomleft-to-topright; bottomright-t... |
You are given a string, which will contain ordinary a-z characters. (You can assume this will always be the case in any test, and assume that all letters will be lowercase as well). You must determine how many unique combinations can be made of the individual characters in the string, and print that number.
However... |
Introduction
In a general election, one would like to calculate a constant price per parliament seat. This means that for N >= 0 seats to be distributed and a list ns of votes per party, we would like to find a number d such that
sum(floor(n/d) for n in ns) == N
To make things interesting (and more like the real worl... |
In this challenge you will be determining how controversial a vote is, given an array of other votes, by figuring out a number called the C-factor. What is the C-factor, you ask?
Well, imagine you've got multiple votes on an election. We'll use 1 and 0 for the sake of the challenge to represent two different candidates... |
What is the shortest way to convert a string containing integers separated by spaces to a list of integers?
input : "-3 1 5 8 10"
output : [-3, 1, 5, 8, 10]
I regularly face this situation and I wanted to know if there is a better way than (24 bytes):
list(map(int,s.split()))
|
I was surprised to not find this asked already, though there is a great question on darts checkouts: Darts meets Codegolf
Your challenge is to calculate which scores are not possible with 'n' darts below the maximum score for 'n' darts. E.g. for n=3, the maximum possible score is 180 so you would return [163,166,169,17... |
Introduction
A popular word puzzle is to convert one word into another via a series of steps which replace only one letter and which always result in a valid word. For example, BAG can be converted to DOG via a path of five steps:
BAG -> BAT -> CAT -> COT -> COG -> DOG
Shorter paths also exist in this case; for example... |
Premise:
Your reputation is in Stack-Exchange Form if it can be represented by decomposing your medal counts (gold, silver, and bronze counted separately) into their base-10 digits and joining them in any given order, with a few caveats.
While decomposing, each
Gold medal digit is worth three digits.
Silver is worth... |
I need to construct a functor that iterates over the linear representation of a sub-lattice of size \$d_x,d_y,d_z,d_q\$ embedded in a lattice of size \$n_x,n_y,n_z,n_q\$. The sub-lattice corner is shifted by \$(l_x,l_y,l_z,l_q)\$.
Since the functor can be called million of times, the goal is to produce the most effici... |
The prospect of this challenge is:
If your program is run normally, all of the code in the speech marks (" - double quotes) should be printed.
If your program is wrapped in double quotes (in turn inverting the speech marks), the code that is normally not in quotes should be printed.
E.g:
Let's say you have the follow... |
Introduction
How much of the English alphabet does a given string use? The previous sentence uses 77%. It has 20 unique letters (howmucftenglisapbdvr), and 20/26 ≃ 0.77.
Challenge
For an input string, return the percentage of letters of the English alphabet present in the string.
The answer can be in percentage or in ... |
Assume that there is a number a. In every conversion of that number, the number can either convert itself to its value plus the value of one of its digits, or convert itself to its value minus the value of one of its digits.
In this situation, find the minimum number of conversions one has to make in order to get to th... |
An analog clock has 2 hands*: Hour and minute.
These hands circle the clock's face as time goes by. Each full rotation of the minute hand results in 1/12th of a rotation of the hour hand. 2 full rotations of the hour hand signifies a full day.
As these hands are fixed to the same central point, and rotate around that p... |
Based on a comment by Jo King on my previous question (called 'Inverse-quotes-quine'), I present this new question. The rules are similar, but just, the opposite:
If your program is run normally, all of the code not in the speech marks (" - double quotes) should be printed.
If your program is wrapped in double quotes ... |
This challenge is a sequel to Letter Boxed Validator.
The New York Times has a daily online game called Letter Boxed (the link is behind a paywall; the game is also described here), presented on a square as follows:
You are given 4 groups of 3 letters (each group corresponds to one side on the picture); no letter appe... |
There are 9 main types of numbers, if you categorise them by the properties of their factors. Many numbers fall into at least one of these categories, but a few don't. The categories are as follows:
Prime - no integer divisors other than itself and one
Primitive abundant - A number \$n\$ whose factors (excluding \$n\$... |
The problem:
Given a non-empty set of points in the Cartesian plane, find the smallest circle that encloses them all (Wikipedia link).
This problem is trivial if the number of points is three or less (if there's one point, the circle has a radius of zero; if there are two points, the line segment that joins the points ... |
The purpose of this challenge is to graphically depict a walk on the plane, where the direction of each step \$k\$ is determined by the primality of \$k\$ and the parity of its binary expansion. Specifically,
Initial direction is fixed, say North.
All steps have the same length.
The direction of step \$k\$ can be Nort... |
Write a sorting algorithm for a list of integers that has an average performance of O(n^2).
This is code-golf, so the shortest code in bytes wins.
RULES:
The characters wasted for the declaration of the list are not counted
(e.g. var c = new List<int>() { 4, 2, 1, 3 }; is not counted)
Builtins to sort a list are not ... |
Some numbers, such as \$14241\$, are palindromes in base 10: if you write the digits in reverse order, you get the same number.
Some numbers are the sum of 2 palindromes; for example, \$110=88+22\$, or \$2380=939+1441\$.
For other numbers, 2 palindromes are not enough; for example, 21 cannot be written as the sum of 2 ... |
Given a string x, output the characters in x sorted according to the order of appearance in your source code.
Examples
Source: ThisIs A Test
Input: Is it a Test?
Output: TissI etta?
Source: Harry - yer a wizard.
Input: I'm a what?
Output: aa wh'?Imt
Source: Mr. H. Potter, The Floor, Hut-on-the-Rock, The Sea
In... |
According to Wikipedia, a strongly Darboux function is
one for which the image of every (non-empty) open interval is the whole real line
In other words, a function \$f\$ is strongly Darboux if given 3 arbitrary real numbers \$a\$, \$b\$, and \$y\$, it is always possible to find an \$x\$ between (distinct) \$a\$ and \... |
Here is my ungolfed Ruby code for a function I want to try and golf:
Iter =-> k {
str = ""
(0..k).map{|m| str += "-> f#{m} {"}
str += "f#{k}.times{f1 = f0[f1]};f1"
(2..k).map{|m| str += "[f#{m}]"}
eval(str + "}" * (k+1))
}
The best I can do to golf this is essentially shortening variable names, rem... |
In CSS, colours can be specified by a "hex triplet" - a three byte (six digit) hexadecimal number where each byte represents the red, green, or blue components of the colour. For instance, #FF0000 is completely red, and is equivalent to rgb(255, 0, 0).
Colours can also be represented by the shorthand notation which use... |
Input
A single hex 6-digit colour code, capital letter, without #. Can also be a 24-bit integer if you prefer.
Output
The closest HTML color name (e.g red, or dark-salmon, as defined as https://www.w3schools.com/colors/colors_names.asp or see below). Distance is defined by summing the difference in red, green and blue ... |
Given 2 positive integers in any format you'd like, return their sum using only logic gates and bit shifts (see example below). Don't worry about overflow.
EDIT: Using pre-written addition is obviously not allowed. So no a + b, Add(a, b), a - (-b) etc.
This is code golf, so standard loopholes apply. Shortest program in... |
Introduction:
A few days ago I read this post with the same title when I came across it in the HNQ. It asks if this claim of US presidential candidate Bernie Sanders is true or not:
Today the world's richest 26 billionaires, 26, now own as much wealth as the poorest 3.8 billion people on the planet, half of the world'... |
Introduction
So the Challenge is to give out all combinations with two Inputs. The length of the string is also optional and you should be able to edit this.
I've selected this channel because I thought it would be very easy to do it "normally" but the challenge itself could be very interesting. I had to create that fo... |
Input
A single integer in your language's preferred format, e.g int or an array of digits are all acceptable.
Output
A truthy or falsely value, depending on whether the given number is palindromic (same forwards and backwards)
Rules
Numbers will always be positive, at least two digits long.
This is fastest-algorithm, ... |
I'd like to propose a different kind of golfing challenge to this community:
(Artificial) Neural Networks are very popular machine learning models that can be designed and trained to approximate any given (usually unknown) function. They're often used to solve highly complex problems that we don't know how to solve alg... |
Given two numbers, the first is greater than the second, check whether the first number is divisible by the second without a remainder. If divisible, answer "yes"(or any other string), otherwise "no"(or any other string you like).
Conditions: You cannot use conditional operators, loops, arrays, bitwise operations, func... |
Backstory
Meet my friend Jimmy:
/o\
Jimmy is a little character who likes to stand on platforms. Here's Jimmy safely standing on a platform:
/o\
-------------
Now, Jimmy has a good sense of balance, so he can safely stand with one leg off of the platform, like so:
/o\
-------------------
Although i... |
Create your smallest web server in your preferred language!
Requirements
Must respond to atleast 1 type of request (get,post,patch,delete), with a specified string.
Smallest implementation wins!
*String can be empty
You may use any library you want
My personal record for this was 56B in node
require('express')().use((r... |
This 128-language quine ouroboros (a program which outputs a program in another language, which outputs a program in yet another language, (125 languages later), which outputs the original program) is pretty impressive. But unfortunately, it has a static number of iterations.
Write a program which outputs a program (no... |
Introduction:
Ever used Dropbox with some other people and you both modified the same file? Ever had a multi-user application with a relational database, and two people were modifying (or worse, one was deleting and the other modifying) the same object? Well, let's simulate that with this challenge (sort-of).
For the s... |
Your challenge is very simple: output the previous answer, in reverse.
However, as with this similarly-titled question, there's a catch: in this case, you can only use characters from the answer before the last. For example:
Let's say the first answer looks like this:
1 - Python
print('hi!')
And the second answer loo... |
Your challenge is very simple: output the previous answer, in reverse.
However, as with this similarly-titled question, there's a catch: in this case, you cannot use characters from the answer before the last. For example:
Let's say the first answer looks like this:
1 - Python
print('hi!')
And the second answer looks... |
In this simple but fun challenge, you were asked to determine if Jimmy would fall of their platform. Jimmy has three body parts /, o, and \ arranged like this
/o\
Platforms are represented with -. Jimmy will fall off their platform iff they have two or more body parts that are not directly above a platform.
Some exa... |
I honestly can't believe this challenge does not already exist.
The challenge
Write a function.
The specifics
Your program must define some sort of callable function. This includes anything commonly known as a function, a lambda function, or a subroutine. All of these types of callables will be referred to as a "funct... |
In a matrix of characters, a cursor is a movable position between two adjacent characters, before the first character or after the last character in a line, like that "I"-shaped indicator which moves while you type.
In this challenge, a cursor position is considered valid if at least one of its two sides touches a spac... |
This challenge is about Haskell point-free style polynomial functions.
Although you don't need to know Haskell language to do this challenge, Haskellers might have an advantage here.
Point-free means roughly that variables(points) are not named and the function is created from compositions of others functions.
For exam... |
Alice is an intern in a company that uses Brainfuck as a primary language for both client-side and server-side development. Alice just has written her first code and she's a bit nervous as she's getting ready for her first code review.
Alice wants to make her code properly formatted and look nice, but she has no time t... |
Given a date between 2010-01-01 and 2099-12-31 as three integers (please state your order if not [year,month,day]), answer with Tesco's corresponding five-digit Burger Relish Best Before End date number.
The format is simply the last two digits of the year, followed immediately by three digits representing the day of ... |
It seems as of recent, there have been a lot a Jimmys falling to their death, as can be seen here, and here where you were asked to determine if Jimmy would fall. It is time we put a stop to this madness and try to save Jimmy.
Jimmy has three body parts /, o, and \ arranged like this
/o\
Platforms are represented with... |
This challenge is quite simple to conceptualise, but likely a lot harder to execute.
In this challenge, the program will have to detect the number N of its characters that have been randomly changed (at least half of the program will always remain). Then, it will have to output the Nth prime number.
A 'change' can only... |
Yet another Jimmy challenge by his original father. See these other lovely challenges.
As you all know, recently we've been seeing challenges related to Jimmy on platforms. Now, Jimmy is an acrobat as I mentioned before, and he's got other tricks up his sleeve.
One of these tricks is hanging by ropes. Here's an exampl... |
This challenge will have you count pseudo-polyforms on the snub square tiling.
I think that this sequence does not yet exist on the OEIS, so this challenge exists to compute as many terms as possible for this sequence.
Update: this is now on the OEIS as A309159: Number of generalized polyforms on the snub square tiling... |
Write a function to produce, for a non-negative integer, a string containing a sum of terms according to the following:
3 -> "3"
805 -> "800 + 5"
700390 -> "700000 + 300 + 90"
0 -> "0"
13 -> "10 + 3"
200 -> "200"
Any input other than a non-negative integer can be ignored. Zero terms must be skipped unless the inp... |
Challenge Description:
Write a program that asks the user for input. The user will enter Good or Bad. You do not have to support any other input. If the user enters Good, print Bad and vice versa (to stdout etc).
Notes:
1) You cannot use any other pair of two words.
2) Your program only has to ask and print once.
3) Yo... |
In 256 bytes or fewer write a function, \$f\$, from the positive integers to the positive integers that is:
Monotonic: larger inputs always map to larger outputs. (\$a < b \implies f(a) < f(b)\$)
Non-linear: does not have asymptotic order notation \$O(n)\$. (\$\displaystyle\forall c: \exists n:c\cdot n < f(n)\$)
Your... |
Problem: We have a two dimensional matrix of positive integer cells. On each turn any non-zero cell with a neighbor (top/bottom/left/right) of zero decreases by 1. We want count to the number of non-zero cells present and add them up across all turns.
Is there a faster solution than to use a priority queue?
Is there a... |
The rule is:
a, b, c, d, e is an integer from 0 to 1000, no relation between a, b, c, d, e so a can equal to b or c, ...
can not use more than 3 loops (it can be 3 nested loops or 3 normal loops, or 2 nested loops + 1 normal loop, ...)
you need to find all the answers for (a, b, c, d, e) that is:
a + b + c + d + e = ... |
Introduction:
I think we've all heard of it, but here a very brief summary: Noah gathered two of every species of animal on the planet, male and female, to save in his Ark during a great flood. The actual quote from the Bible is:
Genesis 7:2-3
You must take with you seven of every kind of clean animal, the male and it... |
Challenge
Create a console program to display each byte of a file.
Winning
Since this is code-golf, fewest bytes wins.
Rules
Program must be a console application, meaning that it will be ran from some sort of command-line interpreter;
Every byte must be uppercase hexadecimal, separated by a space, and it must be 2 ... |
Simple problem, create a programme that takes one input, and the outputs that input in reverse.
Some test cases are [input -> output]:
Hello World! -> !dlroW olleH
Code Golf -> floG edoC
Reverse Cat Programme -> emmarporG taC esreveR
Shortest answer wins
Note: It doesn’t have to support multi-line inputs and it doe... |
Given two numbers in tape location #0 and tape location #1 in Brainfuck, compute their product into another tape location (specify with answer). Optimize for the least amount of time-units used, where the interpretation of any command uses one time-unit. As example, here is a quick C++ program to determine the number o... |
The challenge is simple: Print the last, middle, and first character of your program's source code, in that order.
The middle character is defined as follows, assuming a source length of n characters, and 1-indexing:
If n is even, print the n/2-th and n/2 + 1-th character. (abcdef == cd)
If n is odd, print (n-1)/2 + 1... |
(a paradox, a paradox, a most ingenious paradox)
This is the first part of a multipart series inspired by different R functions.
The Task
Given a dataset \$D\$ of positive integers, I need you to compute the 5 number summary of \$D\$. However, I'm working on large datasets, so I need your code to be as small as possibl... |
Task
Given an input string of one or more ASCII characters which codepoints are between 0 and 128 (exclusive), do the following:
Convert each character into its 7-bit ASCII code (if the ASCII code is less than 7 bits, put leading zero bits)
Concatenate all bits (this results in 7*n bits where n is the number of charac... |
Given a start word and a target word, print the "mutation chain" that starts at the start word and ends at the target word.
You may assume both words are lowercase and only have alphabetic characters.
Define a "mutation" as the removal of an character, the insertion of a character, or the altering of a character.
For e... |
Concept
In what ways can you scramble the English alphabet so that it can still be sung to the tune Twinkle Twinkle Little Star without ruining the tune?
Rules
Swapping
Let's just assume the letters contained in each of the following sets can be swapped freely by default without ruining the tune:
{ A, J, K }
{ B, C, ... |
What general tips do you have for golfing in Grass? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Grass (e.g. "remove no-op characters" is not an answer).
Please post one tip per answer.
|
This is perhaps one of the classical coding challenges that got some resonance in 1986, when columnist Jon Bentley asked Donald Knuth to write a program that would find k most frequent words in a file. Knuth implemented a fast solution using hash tries in an 8-pages-long program to illustrate his literate programming t... |
Jimmy has had a busy last week with all these platforms and ropes, and poor Jimmy doesn't even have legs or feet to stand on!
Your job is to take a string containing multiple Jimmys and give them legs and shoes!
Get input in the form of a Jimmy String
Jimmy String => /o\ /o\ /o\
containing only /o\ and
give each ... |
This is a Cops and Robbers challenge. This is the cop's thread. The robber's thread is here.
As a cop, you must pick any sequence from the OEIS, and write a program p that prints the first integer from that sequence. You must also find some string s. If you insert s somewhere into p, this program must print the second ... |
This is a Cops and Robbers challenge. This is the robber's thread. The cop's thread is here.
The cops will pick any sequence from the OEIS, and write a program p that prints the first integer from that sequence. They will also find some string s. If you insert s somewhere into p, this program must print the second inte... |
The task here is to write a program that takes an natural number, \$n\$, and produces the \$n\$th term of an OEIS sequence. That sequence should have an identifier in the form of A followed by 6 digits. Now when you take your source code and reverse the order of it's bytes to produce a new program, that program shoul... |
(we won't be finding a Find or catching a tryCatch, though)
This is part two of a multi-part series of implementing some interesting R functions. Part one can be found here.
The task:
You are to implement R's match function in as few bytes as possible.
Input:
x, a possibly empty list/array of integers
table, a possibl... |
In the tabletop RPG named Pathfinder, there is a feat that characters can take called Sacred Geometry, which allows a character who has it to buff their spells in exchange for doing some math: to use it, the character rolls a number of six-sided dice equal to their ranks in a particular skill, consults a table based on... |
Help! I seem to have an annoying echo in some of my arrays, and I'd like to get rid of it. When this occurs, the original array repeats itself somewhere in the middle causing the values to be added to each other.
For example, the array [ 422, 375, 527, 375, 859, 451, 754, 451 ] contains an echo of itself like so:
[ 4... |
Notice: This question originally had people write comments with a shorter program, rather than new answers. This has been changed so that people with shorter programs can get reputation too. Hopefully this doesn't become unmanageable...
There have been a couple of OEIS-related questions recently, so here's another:
Pic... |
Introduction
I began studying the Collatz Conjecture
And noticed these patterns;
0,1,2,2,3,3...A055086, and 0,1,2,0,3,1...A082375,
in the numbers that go to 1 in one odd step,
5,10,20,21,40,42...A062052
Related like so;
A062052()(n) = ( 16*2^A055086(n) - 2^A082375(n) ) /3
The formula for A055086 is $$\lfloor\sqrt{4... |
How long's left?
Recently, I was making pizza using a 5-minute timer on my phone. When someone walked in and asked me how long was left, I was confused for a moment at first as to how to answer the question. You see, if the timer at the current moment was at 3:47, by the time I had read out 'Three minutes and forty sev... |
You are fighting an extensive network of enemy spies. You know that each spy has at least one (sometimes multiple) fake identities they like to use. You'd really like to know how many spies you're actually dealing with.
Luckily, your counter-intelligence agents are doing their job and can sometimes figure out when two ... |
Rules
You will start with only two elements: Points \$A\$ and \$B\$ such that \$A \neq B\$. These points occupy a plane that is infinite in all directions.
At any step in the process you may do any of the three following actions:
Draw a line that passes through two points.
Draw a circle centered at one point such tha... |
...Ordinal numbers (or ordinal numerals) are words representing position or rank in a sequential order.
From Wikipedia.
Your task is, using 2 separate programs (of which can be made from 2 different languages), to output the ordinal sequence from first to nth. You will be outputting the full word second as opposed t... |
As you probably know, there have been multiple lovely Jimmy challenges recently popping up. In these challenges, you were challenged with our beloved friend's acrobatics skills. Now we've got a different challenge for you. Today you will be identifying different types of Jimmys!
Explanation
There are three varieties o... |
Background
MQTT (Message Queuing Telemetry Transport) is an ISO standard publish-subscribe-based messaging protocol (Wikipedia).
Each message has a topic, such as the following examples:
myhome/groundfloor/livingroom/temperature
USA/California/San Francisco/Silicon Valley
5ff4a2ce-e485-40f4-826c-b1a5d81be9b6/status
Ge... |
Given an input string, write a program that outputs the total number of lines and curves it has.
The Challenge
Take input from STDIN, or any other input method.
Output to STDOUT, or any other output method, the total number of lines and curves contained in the string, in that order, based on the below table in the cod... |
The idea for this code golf puzzle is from link: The Bridge and Torch Problem
The inspiration for this code golf puzzle is the Bridge and Torch
problem, in which d people at the start of a bridge must all cross it
in the least amount of time.
The catch is that at most two people can cross at once, otherwise the
... |
I'm sure you're all familiar with Z̃͗̇̚͟Ḁ̬̹̈̊̂̏̚L̜̼͊ͣ̈́̿̚G̱̮ͩ̃͑̆ͤ̂̚Õ̷͇͉̺̜̲ͩ́ͪͬͦ͐ ̪̀ͤͨ͛̍̈͢ĝ̭͇̻̊ͮ̾͂e̬̤͔̩̋ͮ̊̈ͭ̓̃n͖͎̘̭̯̳͎͒͂̏̃̾ͯe͕̖̋ͧ͑ͪ̑r̛ͩa̴͕̥̺̺̫̾ͭ͂ͥ̄ͧ͆t͍̻̘̆o͓̥ͤͫ̃̈̂r̹̤͇̰̻̯̐ͮ̈́ͦ͂͞. If not, you can play with the classical generator a bit. Zalgo text is unicode text that started as English text and had a bunch of combining ... |
Recamán's sequence (A005132) is a mathematical sequence, defined as such:
$$A(n) = \begin{cases}0 & \textrm{if } n = 0 \\
A(n-1) - n & \textrm{if } A(n-1) - n \textrm{ is positive and not already in the sequence} \\
% Seems more readable than
%A(n-1) - n & \textrm{if } A(n-1) > n \wedge \not\exists m < n: A(m) = A(n-1)... |
In the burial place of King Silo of Asturias there is an inscription that reads SILO PRINCEPS FECIT (King Silo made this).
The first letter is found in the very middle, and from there one reads by going in any non-diagonal direction radiating outward. The final letter is found on all four corners. In this challenge,... |
Modern regular expressions (regexes) have many features (\d, {n,m}, \1, etc.), but to define a regular language (modern regexes can define broader classes of languages, in their defense), all you need are three operators: concatenation (+), union (|), and the Kleene star (*). Here are some examples:
a - Matches the str... |
At work I've been acting as quality control on our public documents, to make sure that they are WCAG 2.0 compliant. Given the length of some of these documents there tend to be issues, and so I record the issues and the pages they occur on.
The challenge: Given a string input, output a count of all distinct pages with... |
/o\ Jimmy has been receiving a lot of attention on this site recently and it has caused Jimmy to get a little stressed. The bodybuilder Jimmys /-o-\ started bad mouthing the OG / acrobat /o\ Jimmys saying they are way cooler because they are bigger. But of course the acrobat Jimmys thinks they are way cooler since afte... |
The other day, our team went to an escape room. One of the puzzles involved a board of six mechanical switches where you had to find the correct combination of on and off in order to unlock a box, somewhat like this:
-v-v-v-
-v-v-v-
Being developers, we decided it would be more efficient to try every single one of 2^6... |
Like Brainfuck or JSFuck would be efficient in terms of number of characters needed, but what languages would have the highest amount of information per character?
I was thinking of APL and J but there has to be more.
My goal with this question is to find a program that would allow a person with theoretically infinite ... |
Let's define a sequence: The n digit summing sequence (n-DSS) is a sequence that starts with n. If the last number was k, then the next number is k + digit-sum(k). Here are the first few n-DSS:
1-DSS: 1, 2, 4, 8, 16, 23, 28, 38, 49, 62, 70...
2-DSS: 2, 4, 8, 16, 23, 28, 38, 49, 62, 70, 77...
3-DSS: 3, 6, 12, 15, 21, 24... |
Given a string of printable ASCII, output the frequency of each character in that string.
The Challenge
Input is given as a string of printable ASCII characters (decimal [32-126] inclusive).
Output the frequency of each character, in ASCII order.
The output must have a format similar to [character][separator][count]. ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.