Ad
  • Default User Avatar

    You're welcome. In general, I do not put a lot of comments in code but usually try to write in such a way that the code is self-documenting. That is, I try to improve readability by simplifying logic, choosing well-defined functions (following Single Responsibility Principle), and choosing optimal names for functions/variables.

  • Default User Avatar

    Thank you for commenting on the code.

  • Custom User Avatar
  • Default User Avatar

    @suic @rollietikes - You're welcome. Glad to help. The tests are working as expected now. That was a very quick turnaround, by the way. :)

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    That is true. Though 0.5 would be said as 0.5 minutes, as a plural. That's why I left it as I did. Good comment, though!

  • Default User Avatar

    I thought I remember learning in English class that fractions less than one were considered singular. For example, 1/2 minute or 1/4 apple versus 1 1/2 pies.

  • Default User Avatar

    It's even harder in C# right now, with the tests not working correctly. :)

  • Default User Avatar

    Evidently you are not using C#. :) The tests for that language are completely broken!

  • Default User Avatar

    While I appreciate the coverage afforded by the "random" test suite, it is currently also problematic in that it is a moving target. For me specifically (coding in C#), I often got failures due to precision issues. However, once in a while, just running the test again without coding changes, the test suite passed. This kind of sometimes yes and sometimes no test results would be anathema in any production environment that hopes to preserve ones sanity. If the precision issues were legitimate, then the code should always fail the test suite (not just sometimes). On the other hand, if the precision issues were not legitimate, then why make me press the Run button 10 or 20 times, waiting for it to pass?

    My suggestion: randomly generate the test suite once and then keep it constant for everyone. This would have ALL of the benefit you now have from a "random" test suite (lots of cases, all over the place), yet would get rid of the problems of a moving target.