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.
The Elixir test is wrong, perhaps you could update it to reflect the description?
This comment is hidden because it contains spoiler information about the solution
I actually feel that "hard coding" the scores is a great idea - its simple and easy to understand and update in the future. In my opinion this wins hands down over any "clever" solution for real world coding problems. Great lateral thinking!!
This one actually took me several days and I've learned heaps so thankyou for that. I'm glad I went through the process of learning about Primes and writing my own sieve and generator, but its a quite dissappointing to find out use of the stdlib "prime" class is allowed. In my opinion that drastically reduces the real lessons to be learnt here.
Why did you change these variables to class variables (@@).
This would mean that all instances of person would share the same values.
This is clearly not the intent of using a class to define the data.
Your solution would fail with this following test:
p1 = Person.new('Yukihiro', 'Matsumoto', 47)
p2 = Person.new('Keith', 'Salisbury', 40)
Test.assert_equals(p1.age + p2.age, 87)
I think the tests should be enhanced, because one of the solutions someone has provided uses @@ class variables, which passes tests, but would fail a test like this:
p1 = Person.new('Yukihiro', 'Matsumoto', 47)
p2 = Person.new('Keith', 'Salisbury', 40)
Test.assert_equals(p1.age + p2.age, 87)
Nice one, I like javascript like this!
brilliant, so simple when you know how!
Nice!
First class!!! I was stumbling around this idea but it was staring me right in the face and I just didn't see it. Bravo!!
I've only just joined this website and there was absolutely no mention of "all katas in the series....blah blah blah" so it is in no way clear that the tests may include whitespace. I ended up having to print out codepoints you hid to uncover what you hid in the test. I fully accept that the final solution encourages best practice, but because the failing example is unaccessible I find this Kata to be more trickery than healthy education. Be upfront and honest. Its the fact that you hide this test that makes it sneaky and deliberately deceptive. But thats just my opinion, you obviously have your own opinion.
Nice, didn't realise we could change the Node api, but love your solution.
best version imho!
I feel like there's something a little unfair going on with this Kata. My code passes all the example tests, but fails the authors test fixtures with a message
Expected: null, But was: 123
I notice other users have experienced the same. It would be acceptable if the failing test data was shown, but as the input is not even visible this seems a little more like a trick than anything useful.