#lang whalesong
(require whalesong/web-world
         whalesong/resource)

(define-resource index.html)

(current-output-port (open-output-element "stdout"))


;; draw: world view -> view
(define (draw w v)
  (update-view-text (view-focus v "counter") w))



;; tick: world view -> world
(define (tick w v)
  (printf "Tick ~s\n" w)
  (+ w 1))

(big-bang 0
          (initial-view index.html)
          (to-draw draw)
          (on-tick tick 1)
          (stop-when (lambda (w v)
                       (> w 10))))
