Skip to content

Commit f59209d

Browse files
authored
Merge pull request #91 from codingthat/sync-raindrops
Sync `raindrops` docs and metadata
2 parents a0c534f + fdf31cb commit f59209d

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed
Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
# Instructions
22

3-
Your task is to convert a number into a string that contains raindrop sounds corresponding to certain potential factors.
4-
A factor is a number that evenly divides into another number, leaving no remainder.
5-
The simplest way to test if one number is a factor of another is to use the [modulo operation][modulo].
3+
Your task is to convert a number into its corresponding raindrop sounds.
64

7-
The rules of `raindrops` are that if a given number:
5+
If a given number:
86

9-
- has 3 as a factor, add 'Pling' to the result.
10-
- has 5 as a factor, add 'Plang' to the result.
11-
- has 7 as a factor, add 'Plong' to the result.
12-
- _does not_ have any of 3, 5, or 7 as a factor, the result should be the digits of the number.
7+
- is divisible by 3, add "Pling" to the result.
8+
- is divisible by 5, add "Plang" to the result.
9+
- is divisible by 7, add "Plong" to the result.
10+
- **is not** divisible by 3, 5, or 7, the result should be the number as a string.
1311

1412
## Examples
1513

16-
- 28 has 7 as a factor, but not 3 or 5, so the result would be "Plong".
17-
- 30 has both 3 and 5 as factors, but not 7, so the result would be "PlingPlang".
18-
- 34 is not factored by 3, 5, or 7, so the result would be "34".
14+
- 28 is divisible by 7, but not 3 or 5, so the result would be `"Plong"`.
15+
- 30 is divisible by 3 and 5, but not 7, so the result would be `"PlingPlang"`.
16+
- 34 is not divisible by 3, 5, or 7, so the result would be `"34"`.
1917

18+
~~~~exercism/note
19+
A common way to test if one number is evenly divisible by another is to compare the [remainder][remainder] or [modulus][modulo] to zero.
20+
Most languages provide operators or functions for one (or both) of these.
21+
22+
[remainder]: https://exercism.org/docs/programming/operators/remainder
2023
[modulo]: https://en.wikipedia.org/wiki/Modulo_operation
24+
~~~~
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Introduction
2+
3+
Raindrops is a slightly more complex version of the FizzBuzz challenge, a classic interview question.

exercises/practice/raindrops/.meta/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
".meta/example.gd"
1414
]
1515
},
16-
"blurb": "Convert a number to a string, the content of which depends on the number's factors.",
16+
"blurb": "Convert a number into its corresponding raindrop sounds - Pling, Plang and Plong.",
1717
"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.",
1818
"source_url": "https://en.wikipedia.org/wiki/Fizz_buzz"
1919
}

0 commit comments

Comments
 (0)