Draft

Train Race

Description
Loading description...
Physics
View
AllIssues6QuestionsSuggestions2Show Resolved
  • Please sign in or sign up to leave a comment.
  • Blind4Basics Avatar

    the floating point error troubles is actually an issue (see johan's message below). If the kata is approved while it has not been handled, it will become a pain to tackle (for users as well as for future maintainers)

    Cheers

  • Blind4Basics Avatar

    Hi,

    1. It's not specified in the description if the total length is always enough so that all trains actually can reach their constant/max speed.
    • If that doesn't occur, it must be specified
    • if that can happen, it must be specified and tested as well
    1. not enough fixed tests

    2. the assertion message is useless, so it should be either removed or made useful

    3. each with a unique four-digit ID -> that's incorrect, the IDs are four characters, not four digits (or maybe it's a translation problem?)

    4. the trains data could be namedtuples instead of dicts (that specific point is only a suggestion)

    Cheers

  • JohanWiltink Avatar

    The use of floating point numbers can be a problem. Normally, you'd fix that by comparing with a margin for error, but sorting things based on floating point results doesn't have that option.

    Random tests may fail sometimes, and I wouldn't know how to fix it, except by trying again, or reading your mind what the reference order of operations is. In practice, it may not be a problem, but the design is ( a little ) flawed.

  • sid114 Avatar

    'Please refer to description.'

    is not the most helpful assertion message imo

    • gfreundt Avatar

      I agree, but there really isn't a better way to give more information. The description example covers everything but the step by step process needed to solve it.

    • sid114 Avatar

      posted as issue

      Suggestion marked resolved by sid114 3 years ago
  • sid114 Avatar

    description should mention how to handle two trains with same times

  • sid114 Avatar

    so many things that can be done better with the kata:

    • issues given below
    • no solution imports in the testing suite
    • color choice of table headers is extremely poor for dark mode users
    • there are some inconsistencies with usage of , and . for decimal in the table

    i suggest unpublishing this kata, and working on all the flaws, otherwise you're gonna get downvoted to heck, and the kata will never be able to be approved

    • davidmaamoaix Avatar

      Personally I don't think it's that bad. Yes the description is a bit hard to understand, but I really like the idea of this kata, and don't think it should be unpublished as the above issues can be addressed rather easily (there's no fundamental issue after all). Apart from the minor issues, I think this kata is really nice.

    • sid114 Avatar

      i don't the kata is bad in itself too... it's just that there are too many (albeit minor) flaws

      by the time i typed the suggestion, the main issue was already fixed😂

  • davidmaamoaix Avatar

    Hi.

    Can we get some clarification on what each of the number in the chart (in the description) refers to? Like which hour number is the acceleration time, constant-speed travel time or deceleration time?

    In the current description, I don't think it's clear that the user has to deduce the constant-speed travel duration.

    Thanks.

  • sid114 Avatar

    This comment has been hidden.

  • rowcased Avatar

    This comment has been hidden.