Ad
  • Custom User Avatar

    When you press the "Test" button, you are running the Sample Tests, which by default in this Kata only checks if you return a negative number when the input is positive.
    If you read the Kata description again, you might notice that if the number is already negative you still need to return a negative number.

    I prefer to have the initial Sample Tests be simple, so you can learn to write your own Sample Tests. I don't know which programming language you are using, but the Sample Tests should be easy to edit.

    When you press the "Attempt" button you will instead run the secret tests. They are designed to validate your code with edge-case tests and some random tests so you can't cheat your way through it by guessing the tests.

    The output of the failed tests should also show you what your code returned verse what you were supposed to return. The names of the tests that failed might also be a hint as to what might have failed.

  • Custom User Avatar