6 kyu

Tom's Allergies

150 of 305Lusina
Description
Loading description...
Algorithms
Puzzles
Fundamentals
  • Please sign in or sign up to leave a comment.
  • user9644768 Avatar

    Ruby 3.0 should be enabled, see this to learn how to do it

  • ashishra0 Avatar

    How does 1000 equal ["cats", "chocolate", "pollen", "strawberries"]. I understand bitwise calculation. But then after that also I dont understand how it will equal to that result. Can anyone help me understand?

  • akar-0 Avatar

    This comment has been hidden.

  • YeisonValero Avatar

    My class' method fail in 'ignore_non_allergen_score_parts' section of the test. Printing the score show 257. Take a look at:

    ignore_non_allergen_score_parts

    Log

    257

    ['eggs'] should equal ['cats', 'chocolate', 'eggs', 'peanuts', 'pollen', 'shellfish', 'strawberries', 'tomatoes']

    This is my class being used with that value in the interative python:

    from allergies import Allergies allergies = Allergies(257) allergies.allergies() ['cats', 'chocolate', 'eggs', 'peanuts', 'pollen', 'shellfish', 'strawberries', 'tomatoes']

  • user5504489 Avatar

    I am a JSer and not good at bitwise calculate. This kata helps me a lot!

  • user5504489 Avatar

    When the score is 257,why allergies are eggs instead of cats and eggs? I was confused about how the score make up? Why the score can be 1000?

  • smolen Avatar

    PHP version!Cheers

  • smolen Avatar

    @BrianLusina you have made cool kata,thanks!

    IMO add puzzle tag ;D

  • tdsimao Avatar

    The second example should be:

    Allergies(255).allergies()

    this way the description don't give any hints about the implementation.

  • chrisdawgr Avatar

    In python the instruction example says says: allergies = Allergies(0) allergies.is_allergic_to('peanuts') = True

    In the test it says: allergies = Allergies(0) allergies.is_allergic_to('peanuts') = False

  • GiacomoSorbi Avatar

    Crystal translation kumited too; you might notice the tests for the type missing, but they are kinda pointless in a statically typed language.

    The rest is all there :)

  • codeRenk Avatar

    My code works fine except for the tests where it's supposed to throw a type error. I've tested the code in my IDE (PyScripter) with all the invalid data types I can think of and it always throws a type error there, but apparently it's not doing it in the kata tests. Is there something I'm missing? Is each invalid data type supposed to show a specific error message?

  • rrit Avatar

    This comment has been hidden.