Skip to content

Commit dfc38ef

Browse files
Sync the raindrops exercise's docs with the latest data. (#790)
1 parent 4b9f19d commit dfc38ef

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed
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+
~~~~
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.

0 commit comments

Comments
 (0)