Guided Practice 2.1

In Lesson 2.2 we wrote the following example:

;; ball-after-tick : Ball -> Ball
;; GIVEN: The state of a ball b
;; RETURNS: the state of given ball at the next tick
;; STRATEGY: cases on whether ball would hit the wall on ;; the next tick

(define (ball-after-tick b)
  (if (ball-would-hit-wall? b)
      (ball-after-bounce b)
      (ball-after-straight-travel b)))
What should be the contract and purpose statement for ball-after-bounce and ball-after-straight-travel?

[ANSWER]


Last modified: Tue Jul 26 23:28:07 Eastern Daylight Time 2016