Ad
  • Default User Avatar

    better answer direct under the thread. ;-)

  • Default User Avatar
  • Custom User Avatar

    You've got to use the language's random number generator to create a randomly generated word/sentence so that the user cannot map the inputs (like my solution). You need to put your solution to this kata in the test cases (not example test cases) so that when you have a random number, you can check the user's solution against the actual solution.

    E.G. (for Python)

    from random import randint, choice
    
    def solution(string):
      pass     #put your solution here
    
    for _ in range(30):
      n = "".join(chr(randint(65, 123)) for i in range(randint(5, 20)))   #or something like this
      Test.it("Testing for %s" % n)
      Test.assert_equals(next_letter(n), solution(n),"It should work for random inputs too")
    

    EDIT: fuck @Steffen beat me to it :P

  • Default User Avatar

    CodeWars is for learning and improving. :-)

    So have fun and become a part of the community.

    And you will see, your next kata will be better. :-)

  • Default User Avatar

    The input string should be random. So you have to generate this.
    And then the assert-call must compare vs. your own solution.

    Perhaps look in my tests or in the test cases of js-katas, that you have solved.
    (On discourse there is the item "Show Kata Test Cases". Click on it and you can see, how other warriors created their random tests.)