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.
This comment is hidden because it contains spoiler information about the solution
The solution below shouldn't pass, add some tests to make it fail.
https://www.codewars.com/kata/reviews/5b4668e34d3b8468bc000bdc/groups/5d6cb441c968e8000108a2a2
Hello!
Good kata, but my proposal is that random string should not contain any numbers (should contain characters a-z).
Otherwise kata becomes very simple.
Title sounds interesting, idea is good, but the actual kata is very boring. Is this clickbait?
Not sure what you could do to improve it though.
oh gosh am I embarassed, left the number of iterations at 3 rather than 500 :/ also I did not think about a global being grabbed by the solution code, so I'll make that change too. Thank you!
The new tests only test
tweetArray[2]
and[1]
. Theni
already gets bigger than the current length. Incidentally,i
implicitly is a global variable, because you don't havelet
orvar
in front of it. This is now possible.You may want to
while ( tweetArray.length )
. And ramp up3
a bit again, andlet i
. (let
has less subtleties thanvar
. )added messages to all failures, though I didn't know a great way to have the duplicate test give useful output without several more lines of code.
Side note: hope you don't talk to your team this way!
if you find a duplicate, please let me know! I really thought 'unique strings' would exist in this format, though while I found the opposite (detect IF strings are unique) I couldn't find this one.
length is resolved
"no because it won't pass the leng-"
d'oh, fixed!
good note, fixed
assertEquals
takes its arguments in the order(actual,expected)
. When directly comparing user solution generated values to reference ( correct, expected ) values, having them switched around leads to major confusion.This comment is hidden because it contains spoiler information about the solution
Your test failure messages are useless for debugging. Tell us what you tested!
I've done this before.
Also, you're not testing for "cannot be more than 180 characters" - you're testing for
<180
instead of<=180
.This is just Vigenere cipher, which means it's a duplicate to at least http://www.codewars.com/kata/vigenere-cipher-helper.