#reader(lib "htdp-beginner-reader.ss" "lang")((modname signal-strengths) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ())))
(require (lib "moby.ss" "moby" "stub"))
(define-struct tower (id strength))
(define initial-world empty)
(define (update w)
(local [(define infos (get-signal-strengths))
(define (info->tower an-info)
(make-tower (first an-info)
(second an-info)))]
(map info->tower infos)))
(define (tower->string a-tower)
(string-append (number->string (tower-id a-tower))
" "
(number->string (tower-strength a-tower))))
(define (draw w)
(local [(define (tower->node a-tower)
(list (js-text (tower->string a-tower))))]
(list (js-p)
(list (js-text "Here are the following towers."))
(cons (js-p)
(map tower->node w))
(list (js-button update) (list (js-text "Update!"))))))
(define (draw-css)
'())
(js-big-bang initial-world
'()
(on-draw draw draw-css)
(on-tick 30 update))