7 kyu

Tube strike options calculator

320 of 1,637mcelearr
Description
Loading description...
Fundamentals
Algorithms
  • Please sign in or sign up to leave a comment.
  • ejini战神 Avatar
    • Python new test framework should be used (Refer this & this for more detail)

    • Ruby 3.0 should be enabled (Refer this & this for more detail)

  • khanhhuy288 Avatar

    This test: calculator(11, 15, 2). How can the bus win in this case? walkTime = 11/5 = 2.2; busTime = 15/8 + 2/5 = 2.275;

  • brafael808 Avatar

    I keep failing test 4:

    Test.assert_equals(calculator(5, 4, 3),"Walk","There's no point taking the bus if it drops you in the middle of nowhere!")
    

    1 <= 1, which in my code should return "Walk", but for some reason it keeps returning "Bus".

  • eliotsykes Avatar

    This comment has been hidden.

  • yurket Avatar

    One more question. Pretty frequently I get an error (bus sometimes all the tests pass)

    Falsifiable (after 1 test and 2145 shrinks): 
    expected: Walk 
     but got: Bus 
    1.1143910125511627 
    Positive {getPositive = 5.0e-324} 
    Positive {getPositive = 5.0e-324}
    

    So as I understand, in this test case walk distance = 1.1143910125511627, bus distance = 5.0e-324, distance to the bus = 5.0e-324. Why the correct answer is a Walk in this case? Or is it some test problem?

  • yurket Avatar

    Can't get right the 2nd test case: (4, 5, 1, Walk, "Come on, you can walk this!") Can't understand: walking takes 4/5 = 0.8 hour, while driving on bus takes (5+1)/8 = 0.75 hour. So the bus is faster. Why the answer is Walk? Thanks for the interesting kata by the way =)

  • Nestorfish Avatar

    Please fix ruby description of predefined speed variables: these are neither

    Constants
    

    as described, nor

    functions
    

    as syntax lets one think, but

    $global_variables
    
  • webtechalex Avatar

    Nice theme, man! I like it! :)

  • GiacomoSorbi Avatar

    Kata approved and translated, as you might have noticed :)

  • bkaes Avatar

    Please add at least one example. I completely missed that I don't run with 8km/h to the bus station (which you probably do if you see the bus coming). Other than that, nice kata and tests.

  • kenku102 Avatar

    The only issue I ran into was how to know if the bus will drop you off in the middle of nowhere, I spent a long time trying to figure that part out. But once I omitted my logic for it, all the test cases pased. Can you take a look at that.

  • MarkPearlCoZa Avatar

    This comment has been hidden.