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.
Julia translation
No random tests.
The kata is very fun, but the interface of the given function is poor. Since Swift is strongly typed, the interface should make use of that instead of allowing users to pass a
nil
as the argument.There's a typeo in the test cases when you test
getLines(5)
. And really you should just convert all of the tests over fromTest.expect
to useTest.assertEquals
instead. Like this:The
Test.assertEquals
method already has all the built-in logging to give a helpful message. E.g.getLines(5) - Expected: 1,11,21,1211,111221, instead got: (something else)
or
Test Passed: Value == 1,11,21,1211,111221