Ad
  • Custom User Avatar

    Sure, the definition of double factorial can be extended to give results for negative odd numbers.

    Ask for all of those, or none of those, not just -1 -> 1.

    ETA: asking for all of 'em may be different enough to normal factorials that it would not be retired.

  • Custom User Avatar

    Both fixed tests and random tests could use some clearer organization. One big lump titled "tests" which attempts to test EVERYTHING just looks bad. Fixed tests could be grouped per tested scenario (scenarios could be: there is still time, there is no more time, there is exactly as much time as needed, and maybe ones which require formatting of minutes with leading zeros), and properly titled groups could improve user experience for users failing only some tests. Presenting inputs of faield tests would also be helpful. It could be also nice to explicitly specify what is expected result for inputs where Alex would study exactly until 22:00.

    Targeted generators for random tests would improve coverage of random tests. Currently, random tests almost never generate cases when Alex would finish studying at 22:00. My solution passes no matter if I return true or You have XXX time left for such cases. It passes all random test no matter if I do if(timeLeft > timeNeeded), or if(timeLeft >= timeNeeded).

    Indentation is messed up in some palces, some lines are not indented correctly.

    You can check JavaScript tests of Even or odd or Leap Years kata for examples.

  • Custom User Avatar

    Hi,

    Unfortunately, this has already been done. Moreover:

    • restriction based kata are rarely a good idea
    • no random tests
    • not enough fixed tests: negative values? (my solution shouldn't pass)
    • errr... why powers of 2, tho? :thinking:

    Cheers

  • Custom User Avatar

    Input validation has been done. Please just don't.

  • Custom User Avatar

    Kata is underspecified. What constitutes an invalid range? Are the range boundaries inclusive or exclusive?