racket/collects/htdp/Test/guess-gui.ss
2005-05-27 18:56:37 +00:00

22 lines
523 B
Scheme

;; TeachPack : guess-gui.ss
;; Language: Beginning
;; ------------------------------------------------------------------------
;; model : button% event% -> true
(define (model x y)
(view (convert (list (control 0) (control 1) (control 2)))))
;; convert : (listof DIGIT) -> number
;; to convert a list of digits into a number
;; the leading digit is the least signifcant one
(define (convert alod)
(cond
[(empty? alod) 0]
[else (+ (first alod) (* 10 (convert (rest alod))))]))
;; TEST:
(connect model)