;; The first three lines of this file were inserted by DrScheme. They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname 14.2.1) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor mixed-fraction #f #t none #f ())))
(require installed-teachpacks/picturing-programs)

; Worked exercise 14.2.1

; Assumes you've already done exercise 10.2.5, producing a draw handler named show-num-at-x.

; stop-on-key : number key -> number
(check-expect (stop-on-key 24 "whatever")
              (stop-with 24))

(define (stop-on-key model key)
  ; model        number
  ; key          whatever (ignore)
  (stop-with model)
  )

(big-bang 0
          (on-tick add1 .1)
          (on-draw show-num-at-x 500 100)
          (on-key stop-on-key)
          )