Ad
  • Custom User Avatar

    Random tests added :) Thanks for your contribution. 👍

  • Custom User Avatar

    it's updated. Thanks a lot for your contribution :)

  • Default User Avatar

    Sounds good to me

  • Custom User Avatar

    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 ? :)

  • Default User Avatar

    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 returning Game 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

  • Default User Avatar

    The following statements are incorrect:

    => the string could contains duplicates
    => the first person of the list will always be captain
    => the second person of the list will always be the referee
    

    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.

  • Custom User Avatar

    Added a test with duplicate players names :)

  • Default User Avatar

    There are no tests with duplicate team player names which are neither the captain nor the referee.

  • Default User Avatar

    Or: check this out.
    Sidebar left => docs => authoring.
    https://docs.codewars.com/

  • Custom User Avatar

    Well, thank you for your advice. I'll have a look ASAP 👍

  • Custom User Avatar

    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)

  • Custom User Avatar

    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 :)

  • Custom User Avatar

    Thanks for your feedback dfhwze :)
    I added a case when the captain and referee is the same person.

  • Default User Avatar

    Missing test cases when a person is both captain and referee, but not a player.

  • Custom User Avatar
    • No random tests
    • Sample tests expect 'Game is canceled' instead of just 'Game canceled'
    • Typo in description Exemple