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.
Because the first year corresponds to 15, the second to 9, and the subsequent years to 4 for cats or 5 for dogs. We exclude the initial two years from the calculation and focus on the remaining. If, for instance, humanYears = 10, we can subtract the initial two years (10-2) to get 8, which is then multiplied by 4 or 5.
Every language needs random tests.
Thanks for raising an issue about it! ;-)
Fixed
The JavaScript version of this Kata has no sample tests. (I am assuming the random tests are fine but only because I didn't run into problems with them.) I received the message below when I tried to run the sample tests.
Test Results:
Solution
should test for something
This is just an example of how you can write your own TDD tests - Expected: 'expected', instead got: 'actual'
Since I can't see all the test cases, I'm making this suggestion based on the other functions that this kata accepted as correct solutions (i.e., I know I might be mistaken): The test cases should include numbers that have more than one digit. A few/some of the currently accepted functions would fail this kata if they had to sort multi-digit numbers.
This comment is hidden because it contains spoiler information about the solution
First of all: Please state your language and surround multi-line code snippets with lines of three backticks (```).
I guess this is Java. Did you read the last line of the description?
I think the description/instructions to this Kata should emphasize that all the coder needs to return is a number value (i.e., the number of sheep). I think most of the people who attempted this Kata were paying more attention to the sample test, especially the line that reads:
Test.expect(countSheeps(array1) == 17, "There are 17 sheeps in total")
If they were like me, they were trying to create a function that returns a string/message and were getting the error messages:
There are 17 sheeps in total, not There are 17 sheeps in total
There are 500 sheeps in total, not There are 500 sheeps in total
There are no sheeps at all, you counted There are no sheeps at all
-which is massively confusing.