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.
yes
Great. I updated the kata so this won't happen to anyone else. Thanks!
This comment is hidden because it contains spoiler information about the solution
Done.
As for the third case: it contains two sentences. You'll have to divide the number of words by 2.
And as for why you're getting the message "should be -1.06 but was -1.06", I'm not sure. Are you returning strings? You could try calling
toFixed(2)
on the returned value.Think about it this way... if you look at the diagrams in the kata, it is a spiral. Everytime it goes from left to right, it is on the top most row that hasn't been processed, every time it goes from up to down, it's on the right-most column that hasn't been processed, when it's right to left, it's always the very bottom and when it's down to up it's always the left-most column. So if you think about it as 4 different phases that you have to do over and over again, making sure not to process any element twice, then maybe it's more manageable. That's how I thought of the solution when I finally figured it out. There are other more graceful solutions though, and many other ways of solving it of course.
Should be fine now - I've changed assertEquals to assertSimilar.
When I first published this kata, example tests were not visble at all :)
This comment is hidden because it contains spoiler information about the solution
I got the same. What is wrong here?
This is a problem with JavaScript's equality model.
[] !== []
Your solution concatenates a space after every word, even the last one.
Ask yourself whether you are always retaining the original value until the end for checking, or only in some cases.