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.
Random tests added :) Thanks for your contribution. 👍
it's updated. Thanks a lot for your contribution :)
Sounds good to me
Hi Neilm. That makes sense, you're right. I should edit the description this way (based on your suggestions) :
=> the string could contains duplicates - these should be removed before processing subsequent rules
=> the first person of the list (excluding duplicates) will always be captain
=> the second person of the list (excluding duplicates) will always be the referee
What you think ? :)
The reason this was an issue for me is the later requirement
=> guys should have only one role (someone can't be referee and player, for exemple.)
- I read this to mean that we should be returningGame Cancelled
for the test case above. The expected solution is that the duplicates are removed first, before processing the other rules, which isn't clear.Maybe change the first rule to the following:
=> the string could contains duplicates - these should be removed before processing subsequent rules
The following statements are incorrect:
In the case where the list does contain duplicates, e.g. the test case
"Tom Delonge,Tom Delonge,Mark Hoppus,Travis Barker,Matt Skiba,Scott Raynor"
, the last statement is false.It should read
=> the second person of the list (excluding duplicates) will always be the referee
, or something like that.Added a test with duplicate players names :)
There are no tests with duplicate team player names which are neither the captain nor the referee.
Or: check this out.
Sidebar left => docs => authoring.
https://docs.codewars.com/
Well, thank you for your advice. I'll have a look ASAP 👍
The way to write random tests does not have to do with Mocha. You write the tests the same way, but with randomised input, usually in a loop. You can look at the tests of some other JS kata you have solved by going to the discourse and clicking the 'Show Kata Test Cases' button. Then you could use that as a reference. (Make sure it is a newer kata, some of the older ones have very bad tests)
Hey Kacarott, thank you for your feedback.
I fixed the 2 last issues in the sample tests and in the description.
Since I'm learning to write tests with Mocha, I have to look after some informations to be able to write random tests :)
Thanks for your feedback dfhwze :)
I added a case when the captain and referee is the same person.
Missing test cases when a person is both captain and referee, but not a player.
Exemple