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.
good question!
.
Thanks for spotting the "Math.round", i've changed it now. Thought I had removed them all before, when was adding the random tests and realised it was causing problems, but one of them obviously snuck through.
Your
getRandomInt
is wrong ( or at least statistically unsound ). You should neverround
Math.random() * range
; alwaysfloor
it. Your probabilities end up skewed if you don't.You're generating wrong tests.
Description says
and, though unspecified,
y
appears to be a consonant in this kata."ass backwards" ?
Attributed to Abraham Lincoln, no less.
No there aren't, all test cases involve words starting with a consonant because the kata is based on spoonerisms and I could think of none where the words started with vowels.
Added some random tests now. Any feedback is welcome.
.
I haven't looked that closely, but are there any tests for forms like
"able body" -> "bable ody"
?It does.
Random tests has already been raised separately. Closing.
I'm afraid I don't have time to fix the random test issue right now but I have added an explaination on how spoonerisms work in this kata.
The section before the strong wrangler example now reads "Others, involving words beginning with several consonants are a bit more complex. To make them work we have to swap all consonants up to the first vowel."
Does that make everything clearer?
You did not provide any specs how spoonerisms, especially those in the edge cases (e.g
strong wrangler
), should be handled, so for everyone else we can only contemplate on what you were thinking when you were writing the kata.This will become much more apparent once you've added random tests.
working on it
Needs Random Tests.