Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object BouncingBall {
- def bouncingBall(h: Double, bounce: Double, window: Double): Int = {
- if ((h > 0)&&(bounce > 0)&&(bounce < 1)&&(window < h))
- 2 + bouncingBall(h*bounce, bounce, window)
- else (-1)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement