From aee5ba80d7ffa523723f021b7eb60d6239454067 Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Mon, 30 Nov 2009 20:35:06 +0000 Subject: [PATCH] svn: r17115 --- collects/2htdp/tests/stop.ss | 23 +++++++++++++++++++++++ collects/2htdp/tests/world0-stops.ss | 4 ++-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 collects/2htdp/tests/stop.ss diff --git a/collects/2htdp/tests/stop.ss b/collects/2htdp/tests/stop.ss new file mode 100644 index 0000000000..f0307f3e5f --- /dev/null +++ b/collects/2htdp/tests/stop.ss @@ -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)))))) + \ No newline at end of file diff --git a/collects/2htdp/tests/world0-stops.ss b/collects/2htdp/tests/world0-stops.ss index 54fda9bf27..828a602cf5 100644 --- a/collects/2htdp/tests/world0-stops.ss +++ b/collects/2htdp/tests/world0-stops.ss @@ -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)) \ No newline at end of file +(define-struct stop (x))