text
stringlengths
180
608k
[Question] [ *This little piggy went to market, this little piggy wrote some code...* Ah wait, we're not talking about *that* bacon, we're talking about Sir Francis Bacon! Specifically, [the cipher Bacon devised](https://en.wikipedia.org/wiki/Bacon%27s_cipher) in the [late 1500s](http://www.cabinetmagazine.org/issu...
[Question] [ **Monday Mini-Golf:** A series of short [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") challenges, posted (hopefully!) every Monday. Sorry it's late; I realized 90% of the way through writing out a different idea that it was a duplicate. My family is rather large, so we ...
[Question] [ In [this challenge](https://codegolf.stackexchange.com/q/248577/56656) we considered a frog hopping around a lily pond. To recap the lily pond was represented as a finite list of positive integers. The frog can only jump forward or backwards by a distance equal to the number at its current location. So...
[Question] [ Similar to [this question](https://codegolf.stackexchange.com/questions/76966/read-a-crossword), but this is a crossword variation! Instead of only one letter per grid square, you can have *one **or** two*. # Input: * A 2d array, or whatever works in your language. * You can assume valid inputs * Any a...
[Question] [ Consider a date formatted in `YYYY-MM-DD`. You can use the joker `*` at the end of the date string. E.g. `2016-07-2*` describes all the dates from `2016-07-20` to `2016-07-29`. Now, consider a period represented by a start date and an end date. The algorithm must find the smallest possible list of dat...
[Question] [ Inspired by [Project Euler #17](https://projecteuler.net/problem=17), this is your challenge. Write a full program or function that takes a number as input, then print or return how many letters it would take to count up to and including that number in English (starting at one). You do not include spac...
[Question] [ 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 coup...
[Question] [ *[Related](https://codegolf.stackexchange.com/questions/60443/s%e1%b4%8d%e1%b4%80%ca%9f%ca%9f-c%e1%b4%80%e1%b4%98%ea%9c%b1-c%e1%b4%8f%c9%b4%e1%b4%a0%e1%b4%87%ca%80%e1%b4%9b%e1%b4%87%ca%80)* # Exposition After winning the SO raffle, you could have been on top the world, and you were! The raffle had been...
[Question] [ I was looking for this page to help me enhance my first [answer](https://codegolf.stackexchange.com/a/147101/15214) with SQLite, but I couldnt find one. So here we are! What general tips do you have for golfing in SQLite? I'm looking for ideas that can be applied to code golf problems in general that a...
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/117339/edit). Closed 4 years ago. [Improve this question](/posts/117339/edit)...
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/57166/edit). Closed 7 years ago. [Improve this question](/posts/57166/edit) ...
[Question] [ **Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers. --- Questions without an **objective primary winning criterion** are off-topic, as they make it impossible to indisputably decide which entry should win. Closed 6 years ago. [Improve this quest...
[Question] [ ## Challenge * Given a non-negative integer, find the sum of its digits. ### Rules * Your program must take a non-negative integer as input. * Your program should output the sum of the digits of the input integer. * Your program should be able to handle inputs up to 10^100. ### Examples * If the input ...
[Question] [ This is a simple challenge. The task is to write code that outputs a 448\*448 square image with 100% transparency. The output should follow the [standard image rules](https://codegolf.meta.stackexchange.com/questions/9093/d). [Answer] # Imagemagick in some shell, 35 ``` convert -size 448x448 xc:n...
[Question] [ 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 1. The shortest code in bytes wins. 2. This challenge is a code-golf, It follows code-gol...
[Question] [ *Take a list of 2-digit hexadecimal numbers as input, and output the binary value, replacing each 1 with an 'X', and each 0 with a space.* **For example** Input = `FF, 81, 47, 99`. * `FF` = `11111111` in binary, so print `XXXXXXXX` * `81` = `10000001` in binary, so print `X X` * `47` = `01000111` in bi...
[Question] [ ## Challenge Create a new file and write the string `Hello World` to it. ## Restrictions * Your challenge must write to a file on disk, in the file system. * The file may not be a log file generated during normal operation of the interpreter. * The file must contain **only** the string `Hello World`. I...
[Question] [ This was related to a program I am writing. Although the title is simple, the challenge is a lot more complicated. ## Your challenge You must write a program that takes an input, and your answer must match the sample outputs in this question. What the program should be is that you must output "HelloWor...
[Question] [ \$\left\{ n \atop k \right\}\$ or \$S(n, k)\$ is a way of referring to the [Stirling numbers of the second kind](https://en.wikipedia.org/wiki/Stirling_numbers_of_the_second_kind), the number of ways to partition a set of \$n\$ items into \$k\$ non-empty subsets. For example, to partition \$\{1,2,3,4\}...
[Question] [ 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 nu...
[Question] [ I have a string like this: ``` s = "helloworldandhellocodegolf" ``` I want to make every [consonant](https://en.wikipedia.org/wiki/Consonant) after a [vowel](https://en.wikipedia.org/wiki/Vowel) uppercase. Desired output: ``` heLloWoRldaNdheLloCoDeGoLf ``` As you can see, `l` gets uppercased because it...
[Question] [ > > **This contest is over.** > > > There are no remaining crackable answer in the cops challenge. > > > # Companion thread of [Cryptographic hash golf](https://codegolf.stackexchange.com/q/51068) As a reminder, here are the rules for robbers from the main challenge: > > ### Task > > > Crack a...
[Question] [ **Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** [Update the question](/posts/3245/edit) so it's [on-topic](/help/on-topic) for Code Golf Stack Exchange. Closed 12 years ago. [Improve this question](/post...
[Question] [ Given an integer `n`, print out `n * reversed(n)` `reversed(n)` is the number you get when you `reverse` the digits of `n`. --- ``` reverse(512) = 215 reverse(1) = 1 reverse(101) = 101 >>>>>>>> ``` --- ``` func(5) = 5*5 = 25 func(12) = 12*21 = 252 func(11) = 11*11 = 121 func(659) = 659*956 = 630004 ```...
[Question] [ ## Challenge Predict the distance between the Sun and the nth planet when using **any formula** that gives the same result as the [Titius–Bode law](https://en.wikipedia.org/wiki/Titius%E2%80%93Bode_law): `d=(3*2^n+4)/10`. **BUT WAIT**... there is one restriction: * Your source code can not include any ...
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/41626/edit). Closed 2 years ago. [Improve this question](/posts/41626/edit) ...
[Question] [ (This is [OEIS A057531](https://oeis.org/A057531).) ### Your task Given a positive integer, \$n\$, find the \$n\$th number where the digit sum equals the number of factors ### Explanation For example, let's take 22: Its factors are \$[1, 2, 11, 22]\$ (length: 4). Its digit sum is 4. This means that it ...
[Question] [ Your challenge is to print `x` digits of pi where `x` is your code length. Examples: ``` Source code (length) -> output foo! (4) 3.141 foobar (6) 3.14159 kinda long (10) 3.141592653 +++++ (5) 3.1415 123456789 (9) 3.14159265 ``` You can use `fl...
[Question] [ # Task Given a positive integer `n`, output the joined compound of circles The circles are of square of size `n+2` but removing the corner edges and the middle, before finally overlapping `n` times of itself E.g. ``` 2 ``` -> ``` #### #### #### #### ``` -> ``` ## # # # # ## ``` -> ``` ## ## # # ...
[Question] [ Based on a list of numbers and their equivalent letters, take a string input, replace the characters of that string with the equivalent number/letter and output the result. ### List > > * 1 = a > * 2 = b > * 3 = c > * 4 = d > * 5 = e > * 6 = f > * 7 = g > * 8 = h > * 9 = i > * 0 = j > > > ### Input...
[Question] [ **Closed**. This question needs to be more [focused](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Update the question so it focuses on one problem only by [editing this post](/posts/3755/edit). Closed 5 years ago. [Improve this question](/po...
[Question] [ Given two points `A` and `B`, find the angle from line `AO` to line `BO` about point `O` where `O` is the origin (`(0,0)`). Additionally, the angle may be positive or negative depending on the positions of the points (see examples). Input will be points `A` and `B`, and may be given in any convenient f...
[Question] [ In chess, [Forsyth-Edwards Notation](https://en.wikipedia.org/wiki/Forsyth%E2%80%93Edwards_Notation), more commonly called "FEN", is a textual way of transcribing boards. It describes each of the board's eight rows (called "ranks" in chess) from top to bottom from White's perspective. The pieces are wr...
[Question] [ **This question already has answers here**: [Is it a prime? w/o math [closed]](/questions/20920/is-it-a-prime-w-o-math) (7 answers) Closed 9 years ago. Write a program which determines if a given number is prime. The catch: No digits or arithmetical operators. This means: 1. No digits from `0` t...
[Question] [ Write a function (or a whole program) that outputs (or prints) an ASCII art of the initial position of [Mölkky](https://en.wikipedia.org/wiki/M%C3%B6lkky) pins. ### Output : ``` __ __ __ __(07)__(09)__(08)__ (05)__(11)__(12)__(06) | (03)__(10)__(04) | | | (01) (02) | | |__| | | | ...
[Question] [ I have a cake shop that specialises in birthday cakes. The cakes that I sell must have candles placed in a circle. You would probably think I can just divide 360° by the number of candles, but the machine for placing candles is quite unique; it uses a list of numbers representing positions of candles, ...
[Question] [ Here's one for fans of [Cabin Pressure](https://en.wikipedia.org/wiki/Cabin_Pressure_(radio_series)). There is an episode in which the characters devise a new version of Fizz Buzz, which is simplified to contain absolutely no mathematics. It has these rules: * If someone says "fizz", you say "buzz". * ...
[Question] [ I came upon this question, because it seems to be very common use-case to find unique characters in string. But what if we want to get rid of them? Input contains only lower case alphabets. Only letters from a to z are used. Input length may be from 1 to 1000 characters. Example: input: helloworld ...
[Question] [ Dealing with colors in non-markup languages often complicates things. I would like to see some variations of how color is used in different languages. The object of this competition is to output 'Hello World' in the seven colors of the rainbow. According to Wikipedia, these are the 7 colors. ``` Red ...
[Question] [ This a simple question. The start day is a Saturday and let the input be a non-negative number `x`. The output should be the number of weekdays (Mon-Fri) in the next `x` days inclusive. For example, if `x = 3` then the output should be 2. For `x` from 0 onwards the output should be: ``` 0,0,1,2,3,4,5,5...
[Question] [ Posted from [sandbox](https://codegolf.meta.stackexchange.com/a/18419/56555) **The Intro** What is an ACU? This challenge is based on the concept of money and since this is an international community, we all use different currencies, so in keeping with our spirit of inclusiveness, I have invented a new...
[Question] [ ## Task Your task is to take an array of numbers as input, and produce a new one where each number has been shifted both right and left, leaving `0`s if no number fills a spot. This process can be represented graphically like this: ``` [x] / | \ [x, 0, x] ``` This is done with every number in the ...
[Question] [ This is my attempt to pair [code-shuffleboard](/questions/tagged/code-shuffleboard "show questions tagged 'code-shuffleboard'") with [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"). You need to write a full program or function that sums all codepoints of the input string. I...
[Question] [ **This question already has answers here**: [Code Golf: 6174 - Kaprekar's mythical constant](/questions/2762/code-golf-6174-kaprekars-mythical-constant) (22 answers) Closed 8 years ago. **Input**: A three digit number * from stdin or as an argument * not all digits are the same * may start wit...
[Question] [ If you place the positive integers together and read each set of two adjacent digits at the same time, you get: ([A136414](http://oeis.org/A136414)) ``` 12, 23, 34, 45, 56, 67, 78, 89, 91, 10, 1, 11, ... ``` However, if you squash that sequence again: ``` 12, 22, 23, 33, 34, 44, 45, 55, 56, 66, 67, 77,...
[Question] [ Help! My device malfunctions and whenever I try to repeat a String, I get a messy results. Instead of repeating the same string **N** times, it fills an **NxN** square with each of its characters, and stacks the squares up. For example, given the String `"Test"` and the number `2`, instead of `"TestTes...
[Question] [ > > This is the robbers' thread to a [cops-and-robbers](/questions/tagged/cops-and-robbers "show questions tagged 'cops-and-robbers'") challenge. Click the link to find the [cops' thread](https://codegolf.stackexchange.com/questions/242075/output-two-numbers-cops-thread). > > > In the [cops' thread...
[Question] [ There are quite a few means in mathematics, such as the arithmetic mean, the geometric mean, and many others... ## Definitions and Task Note that these are the definitions for *two positive integers*\*: * The **root mean square** is the square root of the sum of their squares halved (![](https://latex....
[Question] [ # About the Series First off, you may treat this like any other code golf challenge, and answer it without worrying about the series at all. However, there is a leaderboard across all challenges. You can find the leaderboard along with some more information about the series [in the first post](https://...
[Question] [ The goal is to calculate all the squares up to `x` with addition and subtraction. Rules: 1. The code must be a function which takes the total number of squares to generate, and returns an array containing all those squares. 2. You can **not** use strings, structures, multiplication, division, or built-...
[Question] [ # In-between fractions **The challenge:** You will need to create code that takes atleast 3 inputs; 2 integers and "a fraction representation" - whichever type suits your language for representing the fraction increments) ie. If you choose string the input would be "1/4" or you could choose 2 extra int...
[Question] [ I once encountered this (mini) game where you had 4 or more vertical pipes that were connected by a number of horizontal pipes and you have to drop a ball or water into the vertical pipes. There are 2 kinds I know of: * Get the object into a bucket/basket under one of the exits (guess what pipe to t...
[Question] [ Given two numbers \$x,y > 2, x≠y \$ output all integers \$m\$ such that $$ x + y \equiv x \cdot y \pmod m $$ $$ x \cdot y > m > 2 $$ ## Input Two integers ## Output A list of integers ## Test cases ``` 3, 4 -> 5 5, 8 -> 3, 9, 27 29, 9 -> 223 26, 4 -> 37, 74 13, 11 -> 7, 17, 119 6258, 571 -> 463, 7703...
[Question] [ ### Task Write a function or a program to find the number of rotations required by a wheel to travel a given distance, given its radius. ### Rules Input can be 2 positive rational numbers and can be taken in any convenient format. Both inputs are of same unit. **There must not be any digits 0-9 in your...
[Question] [ For this challenge, you must create a programme which takes an integer `x` and outputs its source `x` many times. **Rules** * This is codegolf, the aim is to golf your programme to have the least amount of bytes * If you submit a function, the function must take `x` as a parameter and either return or ...
[Question] [ Given a positive integer `n`, output a number meter formatted like this: ``` 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 1 1 1 1 1 1 1 1 1 1 2 ``` The input number is 20 in this example. More formally, the decimal representations of the numbers are arranged vertically, from most significa...
[Question] [ # Rules You will receive as input a list that contains integers and strings. Your task is to move all of the strings to the end of the list and all of the integers to the beginning of the list. This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so the answer with the l...
[Question] [ I was asked this question in an interview but I was unable to figure out any solution. I don't know whether the question was right or not. I tried a lot but couldn't reach any solution. Honestly speaking, nothing came to my mind. ## Rocco numbers A positive integer \$n\$ is a Rocco number if it can be ...
[Question] [ *Problem adapted from the book **[Fortran 77](http://www.ebay.co.uk/itm/FORTRAN-77-DONALD-M-MONRO-ARNOLD-PAPERBACK-BOOK-PRINTED-1987-/121637388292) by Donald M. Monro*** ## Introduction Digital plotting machines are widely used to produce various forms of drawings, graphs and other pictorial results. M...
[Question] [ Your task is to take an input string of ascii characters and output the string as a series of vertical words separated by spaces. An example is shown below: Given the string: ``` Hello, World! My name is Foo. ``` the output should be: ``` H W M n i F e o y a s o l r m o l l e . o d , ! ``` 10 b...
[Question] [ **Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers. --- Questions without an **objective primary winning criterion** are off-topic, as they make it impossible to indisputably decide which entry should win. Closed 7 years ago. [Improve this quest...
[Question] [ Your challenge is to construct a [*proper*](https://codegolf.meta.stackexchange.com/questions/4877/what-counts-as-a-proper-quine) [quine](https://esolangs.org/wiki/Quine) using as few *distinct* characters as possible. ## Scoring Your score is equal to the number of distinct characters in your code, ai...
[Question] [ # Task Given an input string of one or more ASCII characters which codepoints are between 0 and 128 (exclusive), do the following: 1. Convert each character into its 7-bit ASCII code (if the ASCII code is less than 7 bits, put leading zero bits) 2. Concatenate all bits (this results in `7*n` bits where...
[Question] [ * Original: <https://james-iry.blogspot.co.at/2009/05/brief-incomplete-and-mostly-wrong.html> > > Alain Colmerauer designed the logic programming language Prolog. His goal was to create a programming language that is as intelligent as a two-year-old child. In order to prove that he had succeeded in hi...
[Question] [ A jumping number is defined as a positive number n which all pairs of consecutive decimal digits differ by 1. Also, all single digit numbers are considered jumping numbers. eg. 3, 45676, 212 are jumping numbers but 414 and 13 are not. The difference between 9 and 0 is not considered as 1 **The challeng...
[Question] [ A Harshad number is a number that is divisible by the sum of its digits. This is obviously dependent on what base the integer is written in. Base 10 Harshad numbers are sequence [A005349](https://oeis.org/A005349) in the OEIS. ## Your Task: Write a program or function that determines whether a given i...
[Question] [ This is a repost of [this](https://codegolf.stackexchange.com/q/54455/66833) challenge, intended to revamp it for looser I/O formats and updated rules You are to write a program which takes an integer polynomial in \$t\$ as input and outputs the [Laplace transform](https://en.wikipedia.org/wiki/Laplace...
[Question] [ ## Introduction Your challenge today (inspired by [this challenge](https://codegolf.stackexchange.com/q/124362/56656)) is to write a number of snippets, functions or full programs each that output various ascii emoticons, without reusing characters. ## Challenge * The list of valid ascii emoticons for ...
[Question] [ Given a message, append checksum digits using prime numbers as weights. --- A checksum digit is used as an error-detection method. Take, for instance, the error-detection method of the EAN-13 code: The checksum digit is generated by: * Multiplying each digit in the message alternating by `1` and `3...
[Question] [ ### Backstory You own a tiny jewellery shop in the suburbs of the city. The suburbs are too much overpopulated, so your shop has a thickness of *only one character* to fit in the busy streets. Recently, there has been lots of cases of robbery on the neighborhood, and you fear that robbers will also com...
[Question] [ **This question already has answers here**: [Make a list flat](/questions/248245/make-a-list-flat) (22 answers) Closed 1 year ago. Given a list with lists nested inside it, return the list with the nested lists' items de-nested. # Input The list will have, at most, 4-deep nested lists. Count all...
[Question] [ ## Overview I was playing with Desmos and discovered a really cool spiral: [![Archimedian Spiral](https://i.stack.imgur.com/V2O7i.png)](https://i.stack.imgur.com/V2O7i.png) Doing some research, I discovered that this spiral was the [Archimedian spiral](https://en.wikipedia.org/wiki/Archimedean_spiral)....
[Question] [ You are the captain of a world-famous wrestling team. An Olympic-grade match is coming up, and you are determined not to let your team down. You also happen to be a competent programmer, so you are going to write a program to help your team win! You have access to the strength ratings for each of your ...
[Question] [ Take as input an integer in any reasonable format. Then, output all the proper sub-strings of the base-10 digits of that integer that are powers of two, in any reasonable format. # Test cases ``` 10230 -> [1, 2] 13248 -> [32, 1, 2, 4, 8] 333 -> [] 331 -> [1] 32 -> [2] # As 32 is not a proper sub-string...
[Question] [ ## Integers in cosine From trigonometry we know that \$\sin(a) =-\cos(a + \frac{(4\*m + 1)\pi}{2})\$ where \$a\$ is an angle and \$m\in\mathbb{Z}\$ (integer). ### The task For an input of a positive integer \$n\$ calculate the value of the integer \$k\$ with \$n\$ digits that minimizes the difference b...
[Question] [ I'm currently scanning a bunch of handwritten documents and converting them to `.txt` files. Since I have a terrible handwriting the `.jpg`->`.txt` converter converts some of my umlauts to the *"normal"* letter encased by `'` ## Task Write a program or a function that: * Is given a string + you can ch...
[Question] [ **This question already has answers here**: [Additive Persistence](/questions/1775/additive-persistence) (47 answers) Closed 6 years ago. ## Your Task: Write a program or function that, when given a number, outputs its *persistence*. The persistence of a number is the number of times you can add...
[Question] [ Your job is to implement bitwise addition. To ensure that this is done, you will compute and print the result of addition without carry (or bitwise XOR). Then, you will compute the carry of the addition (bitwise AND) and multiply it by two (bitwise left shift). If the carry is nonzero, then you add the...
[Question] [ # Rotonyms 2 A "Rotonym" is a word that ROT13s into another word (in the same language). For this challenge, we'll use an alternate definition: a "Rotonym" is a word that circular shifts/rotates into *another* word (in the same language). For example: ``` 'stable' < 'tables' < 'ablest' 'abort' > 'tabor...
[Question] [ > > In probability theory, the [normal (or Gaussian) distribution](https://en.wikipedia.org/wiki/Normal_distribution) is a very common continuous probability distribution. Normal distributions are important in statistics and are often used in the natural and social sciences to represent real-valued ra...
[Question] [ **Disclaimer** This question is not a duplicate of [this question](https://codegolf.stackexchange.com/questions/47870/count-the-number-of-ones-in-unsigned-16-bit-integer). I'm not counting specific digits, as we already have those set in the initial parameters. This question is focusing on the decimal ...
[Question] [ Task similar to [this one](https://codegolf.stackexchange.com/questions/44830/string-to-binary). Take a string of ASCII characters and convert it to base-3 equivalents separated by a space. For example: ``` Hello, world! ``` Should be converted to ``` 02200 10202 11000 11000 11010 01122 01012 11102 110...
[Question] [ # Challenge The [primitive circle problem](https://en.wikipedia.org/wiki/Gauss_circle_problem#Generalizations) is the problem of determining how many [coprime](https://en.wikipedia.org/wiki/Coprime) integer lattice points \$x,y\$ there are in a circle centered at the origin and with radius \$r \in \mat...
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/266445/edit). Closed 3 months ago. [Improve this question](/posts/266445/edit...
[Question] [ # Challenge Given input as a list/array of natural numbers that each represent the floor of a class a student has to go to, sort the numbers in a way such that the MAD (mean average deviation) number of flights between classes is minimized, thus saving energy and preventing the chance of being late to ...
[Question] [ 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...
[Question] [ I saw [another prime challenge](https://codegolf.stackexchange.com/questions/144633/how-many-unique-primes) coming by in PPCG, and I do love me some primes. Then I misread the introductory text, and wondered what the creative brains here had come up with. It turns out the question posed was trivial, bu...
[Question] [ This golf requires a factorial calculation be split up among multiple threads or processes. Some languages make this easier to coordinate than others, so it is lang agnostic. Ungolfed example code is provided, but you should develop your own algorithm. The goal of the contest is to see who can come up...
[Question] [ Consider a sorted array of positive floating point numbers such as: ``` input = [0.22, 2.88, 6.35, 7.17, 9.15] ``` For each integer \$i\$ from 1 up to the last value in input rounded up, output the mean of all values less than \$i\$. In this case the output should be: ``` [0.22 0.22 1.55 1.55 1.55 1.55...
[Question] [ > > A number is a Mersenne Prime if it is both prime and can be written in the form 2m-1, where m is a positive integer. > > > **For example:** * 7 is a Mersenne Prime because it is 23-1 * 11 is not a Mersenne Prime because it cannot be written as 2m-1 * 15 is not a Mersenne Prime because it is not...
[Question] [ # Your Goal: Given an odd integer input `n` greater than 1, generate a random *English word* of length `n`. An English word is one in which the **odd** (1-based) indices are **consonants** and the **even** (1-based) **indices** are vowels, the vowels being `aeiou`. ## Random For the purposes of this ch...
[Question] [ In this task, you will write a program/function that takes a [Normalized Malbolge](http://acooke.org/malbolge.html#norm) program and outputs the resulting [Malbolge](https://esolangs.org/wiki/malbolge) program. (This is a secret tool that all Malbolge programmers are using!) ## Input A data structure t...
[Question] [ # Challenge Given an integer in 32-bit [two's complement](https://en.wikipedia.org/wiki/Two%27s_complement) format, return the index of the *second* least-significant zero digit in the binary representation, where an index of `0` represents the least significant bit, and an index of `31` represents the...
[Question] [ [RPS 25](https://www.umop.com/rps25.htm) is a version of Rock Paper Scissors which has 25 hand symbols instead of just 3. Each symbol defeats 12 symbols, and is defeated by 12 others. [Here's a link to a chart showing which symbols defeat which.](https://www.umop.com/images/rps25_outcomes.jpg) The chal...
[Question] [ Write a program that halts producing a random finite numerical output with probability 1. The [expected value](https://en.wikipedia.org/wiki/Expected_value) of the outputs of the program must be infinite. For [physical limits](https://codegolf.meta.stackexchange.com/questions/14407/), you can assume yo...
[Question] [ **This question already has answers here**: [Sum of integers in string, separated by non-numericals such as 'a' and 'Y'](/questions/730/sum-of-integers-in-string-separated-by-non-numericals-such-as-a-and-y) (39 answers) Closed 3 years ago. # **Input** A string. ### **Output** The sum of all inte...
[Question] [ ## The Rules * Each submission must be a full program. * The program must take input as two comma-separated dates in the form `YYYY-MM-DD`, and print the number of days that has passed since the second date to STDOUT as if today was the first date (if the second date would be in the future, output a ne...
[Question] [ **Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers. --- **Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/265259/edit). Closed 5 months ago. [Improve this question](/posts/265259/edit...
[Question] [ There is a building with an infinite number of floors and you are the only passenger in an elevator which can lift an infinite number of people. You are going home, but before the elevator gets to your floor, the elevator stops at another floor to allow people to enter the elevator and input their dest...
[Question] [ A huge storm is ravaging the world and as you and your family run away from it, you come across a gigantic shelter run by a girl. She tells you that "she sells sanctuary" and that different types of rooms are offered at different prices. A room may only house one person. # The challenge Write a program...