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.
Nice kata.
Needs a fixed test
mark(0); markEnd();
and it needs to check result '=== 0', not '== 0'.How to do random tests
Thx. Updated. Hava a look.
Your solution is more correct. But it' s difficult to make a test because global before is out of reach.
Also, needs to specify what happens if I call
markEnd
with nothing marked left at all.Needs random tests
This would benefit from some kind of testing to prevent polluting
global
unnecessarily (like the example solution does .. :[ ). (Namespacing both functions would not be a bad idea either.)At the moment I have no idea how to write such a test, beyond enumerating
global
before and after, and allowing no more than two new keys. I don't even know if that'll work;global
might grow new keys for unexplained reasons (is that possible? is it predictable?).