Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
brute force solution should not pass the tests. try to finding the law and make a clever solution ;-)
This comment is hidden because it contains spoiler information about the solution
PHP version!Cheers
I concur, it should be used more often for this kind of neat katas :)
@BrianLusina you have made cool kata,thanks!
IMO add puzzle tag ;D
Noted. Crystal translation approved.
Nope, just the same error message and the same type of exception is thrown for each data type that is not an integer.
Noted and updated. Thank you
The second example should be:
Allergies(255).allergies()
this way the description don't give any hints about the implementation.
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
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 :)
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?
This comment is hidden because it contains spoiler information about the solution