exercism / exercism/julia

'Allergies': Vague instruction vis-à-vis final testset's case

Open
#825 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
73
Forks
82
Avg merge
2h 17m
Merged PRs (30d)
5

Description

**For Exercise:** Allergies
**Link:** https://exercism.org/tracks/julia/exercises/allergies

As per the instructions, components of 256, 512, etc ought to be ignored. Essentially, this is asking a student to only work with values modulus 256 (with sum of all allergens being 255). However, the wording is unclear and can be improved as it is difficult to understand what 'ignoring' means.

![image](https://github.com/user-attachments/assets/926a8034-d8c3-486b-9259-e74baf942d47)

At first, I assumed that for any value >=256, 'eggs' would be returned, and had to rectify this error after learning from the community solutions.

The final testset's last case returns a Set with multiple allergens
```julia
@testset "testing for more allergies" begin
@test allergy_list(3) == Set(["eggs", "peanuts"])
@test allergy_list(5) == Set(["eggs", "shellfish"])
@test allergy_list(248) == Set(["strawberries", "tomatoes", "chocolate", "pollen", "cats"])
@test allergy_list(255) == Set(["eggs", "peanuts", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"])

# this
@test allergy_list(509) == Set(["eggs", "shellfish", "strawberries", "tomatoes", "chocolate", "pollen", "cats"])
end
```

**Suggestion:**
- Reword the line to make it clear that even if the allergen score is over 255, it can be scaled down (for example by a modulus).
- Add another example of a score > 255, increasing clarity on finding allergens

If this is not just me misreading the instructions (as a non-native speaker), I could do a pull request with another example and mild rewording in ```allergies/.docs/instructions.md```. Thank you!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.