Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
http://www.jsfuck.com
They were coding as fast as they can
huh
If this is your first kata, do yourself a favour and don't mess with floating point numbers. ( The kata doesn't actually even strictly need them. ) See below; those Docs do a fair job of explaining the problem ( and the "solution" ).
If you can't make the task fit the backstory, or the backstory the task, keeping it unpublished is an option. Replace velocity by speed, either introduce an angle or restrict movement to 1D ( thus either positive or negative ), and it might yet work. But it'll need a better description, and keeping the physics realistic would keep things simpler to explain.
Good luck!
this is a good point, this is my first kata and wasn't too sure of how to go about this. i might just delete the kata.
If velocity is positive, and friction is interpreted as drag, it might be?
The whole kata is not very strict with its terminology, or its units, or really its physics.
This is a weird way to represent friction, and the description does not do a good job of explaining it.
Friction, or drag, must always have a sign opposite to velocity ( otherwise, it'd be speed - velocity is speed in a direction ), and must always be smaller than it, physically. If friction can somehow be bigger than negative velocity ( impact with a heavier object? ), (a) it's no longer friction and (b) yes, it can reverse velocity.
If it's supposed to model cumulative friction over time, the model also breaks down - friction at any moment can still never be bigger than negative velocity, so can never sum to more than negative velocity.
Or maybe you just need a different model to explain what you want us to calculate, because this one doesn't work.
Backstories are nice, but they should be somewhat believable.
Friction can be negative?
expected 1.8000000000000003 to deeply equal 1.8
The test cases should allow for floating point inaccuracies instead of using strict comparisons, see the docs here.
v=0.9271393100564309
,f=0.0847028626832449
expected 0.08011068322398196 to deeply equal 0.842436447373186
Why? The velocity is supposed to decrease to as close 0 as possible, but not below. Why stop after 1 decrement of friction?
This comment is hidden because it contains spoiler information about the solution
man wrote a book on how to find a needle in a haystack that is probably in a fram in a barn possibly near rural texas.
how? what? why? ... actually, you know what, do what you do, it's beautiful.