svn: r17115

This commit is contained in:
Matthias Felleisen 2009-11-30 20:35:06 +00:00
parent ef194eb948
commit aee5ba80d7
2 changed files with 25 additions and 2 deletions

View File

@ -0,0 +1,23 @@
;; 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-intermediate-lambda-reader.ss" "lang")((modname test-stop) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ())))
(require 2htdp/universe)
;; on RETURN stop
(define (main debug?)
(big-bang ""
(on-key (lambda (w ke)
(cond
[(key=? ke "\r") (stop-with w)]
[(= (string-length ke) 1)
(string-append w ke)]
[else w])))
(state debug?)
(on-draw (lambda (w)
(place-image
(text w 22 'black)
3 3
(empty-scene 100 100))))))

View File

@ -8,6 +8,6 @@
(big-bang 0 (stop-when zero?) (on-tick add1))
"does big bang stop when the initial world is a stop world?"
(big-bang (STOP! 0) (on-tick add1))
(big-bang (stop-with 0) (on-tick add1))
(define-struct stop (x))
(define-struct stop (x))