instruction
stringlengths
34
53.1k
You've recently made an account on a dodgy gambling site, where for a fee of 25 dollars, they will pay you back a random amount between 0 and 50 dollars. After getting around 5 dollars twice, you decide to prove the site is a scam. After accessing their external firewall with the default password, you find your way ont...
Given a semiprime N, find the smallest positive integer m such that the binary representation of one of the two factors of N can be found in the binary representation of N * m. Example Let's consider the semiprime N = 9799. We try different values of m, starting at 1: m | N * m | N * m in binary ---+--------+------...
The Recursively Prime Primes is are sequence of primes such that p(1) = 2 p(n) = the p(n-1)th prime Here is an example of how one might calculate the 4th Recursively Prime Prime. p(4) = the p(3)th prime p(3) = the p(2)th prime p(2) = the p(1)th prime p(1) = 2 p(2) = the 2nd prime p(2) = 3 p(3) = the 3rd prime p(3) = 5...
FizzBuzz is so simple, bet you can do it backwards. In this challenge, you will be given the length of the FizzBuzz string and must give the positive integer that produced that string. Description To break this down, a FizzBuzz string for n is generated by the following algorithm. Start with an empty string and, for e...
Your task is to calculate the expected chance of winning for 2 players in some game, each with their own ELO Rating. Player A has ELO Ra and player B has ELO Rb The expected score for Player A (Ea) is: 1 / (1 + 10(Rb - Ra) / 400). There is a similar equation for Player B (Eb): 1 / (1 + 10(Ra - Rb) / 400). If you want a...
When I was a kid, and wanted to count the dollar bills in my life savings, I would count out loud: one, two, three, four, five, six, seven, eight, nine, ten; eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty; twenty-one, twenty-two, twenty-three, twenty-four, twenty-five.....
A word search is a matrix of letters as defined in Word Search Puzzle Generation. For a word search to contain a word, it means that that word appears somewhere in the matrix horizontally, vertically, or diagonally. Your task is to write a program that takes a list of strings and outputs the dimensions of the smallest-...
Sometimes, when writing a program, you need to use a prime number for some reason or other (e.g. cryptography). I assume that sometimes, you need to use a composite number, too. Sometimes, at least here on PPCG, your program has to be able to deal with arbitrary changes. And in circumstances conveniently contrived to m...
Your task is to slowly calculate exponentiation, with the following steps: Given two inputs (in this example, 4 and 8), you must calculate the exponentiation by calculate the equation bit by bit. You would do 4^8, have a greater base value (4) and a smaller exponent (8). You can do this using more exponentiation and di...
Challenge Make the shortest program to determine if the figures in the input will fit into the space in the input. Requirements The input will be in the format of this example: Input: +----+ -- +--+ | +----+ | | | | +--+ | | +---------+ Output: +----+ |+--++----+ || |-- | |+--+ | ...
Input Two words separated by a space. It is assumed that the first is a verb. Output The "Soviet counterpoint" to the input phrase, in the form of a punchline to an "in Soviet Russia" joke. "break law" --> "In Soviet Russia, law break you!" Accounting for correct grammar is unimportant. Shortest program wins!
Task is to output this text: ABCDEFGHIJKLMNOPQRSTUVWXYZA A 00000000000000000000000 Z B Y C 101010101010101010101 X D W E V F 2101210121012101210 U G T H S I R J 123210...
Your input will be a string consisting of small english letters. Your task is to determine the number of distinct permutations of the original string that are a palindrome. The input string has up to 100 letters. In the case of a longer string the result might be very big so the output should be the number of permutati...
In the wake of the many (two?) FizzBuzz-related challenges posted recently on PPCG, I've been tempted to come up with my own. Behold... Fizz Buzz Lightyear Write a program or function that takes an integer n and prints out FizzBuzz for any number divisible by 15, Fizz for any number divisible by 3, and Buzz for any num...
Most computer keyboards feature a small integrated LED light, indicating the current input mode, as controlled with the CAPS LOCK button. Your task is to blink it: Turn it on; Wait for 0.5 (+/-0.1) seconds; Turn it off again. Video footage of the LED blinking is highly appreciated ! Rules You can blink a different ...
Background On this site, we occasionally have questions requiring programs to be "radiation hardened"; this means that the program has to be able to survive the deletion of one or more bytes, no matter which bytes are deleted. As is common for tasks that frequently get set in programming challenges, it's natural to wan...
When using a tool such as git to merge two files, a conflict could be detected and added to the result of the merge. A merge of these two files: my file: Common line of code 1 Common line of code 2 my lines Common line of code 3 Common line of code 4 their file: Common line of code 1 Common line of code 2 their lines ...
Intro When you search in google, it always shows you a result with a sample text from the found webpage. For example if you search for "Madonna greatest vinyl", google will show you one line link, and below a short excerpt from that found webpage: Madonna Greatest Hits Records, LPs, Vinyl and CDs Madonna - Greatest Hi...
Some of you may be familiar with the way that a motorcycle shifts. But for those who don't, It looks like this 6 5 4 3 2 N 1 Now I want to know what gear I am in after performing a few up and down shifts. The program should work from neutral. Sample input: V^^ Sample output: 2 As you can see I downshifted once from ...
You're in charge of distributing T-Shirts to everyone. Simple enough, right? But remember, there are different sizes of T-Shirts, and you have to keep that in mind... Challenge Specifications There are N T-Shirt sizes. There are K people. Each person may wear any T-Shirt that is larger than them, but they can only wear...
You know those Windows boxes where you can only do one thing? Let's take this to the next level! Challenge Make a dialog box with a button that follows your cursor everywhere! Specs No input may be taken. There may be output to either STDOUT or STDERR. You must open a window with one button (no text is necessary, but ...
In this challenge, you need to simulate a frog jumping back and forth on lily pads. The pond is infinitely big, has a line of an infinite number of lily pads, and the frog can jump across as many lily pads as he likes. This frog likes to jump back and forth: after jumping forward, he always jumps backwards, and vice ...
Determining whether a Language is Turing Complete is very important when designing a language. It is a also a pretty difficult task for a lot of esoteric programming languages to begin with, but lets kick it up a notch. Lets make some programming languages that are so hard to prove Turing Complete that even the best ...
PPCG hasn't had enough of quines already... Challenge: Your task is to create a program "A0". When this program is run with no input, it outputs nothing. When this program is run with input, it outputs "A1". When "A1" is run with no input, it outputs "A0". When "A1" is run with input, it outputs "A2". Pretty much, "A(k...
I'm a narcissist. (Not Really) I'm also very lazy... (Not Really) So I want to know the score of this question, and how many people have viewed it. But I'm too lazy to check myself... Challenge Your challenge is to output the score of this question, and how many views there are. No input may be taken, and output may...
I think is about time to do another Pokemon challenge! Even if Pokémon Go is not as mainstream as it used to be... The task. Just draw a MISSINGNO. MISSINGNO is an unofficial Pokémon species found in the video games Pokémon Red and Blue. IGN has noted MISSINGNO appearance in Pokémon Red and Blue as one of the most fam...
Code Golf Challenge I have an isdue, my fingrrs are fat and I freqintly jave an isdue of ty[ing one keystrpke to the right on my kryboard. I'm afraid the isdue is getyng worse anf worsr as time goes on. Sopn every keystrpke I make wil; be shiftrd pne to the right! Befpre then I'd like a program (or functipn) to autp sh...
Draw this Ascii coffee cup: o o o __________ / \__ | J | \ | A | | | V | | | A |__/ \__________/ Brownie points for coffee-script or java :) Shortest code in bytes, function or program, trailing newline or white space is acceptable, drink up!
3D-modeling software mainly uses UV Mapping to map textures onto a 3D object. The valid values for both U and V are usually located in an inclusive [0..1] range. Challenge You bought a new 3D-modeling software which is super-easy to use. However there is one issue with it: it adds or subtracts a random integer number f...
This is a cops-and-robbers challenge the Robbers' Thread can be found here Your challenge is to write a program that outputs an anagram of its source code but not the original source code itself. For example the following Python program, print`'print*2``'*2` prints 'print*2``print*2``' which has all of the same chara...
This is a cops-and-robbers challenge the Cops' Thread can be found here Your challenge, as robbers is to take outputs from the cops' thread and find anagrams of the output that when run as a program output the original output provided. The winner will be the person with the most valid cracks on this question. Rules Yo...
Given a ruler length in inches and fractions of an inch, and a granularity in fractions of an inch, output the values of all marks on the ruler, starting from 0, in ascending order. Input ruler length will be a mixed fraction (integer and proper fraction) Input granularity will be a proper fraction in the form 1/(2ⁿ), ...
Consider the positive integer powers of five in decimal. Here are the first 25, right aligned: X 5^X 1 5 2 25 3 125 4 625 5 3125 6 15625 7 78125 8 390625 9 1953125 10 ...
Write code that takes a string as input, and outputs a truthy or falsey value depending on whether or not the string follows these rules: If you stack each character on top of each other, convert to binary and sums each column, then all the sums should be identical. You may assume the input string contains only printab...
A challenge I thought that would be very cool is to make an interpreter for a Turing-complete language of your choosing. The rules are simple: You may use any language to create this interpreter even if it is newer than this challenge. You may use any Turing-complete language as long as it is not the same as the one y...
The New York Times periodically runs a puzzle they call the "Spelling Bee" in which they list six "allowed" letters plus one "mandatory" letter and challenge the reader to form as many five-letter-or-longer dictionary words as possible out of those letters. Each "allowed" letter can appear 0 or more times. The mandator...
This is a repost of Evolution of “Hello World!”, originally written by user Helka Homba It should not be closed as a duplicated, due to meta consensus here. The original was asked over two years ago and was last active more than six months ago. I have permission from Helka Homba to post this here Since the original, ma...
There are 97 ASCII characters that people encounter on a regular basis. They fall into four categories: Letters (52 total) ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz Numbers or Digits (10 total) 0123456789 Symbols & Punctuation (32 total) !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ Whitespace (3 total) Space , tab ...
This challenge is inspired by Blink the CAPS LOCK by zeppelin. Most webcams feature a small integrated LED light, indicating if the webcam is in use, as controlled by a hardware mechanism to prevent spying. Your task is to blink it: Turn it on. Wait for 0.5 (±0.1) seconds. Turn it off again. Wait for 0.5 (±0.1) secon...
Following the best security practices, I keep a plain text file with my passwords on my hard drive. In fact, I just copied and pasted one of them to access my PPCG account. In a lucid moment, I decide that the password should better not remain in the clipboard after its use. Since this happens to me often, I could use ...
Mr Seckington is a mobile grocer. He drives his van door-to-door selling his produce all around the nearby villages. Mr Seckington needs a method to weigh the produce he is selling so he knows how much to charge his customers. Because space is at such a premium on his van, he uses an interesting sequence of weights ...
I was messing around with Pyth's url request feature, and noticed that google always gave a response with a slightly different length for me, usually ~10500 characters. So your task in this challenge is to print out the average length of the html response from http://google.com. Specs You will take an input n which is...
Code Golf Totally real backstory: I'm a contractor working on a website www.Sky.Net and one of our tasks it to create some self-aware program or something, I don't know I wasn't really listening to the boss. Anyways in an effort to make our code more self-aware we need IT to be able to know what code is on each line-nu...
Not a dupe to this. That question asks specifically for counting up forever, while this question allows many other approaches. Write a program or function which, given infinite time and memory, would print an infinite non-periodic output. Clarifications 'Infinite' means the solution keeps outputting something without ...
This challenge is a tribute to the winner of Best Picture at the Oscars 2017, La La Land Moonlight! Write a function/program that takes a string containing only letters [A-Za-z], the four symbols that are common in every day sentences .,'? and spaces, and outputs the string in the style of La La Land. To be more spec...
This challenge is in tribute to the winner of Best Picture at the Oscars 2017, La La Land Moonlight! Your challenge is to print the text La La Land pause one second, then change the text to show La La Land MoonlightThe original text (La La Land) must have a strikethrough. This can be achieved either by clearing the s...
We've had problems to generate minesweeper games. We've had problems to solve these minesweeper games. Now... It's time to battle other people on a minesweeper game! Your program must be run in Java. Essentially, each player can do an action every turn. You may move to any space touching yours including corners. The b...
Task Given a positive integer n less than 2^30 specified as input in any way you choose, your code should output a random integer between 0 and n, inclusive. The number you generate should be chosen uniformly at random. That is each value from 0 to n must occur with equal probability (see Rules and Caveats). Rules an...
In: Enough memory and a positive integer N Out: N-dimensional N^N array filled with N, where N^N means N terms of N-by-N-by-N-by... Examples: 1: [1] which is a 1D array (a list) of length 1, containing a single 1 2: [[2,2],[2,2]] which is a 2D array (a table) with 2 rows and 2 columns, filled with 2s 3: [[[3,3,3],[3,3,...
The Penrose triangle, also known as the Penrose tribar, or the impossible tribar, is an impossible object. The goal in this challenge is to display a Penrose triangle in the fewest bytes possible. Source: Wikipedia Rules: You must display the Penrose Triangle digitally after generating it. They must look the same as ...
Slightly more than an inverse of this. In: Multi-line DSV data and a single delimiter character. The DSV may be taken as a file, a filename, line-break separated string, list of strings, etc. All records have the same number of fields, and no field is empty. Data does not contain the delimiter character and there is no...
Golf the leaderboard of this question (id=111735). Your program should issue one HTTP or HTTPS request to StackExchange API, parse it and present to user in form similar to a typical Leaderboard Snippet Sample output (for the question 47338 instead of this): Leaderboard Author Language Size 1. FryAmTheEggman ...
It's the election! The area which we are in implements the system of voting called instant runoff (sometimes called alternative vote or preferential voting). Each voter orders each candidate from most preferred to least preferred, marking a "1" for their most preferred candidate, a "2" for their second candidate, and s...
Inspired by Silicon Valley's "three-comma club" scenes, like this one, in this challenge you'll be telling ten people the "comma club" to which they each belong. If you're unfamiliar with the term "comma club," let me explain: you're in the one-comma club if the money you have is in the inclusive range $1,000.00 to $99...
Your task: given an input string, determine whether the binary representation of that string does not have 4 1s or 0s in a row, anywhere. Furthermore, your code itself should not contain any such runs of four in a row. Test Cases String Binary Result U3 01010101 00110011 Truthy 48 ...
Note: Minor spoilers for The Martian are in this challenge. Read ahead with caution The Martian is a Science Fiction novel about astronaut and botanist extraordinaire, Mark Watney, who has been accidentally stranded on Mars. At one point in the book, Mark tries communicating with NASA, but the only means of communicat...
You know those stackable shelves that are basically just wooden boxes that can be stacked together? We're going to simulate building some bookshelves out of those with some ASCII art. Our books are all conveniently uniform in size, and all look like the following: |X| |X| |X| The bookshelves are individual boxes, alwa...
You've probably heard of the Fibonacci numbers; they're pretty famous. Each number in the Fibonacci sequence is the sum of the last two in the sequence with the first and second numbers being 1. The sequence looks like this: 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75...
Draw the parabolic trajectory of a thrown ball. The input is the ball's initial upward velocity, a positive integer v. Every second, the ball moves 1 space right and v spaces vertically, and then v decreases by 1 to due to gravity. So, the upward velocity eventually steps down from v to 0 and down to -v, finally falli...
Thanks to @KritixiLithos for helping me out with this challenge! V is a programming language that I wrote so that I could use and extend vim for code-golf challenges. The very first commit was on March 3rd, 2016, meaning that today V turns one year old! Woo-hoo Over V's first year of existence, there have been 176 com...
Let's say I have the following (2D) matrix: [[1, 2, 3, 4 ], [5, 6, 7, 8 ], [9, 10, 11, 12], [13, 14, 15, 16]] Rotate the matrix counterclockwise R times (not in 90 degree increments, just by 1 number each time), 1 2 3 4 2 3 4 8 3 4 8 12 5 6 7 8 --> 1 7 11 12 --> ...
Given an non-negative integer \$n \ge 0\$, output forever the sequence of integers \$x_i \ge 3\$ that are palindromes in exactly \$n\$ different bases \$b\$, where the base can be \$2 \le b le x_i-2\$. This is basically the inverse of OEIS A126071, where you output which indices in that sequence have the value \$n\$. I...
In this exercise, you have to analyze records of temperature to find the closest to zero. Write a program that prints the temperature closest to 0 among input data. Input N, the number of temperatures to analyse (optional). This will be nonzero. The N temperatures expressed as integers ranging from -273 to 5526. Outp...
The dice game Mia introduces a very non-trivial order of sets of size two: {3,1} < {3,2} < {4,1} < {4,2} < {4,3} < {5,1} < {5,4} < {6,1} < {6,5} < {1,1} < {2,2} < {6,6} < {1,2} In general, the order within a tuple does not matter {x,y}={y,x}, {1,2} is greater than anything else, Pairs are greater than non-pairs and th...
You should have heard about the Fibonacci Numbers, often called the Fibonacci Sequence. In this sequence the first two terms are 0 and 1, and every number after the first two is the sum of the two preceding ones. In other words, F(n) = F(n-1) + F(n-2). Here are the first 20 Fibonacci numbers: 0 1 1 2 3 5 8 13 21 34 55 ...
Sometimes it happens that while typing a sentence, I am distracted and I end up typing the same couple of words twice couple of words twice in succession. To make sure make sure other people are not bothered by this, your task is to write a program that resolves this problem! Task Given an input string (if it matters f...
For context, this problem is based on a old chat-bot project I did. Problem: Given a string of words containing any of the characters: " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" Find the frequency of each triplet of words. All non-alphanumeric characters should ...
There are two forms of nouns, singular and plural. The conversion between these two is quite easy. Normally, you end it with s. ex. car => cars. If it ends with s,x,z,ch or sh, end it with es. ex. bus=>buses. If it ends with y with a consonant just before it, change the y to ies. ex. penny => pennies. If it ends wi...
Definition of Additive Primes: Numbers which have exactly 2 divisors are called Prime numbers. Numbers which are prime and their sum of digits is also a prime number are called Additive Primes Task: Given an integer x, compute all the additive primes amongst the first x prime numbers, with 2 being considered both t...
Imagine I have an infinite number of homework problems (!) each given an integer number. Math Problem Notation is a notation for describing subsets of the problem using problem specifiers. An MPN expression can consist of several things: A single value. This represents a set containing the number: 99 -> {99}. A simple...
The λ-calculus, or lambda calculus, is a logical system based on anonymous functions. For example, this a λ-expression: λf.(λx.xx)(λx.f(xx)) However, for the purposes of this challenge, we'll simplify the notation: Change λ to \ (to make it easier to type): \f.(\x.xx)(\x.f(xx)) The . in lambda headers is unnecessary,...
This construction is a way of representing the Natural Numbers. In this representation, 0 is defined as the empty set and for all other numbers, n is the union of {0} and {n-1}. For example to construct 3 we can follow the algorithm: 3 = {ø, 2} = {ø, {ø, 1}} = {ø, {ø, {ø}}} Task As you may have guessed your task is t...
The boardgame Terra Mystica has some very interesting mechanics for one of the primary resources, power. Instead of gaining and spending units of power from a bank, each player starts the game with exactly 12 units of power which are distributed over three "bowls", which are labelled I, II and III. Gaining and spending...
In this challenge, I have a field of avocados which I'd like to juice as quickly and completely as possible. Can you write a program or function to help me work out how to juice all the avocados perfectly? As input, you'll get the avocados as an mxm square grid, where m is an integer between 3 and 6. Each square contai...
You've been given a bag of Skittles. Everybody knows that in order to appreciate the different flavors the most, you need to rotate between the flavors. Basics: You can only eat 1 skittle at a time The order that you eat your skittles must be periodic. Each period cannot contain a particular flavor more than once. ...
A big part of radio communication is the NATO Phonetic Alphabet, which encodes letters as words to make them easier to understand over comms. Your job, if you wish to accept it, is to print them one by one. You must print this exact string to stdout: A: Alfa B: Bravo C: Charlie D: Delta E: Echo F: Foxtrot G: Golf H: Ho...
Background This challenge is in honor of apsillers, who won the Not as simple as it looks category in Best of PPCG 2016 with their challenge Can my 4-note music box play that song? Congratulations! On their "About Me" page, this user has a really neat simulator for the Game of Life cellular automaton. (Seriously, go ch...
There's a confusing factor in the 'Curious' badge. The "Positive question record". (total questions - negative questions - closed - deleted)/total questions is the formula of the question record. (negative, closed and deleted 'stack' with each other. that means if a question is negative and closed, it counts as two min...
This is the cop's thread. The robber's thread is here. Write a code that takes an input n and creates a n-by-n "snake matrix". A snake matrix is a matrix that follows this pattern: 3-by-3: 1 2 3 6 5 4 7 8 9 and 4-by-4: 1 2 3 4 8 7 6 5 9 10 11 12 16 15 14 13 The exact output format is optiona...
This is the robber's thread. The cop's thread is here. A snake matrix is a square matrix that follows this pattern: 3-by-3: 1 2 3 6 5 4 7 8 9 and 4-by-4: 1 2 3 4 8 7 6 5 9 10 11 12 16 15 14 13 Your task is to write a code that takes an input n and creates such a matrix, in the same language as a cop pos...
For some part of history people in France used a decimal clock. with the clock having 10 hour day, 100 minutes an hour and 100 seconds per minute. Though this clock simplified calculations a bit the idea wasn't appreciated by most of the world which used our current 24 hour, 60 minute hour, and 60 second minute. And he...
If you don't know what a queen is in chess, it doesn't matter much; it's just a name :) Your input will be a square of arbitrary width and height containing some amount of queens. The input board will look like this (this board has a width and height of 8): ...Q.... ......Q. ..Q..... .......Q .Q...... ....Q... Q..........
Given two integers, A and B, output A if A-B (A minus B) is in A-B (A to B), otherwise output B. "A minus B" is standard subtraction. "A to B" is the range of integers starting at A and ending at B, including both A and B. For example: 1 to 4: 1, 2, 3, 4 -2 to 5: -2, -1, 0, 1, 2, 3, 4, 5 3 to -1: 3, 2, 1, 0, -1 7 to 7:...
My boss* does not understand why her programmers react negatively to users changing program requirements. Help her understand! On every answer, create a new requirement. Then, write a program/function that solves that requirement and all prior requirements, while in a new programming language. Examples User 1 posts the...
For a story I'm writing, I needed to convert 101⅐ (101 + 1/7 if that doesn’t show up for you) into base 47. Expressing an integer in some base brings back memories of first learning how to program back in the days of 8-bit systems; it’s a fairly easy exercise. Doing so using a floating-point format is a bit harder, tho...
Oh, <PROGRAM NAME HERE>, tell me how many character '<CHARACTER HERE>'/s are there in your body. I do not think it a dupe to this. That question asks for printing a list directly but this one requires some input that will cause problem. Your work is to write a quine-like program/function that takes an input of one cha...
Input: Two integers: one negative, one positive. Output: On the first line output lowest to highest. On the second line we've removed the highest and lowest numbers and sign-changed all individual numbers. On the third line we've removed the highest and lowest numbers again and sign-changed all individual numbers again...
Given a string of the characters +=- where there is at least one =, insert positive integers between all the symbols and at the start and the end such that the math equations are satisfied. For example, given the input +-=-= you need to insert positive integers A through F like this A+B-C=D-E=F such that the equation...
This answer-chaining challenge is officially over, resulting in the win of Wheat Wizard, with a total of 7 answers. Any other answer is welcome, but it won't influence the accepted answer for this challenge, nor the winner. Task: Print all the positive divisors of a number x taken as input. Input: A single number x w...
The Challenge Given the number of items, n, in a non-empty, sorted list output the index, i(n), at which its "Back-To-Front Permutation" would reside in a list of all permutations if said permutations were sorted lexicographically. Results may be 0 or 1-based, just say which (that is i, not n). The Back-To-Front Permut...
Writing out numbers is among the Hello worlds of programming, often the numbers 1-10. I want to write out many numbers! Many, Many numbers. But how many numbers do I have to write? Task Given an integer input, give a number as output that would give me the number of digits that would be in a string containing all integ...
Your task is to take a sequence of characters (the music) as input (in a function or program), and print (or return) the music as it would look like in a music box. You will only receive the characters ABCDEFG.() as input, and the input will never be empty. You may also receive the letters in lowercase, if you wish for...
(Meaning: Convert English to Bleet) We have praised goats as god for years now. But if we can't translate English to 'Bleet', the Goat God's language, we cannot communicate with them. So, to communicate with them, we have researched the activities of goats, and retrieved this pattern, which is the core of the language....
Create a program that calculates my reading speed! The challenge Write a program which takes some text as input and waits for a start signal from the user to display the input. When to user gives a second end signal, the program should output the reading speed of the user, which is defined as the number of words in the...
The challenge here is to extend an implementation of palindrome given the following as inputs: n > 1 and a list l. Your program must palindrome the list both vertically and horizontally, that is to say it must first palindrome the list itself, then each element in the list after; or the other way around. Before pali...
Consider the following string: Tin Snips This string contains several atomic symbols on the periodic table. We could rewrite this string to identify several of them: [Ti][N] [Sn][I][P][S] Of course, we could also write it this way: T[In] [S][Ni][P][S] The rules for rewriting the input are as follows: The case of th...
SPECIFICATION Given m variables, create every combination up to order n. For example, The output of mapping two variables (a and b) to order 1 would be: a b a b The output of mapping two variables (a and b) to order 2 would be: a a2 b b2 a b a2 b a b2 a2 b2 The output of mapping two variables (a and b) to order 3 ...
Problem Given a file with: 56 (65%), 33(75%), , 44, "“hello”,(5) world", goodbye 89 (25%), 33(75%), , 44, "hello world", goodbye 92 (97%), 33(75%), , 44, "hello world", goodbye Goal Write back to that file with: 56, 33, , 44, "“hello”,(5) world", goodbye 89, 33, , 44, "hello world", goodbye 92, 33, , 44, "hello world"...
Randomly choose one out of k-length, ordered subset of characters in a string, while only storing a limited number of characters. The subset must be chosen with equal probability and may contain repeated characters. Do this without generating all possible permutations and assume k is at most the length of the string. F...
Bubble-wraps are maximum-level entertainment. Everyone can agree to that. Now, you will make even computers enjoy bubble-wraps. Specs You will be given two integers, w, and h.(each are responsively width and height) Your program should output all w*h phases waiting 1 second between each one and terminate. Every bubble-...