Ad
  • Custom User Avatar

    he just wanna code in one raw lol

  • Custom User Avatar

    I guess parameter 'a' means height,'b' means bounce ,'c' means window,and if a>c the default 'd'(also equals bounceTimes would be 1, cuz the ball would at least pass through the window one time),and 'e' is used for controlling the logical operator(&&).
    At first, e = 1, so (e&&(condition)) will return true if the condition return a truthy value;and return false if condition return a falsy value.
    Because 1&&true===true 1&&false===false.
    And if the (a<0||b<0||b>=1||c>=a) return false, then calling the loop bouncingBall until 'a' is no bigger than 'c', the point is in here, 'e' will and always be 0 , that is preventing the code from returning -1(if the condition always return false,then the ternary operator will do the second statement, where the code is behind colon) .