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.
This solution would be better if it used a named constant instead of the abstract value.
This comment is hidden because it contains spoiler information about the solution
i made that mistake, thought that the bounce is the amount that is to be subtacted but it is the remainingheight after bounce.
There are people who can't do math, so...
What are you subtracting by? Setting the h to h*bounce gives you the new height and drop of the ball each iteration.
bloody hell I knew this had to be some type of formula he had to have known, thank you
because 'bounce' is literally how much % of the way the ball is reaching up since it's last descent from 'h' (h * bounce = new height of the ball), not how much it's descending per bounce.
At what point is it a programming challenge versus a math challenge? With a type of result like this it just seems like a problem your algebra teacher gave you, and not a great programming exercise.
Subtract bounce from height?
Why not subtract instead of multiply? Intuitively, it feels like subtraction makes sense to me.
Why not subtract instead of multiply? Intuitively, it feels like subtraction makes sense to me.
If the case evaluates true, then it executes the statement after the colon and before the break. So if the first case is not true, it checks the following cases.
This comment is hidden because it contains spoiler information about the solution
I had the same idea but your use of map in tandum with a ternary operator makes it shorter and cleaner.
Loading more items...