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 function in the initial code is Japanese(), but the function in the test cases is japanese(), leading to errors unless corrected.
The random tests always generate values having all 3 components, i.e. "cho", "oku", and "man".
This is not a useful custom error message.
chai
should be used instead of the old test framework.Initial solution is wrong.
Of course, thanks for pointing that out. I'd misunderstood the implementation, but have now changed it to check against my own solution.
Thanks! I have changed Japanese to japanese and re-published. This is my first attempt at authoring a kata so I'd appreciate any other feedback you have.
Thanks! I've added 200 random tests and re-published. This is my first attempt at authoring a kata so I'd appreciate any extra feedback you have.
Thanks! I have made the changes you suggested and re-published. This is my first attempt at authoring a kata so I'd appreciate any extra feedback you have.
The unit for
10**12
is chō (兆).1 * 10**12
is itchō (not 1 itchō), meaning one chō (ichi + chō). Similarly,2 * 10**12
is ni-chō.See Wikipedia's Japanese numerals.
I'd also suggest improving the description by clarifying that the number will be less than
10**16
.Codewars Forums - Kata Best Practices - Have Full Code Coverage
Only having 7 fixed assertions in the entire test suite is insufficient from preventing logically flawed and/or hardcoded solutions from passing - you should either (1) increase the number of unique, distinct fixed assertions to at least 20 including edge cases as well (the minimum requirement to resolve this Issue) or (2) write 100+ random tests which is even better and is generally preferred over just a large number of fixed tests.
Codewars Forums - Kata Best Practices - Follow Conventions
Identifier names in JavaScript are always in
camelCase
notPascalCase
(except for constructors, butJapanese
in this context is definitely just an ordinary function) (source: W3Schools) - please change the name of the user function fromJapanese
tojapanese
in the Initial Solution, Sample Test Cases and Test Cases.