Skip to content

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

Open
@ANotFox

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

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

@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!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions