forked from exercism/problem-specifications
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request exercism#1565 from yawpitch/simplify_raindrops_des…
…cription raindrops: simplify description.md
- Loading branch information
Showing
2 changed files
with
13 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
Convert a number to a string, the contents of which depend on the number's factors. | ||
Your task is to convert a number into a string that contains raindrop sounds corresponding to certain potential factors. A factor is a number that evenly divides into another number, leaving no remainder. The simplest way to test if a one number is a factor of another is to use the [modulo operation](https://en.wikipedia.org/wiki/Modulo_operation). | ||
|
||
- If the number has 3 as a factor, output 'Pling'. | ||
- If the number has 5 as a factor, output 'Plang'. | ||
- If the number has 7 as a factor, output 'Plong'. | ||
- If the number does not have 3, 5, or 7 as a factor, | ||
just pass the number's digits straight through. | ||
The rules of `raindrops` are that if a given number: | ||
|
||
- has 3 as a factor, add 'Pling' to the result. | ||
- has 5 as a factor, add 'Plang' to the result. | ||
- has 7 as a factor, add 'Plong' to the result. | ||
- _does not_ have any of 3, 5, or 7 as a factor, the result should be the digits of the number. | ||
|
||
## Examples | ||
|
||
- 28's factors are 1, 2, 4, **7**, 14, 28. | ||
- In raindrop-speak, this would be a simple "Plong". | ||
- 30's factors are 1, 2, **3**, **5**, 6, 10, 15, 30. | ||
- In raindrop-speak, this would be a "PlingPlang". | ||
- 34 has four factors: 1, 2, 17, and 34. | ||
- In raindrop-speak, this would be "34". | ||
- 28 has 7 as a factor, but not 3 or 5, so the result would be "Plong". | ||
- 30 has both 3 and 5 as factors, but not 7, so the result would be "PlingPlang". | ||
- 34 is not factored by 3, 5, or 7, so the result would be "34". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
blurb: "Convert a number to a string, the contents of which depend on the number's factors." | ||
source: "A variation on a famous interview question intended to weed out potential candidates." | ||
source_url: "http://jumpstartlab.com" | ||
blurb: "Convert a number to a string, the content of which depends on the number's factors." | ||
source: "A variation on FizzBuzz, a famous technical interview question that is intended to weed out potential candidates. That question is itself derived from Fizz Buzz, a popular children's game for teaching division." | ||
source_url: "https://en.wikipedia.org/wiki/Fizz_buzz" |