Ad
  • Default User Avatar

    #include <stdbool.h> is missing in the initial code in C

  • Custom User Avatar

    Awful kata requiring mind-boggling special casing until you hit the right 'spot', due to its poor description and dubious interpretations.

  • Default User Avatar

    ballTest(5, 'xxxxx')); being true bothers me; I think it should be false.
    Spec says
    'return whether or not the ball will be able to make it past the end of the road'
    'The ball must fall off of the edge of the road for the code to be considered valid.'
    The speed at the end of the road is -1, the ball is stuck on the 5th crack, never to make it past the end of the road.

  • Custom User Avatar

    Terrible details.

  • Default User Avatar

    You're correct thank you for the feedback! The description has been changed

  • Custom User Avatar

    The last tile has index roadmap.length - 1 though (as strings are zero-indexed), so if the position is roadmap.length, the ball will already have passed the final tile.

  • Default User Avatar

    I am not sure I understand completely what you are trying to say but I will attempt to explain. In your snippet, the program is checking (currentPosition >= roadmap.length) which does not imply that the ball has passed the final tile. It only means that it has reached the final tile. To check if it has passed, you must check (currentPosition > roadmap.length) instead. So the correct solution would use the example shown, meaning that the ball did not necessarily pass the final tile, but may have only reached it instead.

  • Custom User Avatar

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

  • Default User Avatar

    approved by author

  • Default User Avatar

    #include <stdbool.h> is missing in the initial code

  • Default User Avatar

    Точно... Скорость уменьшается - пропорционально уменьшается пройденное расстояние.

  • Custom User Avatar
  • Default User Avatar

    If the range is 62 and the speed is 10 and the ball can only travel 10+9+8...+1 then the ball will only end up traveling 55 units before the speed is 0

  • Default User Avatar

    test.assert_equals(ball_test(10, '______________________________________________________________'), False)

    Velocity equal 10
    Range equal 62
    Speed decrease 6
    Remaining speed 4
    Why result in 7 Test is False?

  • Custom User Avatar

    not working all, but code is corect

  • Loading more items...