Skip to content

Commit

Permalink
Update instructions.md
Browse files Browse the repository at this point in the history
The description as is doesn't make sense. It states at function 2: "Store the default initial score in a module attribute. It will be needed again."

The reset function however simply resets to 0, and implementing so passes all tests. There's no module attribute needed, neither to be defined nor to be used at any point. The enforcement to use one when adding a player is either arbitrary or not properly reflected in the exercise structure as is.

This pull request provides the minimal needed rewording to avoid confusion, stating outright a default attribute shall be used for a reset value.
  • Loading branch information
srcsintheta authored Oct 5, 2024
1 parent df7f3fa commit e568b6f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions exercises/concept/high-score/.docs/instructions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Instructions

In this exercise, you're implementing a way to keep track of the high scores for the most popular game in your local arcade hall.
In this exercise, you're implementing a way to keep track of the high scores for the most popular game in your local arcade hall. Note: Store a reset value (value to reset to) as an attribute and use in your functions where sensible (at least in the reset_score() function).

## 1. Define a new high score map

Expand All @@ -19,7 +19,6 @@ To add a player to the high score map, define `HighScore.add_player/3`, which is
- The second argument is the name of a player as a string.
- The third argument is the score as an integer. The argument is optional, implement the third argument with a default value of 0.

Store the default initial score in a module attribute. It will be needed again.

```elixir
score_map = HighScore.new()
Expand Down

0 comments on commit e568b6f

Please sign in to comment.