Skip to content

Commit

Permalink
sync sum of multiples docs (#1178)
Browse files Browse the repository at this point in the history
* Sync sum-of-multiples docs with problem-specifications

The sum-of-multiples exercise has been overhauled as part of a project
to make practice exercises more consistent and friendly.

For more context, please see the discussion in the forum, as well as
the pull request that updated the exercise in the problem-specifications
repository:

- https://forum.exercism.org/t/new-project-making-practice-exercises-more-consistent-and-human-across-exercism/3943
- exercism/problem-specifications#2249

* Sync sum-of-multiples docs with problem-specifications

There were a few follow-on tweaks to sum-of-multiples.

For context, this is part of the project to overhaul all the practice exercises.
You can read about that here:
https://forum.exercism.org/t/new-project-making-practice-exercises-more-consistent-and-human-across-exercism/3943

----

If you approve this pull request, I will eventually merge it. However, if you are happy with this change **please merge the pull request**, as it will get the changes into the hands of the students much more quickly.

If this pull request contradicts the exercise on your track, **please add a review with _request changes_**. This will block the pull request from getting merged.

Otherwise we aim to take an optimistic merging approach.

If you wish to suggest tweaks to these changes, please open a pull request to the exercism/problem-specifications repository to discuss, so that everyone who has an interest in the shared exercise descriptions can participate.

---------

Co-authored-by: Erik Schierboom <[email protected]>
  • Loading branch information
kytrinyx and ErikSchierboom authored Apr 12, 2023
1 parent 85f00a5 commit 4bb2ecd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions exercises/practice/sum-of-multiples/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ The points awarded depend on two things:

The energy points are awarded according to the following rules:

1. For each magical item, take the base value and find all the multiples of that value that are less than or equal to the level number.
1. For each magical item, take the base value and find all the multiples of that value that are less than the level number.
2. Combine the sets of numbers.
3. Remove any duplicates.
4. Calculate the sum of all the numbers that are left.

Let's look an example:
Let's look at an example:

**The player completed level 20 and found two magical items with base values of 3 and 5.**

To calculate the energy points earned by the player, we need to find all the unique multiples of these base values that are less than or equal to level 20.
To calculate the energy points earned by the player, we need to find all the unique multiples of these base values that are less than level 20.

- Multiples of 3 up to 20: `{3, 6, 9, 12, 15, 18}`
- Multiples of 5 up to 20: `{5, 10, 15, 20}`
- Combine the sets and remove duplicates: `{3, 5, 6, 9, 10, 12, 15, 18, 20}`
- Sum the unique multiples: `3 + 5 + 6 + 9 + 10 + 12 + 15 + 18 + 20 = 98`
- Therefore, the player earns **98** energy points for completing level 20 and finding the two magical items with base values of 3 and 5.
- Multiples of 3 less than 20: `{3, 6, 9, 12, 15, 18}`
- Multiples of 5 less than 20: `{5, 10, 15}`
- Combine the sets and remove duplicates: `{3, 5, 6, 9, 10, 12, 15, 18}`
- Sum the unique multiples: `3 + 5 + 6 + 9 + 10 + 12 + 15 + 18 = 78`
- Therefore, the player earns **78** energy points for completing level 20 and finding the two magical items with base values of 3 and 5.

0 comments on commit 4bb2ecd

Please sign in to comment.