From a5d04fdfe440c8a9962148df973203020c514431 Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Thu, 8 May 2008 15:01:56 +0000 Subject: [PATCH] testing done svn: r9742 --- collects/htdp/Test/hangman1.ss | 1 - collects/htdp/Test/master-play.ss | 3 + collects/htdp/Test/matrix-client.ss | 149 ++++-- collects/htdp/Test/matrix-example.ss | 601 ++++++++++++++----------- collects/htdp/Test/matrix-test.ss | 6 +- collects/htdp/Test/mouse-event-test.ss | 29 -- collects/htdp/Test/world-add-line.ss | 101 +++-- collects/htdp/Test/world-mouse.ss | 2 + 8 files changed, 504 insertions(+), 388 deletions(-) delete mode 100644 collects/htdp/Test/mouse-event-test.ss diff --git a/collects/htdp/Test/hangman1.ss b/collects/htdp/Test/hangman1.ss index 0757474134..7afc6c10c1 100644 --- a/collects/htdp/Test/hangman1.ss +++ b/collects/htdp/Test/hangman1.ss @@ -52,7 +52,6 @@ (check-error (hangman (make-word 'a 'b 'c) reveal draw-next-part) "hangman: primitive operator hangman expects a defined procedure name (usually `make-word') in this position") - (check-error (hangman make-word (reveal (make-word 'd 'e 'r) (make-word '_ '_ '_) 'd) draw-next-part) "hangman: primitive operator hangman expects a defined procedure name (usually `reveal') in this position") diff --git a/collects/htdp/Test/master-play.ss b/collects/htdp/Test/master-play.ss index 682ebf2bc4..a63a8ec82f 100644 --- a/collects/htdp/Test/master-play.ss +++ b/collects/htdp/Test/master-play.ss @@ -1,3 +1,6 @@ +;; 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-beginner-reader.ss" "lang")((modname master-play) (read-case-sensitive #t) (teachpacks ((lib "guess-gui.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "guess-gui.ss" "teachpack" "htdp"))))) (define-signature masterTS (go)) (define (masterT N) diff --git a/collects/htdp/Test/matrix-client.ss b/collects/htdp/Test/matrix-client.ss index b9126ec2c4..df4592d3b3 100644 --- a/collects/htdp/Test/matrix-client.ss +++ b/collects/htdp/Test/matrix-client.ss @@ -9,7 +9,7 @@ http://www.plt-scheme.org |# - 45 7 #"wxtext\0" + 29 7 #"wxtext\0" 3 1 6 #"wxtab\0" 1 1 8 #"wxmedia\0" 4 1 8 #"wximage\0" @@ -24,22 +24,6 @@ 1 0 36 #"(lib \"cache-image-snip.ss\" \"mrlib\")\0" 1 0 25 #"(lib \"matrix.ss\" \"htdp\")\0" 1 0 22 #"drscheme:lambda-snip%\0" -1 0 8 #"gb:core\0" -5 0 10 #"gb:canvas\0" -5 0 17 #"gb:editor-canvas\0" -5 0 10 #"gb:slider\0" -5 0 9 #"gb:gauge\0" -5 0 11 #"gb:listbox\0" -5 0 12 #"gb:radiobox\0" -5 0 10 #"gb:choice\0" -5 0 8 #"gb:text\0" -5 0 11 #"gb:message\0" -5 0 10 #"gb:button\0" -5 0 12 #"gb:checkbox\0" -5 0 18 #"gb:vertical-panel\0" -5 0 9 #"gb:panel\0" -5 0 20 #"gb:horizontal-panel\0" -5 0 33 #"(lib \"readable.ss\" \"guibuilder\")\0" 1 0 56 ( #"(lib \"hrule-snip.ss\" \"macro-debugger\" \"syntax-browse" @@ -61,7 +45,7 @@ 1 0 32 #"(lib \"text-snipclass.ss\" \"xml\")\0" 1 0 15 #"test-case-box%\0" 2 0 1 6 #"wxloc\0" -00000000000 1 54 0 1 #"\0" +00000000000 1 84 0 1 #"\0" 0 75 1 #"\0" 0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 0 9 #"Standard\0" @@ -216,11 +200,101 @@ 1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 2 1 #"\0" 0 71 1 #"\0" -1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 100 0 0 0 0 -1 -1 0 1 +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0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1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 19 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 4 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 17 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 0 1 #"\0" 0 75 12 #"Courier New\0" -0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 -00000000002 0 00000000000 13 00000000000 819 0 4 3 85 +0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 4 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 17 +1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 22 +1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 15 +1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 14 +1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 20 +1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 2 +1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 2 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1 1 1 65 105 225 0 0 0 -1 -1 4 1 +#"\0" +0 -1 1 #"\0" +1 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 255 255 0 -1 -1 19 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 4 +1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 178 34 34 255 255 255 -1 +-1 0 1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 -1 24 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 -1 -1 24 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1 1 1 178 34 34 0 0 0 -1 -1 24 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 +00000000002 0 00000000000 13 00000000000 803 0 4 3 85 ( #";; The first three lines of this file were inserted by DrScheme. Th" #"ey record metadata" @@ -230,15 +304,12 @@ #";; about the language level of this file in a form that our tools c" #"an easily process." ) 0 0 4 29 1 #"\n" -0 0 4 3 337 +0 0 4 3 191 ( #"#reader(lib \"htdp-intermediate-lambda-reader.ss\" \"lang\"" - #")((modname matrix-client) (read-case-sensitive #t) (teachpacks ((li" - #"b \"world.ss\" \"teachpack\" \"htdp\") (lib \"testing" - #".ss\" \"teachpack\" \"htdp\"))) (htdp-settings #(#t const" - #"ructor repeating-decimal #f #t none #f ((lib \"world.ss\" \"t" - #"eachpack\" \"htdp\") (lib \"testing.ss\" \"teachpack" - #"\" \"htdp\")))))" + #")((modname matrix-client) (read-case-sensitive #t) (teachpacks ()) " + #"(htdp-settings #(#t constructor repeating-decimal #f #t none #f ())" + #"))" ) 0 0 4 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 14 3 7 #"require" @@ -251,17 +322,6 @@ 0 0 19 3 6 #"\"htdp\"" 0 0 22 3 2 #"))" 0 0 4 29 1 #"\n" -0 0 22 3 1 #"(" -0 0 14 3 7 #"require" -0 0 4 3 1 #" " -0 0 22 3 1 #"(" -0 0 14 3 3 #"lib" -0 0 4 3 1 #" " -0 0 19 3 12 #"\"testing.ss\"" -0 0 4 3 1 #" " -0 0 19 3 6 #"\"htdp\"" -0 0 22 3 2 #"))" -0 0 4 29 1 #"\n" 0 0 4 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 15 3 6 #"define" @@ -295,8 +355,7 @@ 0 0 4 3 1 #" " 0 0 20 3 1 #"'" 0 0 14 3 1 #"f" -0 0 22 3 2 #"))" -0 0 22 3 1 #")" +0 0 22 3 3 #")))" 0 0 4 29 1 #"\n" 0 0 4 29 1 #"\n" 0 0 22 3 1 #"(" @@ -464,8 +523,7 @@ 0 0 14 3 3 #"a11" 0 0 4 3 1 #" " 0 0 14 3 3 #"a12" -0 0 22 3 2 #"))" -0 0 22 3 1 #")" +0 0 22 3 3 #")))" 0 0 4 29 1 #"\n" 0 0 4 29 1 #"\n" 0 0 22 3 1 #"(" @@ -1235,7 +1293,7 @@ 0 0 14 3 1 #"n" 0 0 4 3 1 #" " 0 0 22 3 1 #"(" -0 0 14 3 8 #"matrix-n" +0 0 14 3 11 #"matrix-rows" 0 0 4 3 1 #" " 0 0 14 3 1 #"M" 0 0 22 3 2 #"))" @@ -1496,8 +1554,5 @@ 0 0 19 3 28 #"\"the above test should fail\"" 0 0 4 29 1 #"\n" 0 0 4 29 1 #"\n" -0 0 22 3 1 #"(" -0 0 14 3 15 #"generate-report" -0 0 22 3 1 #")" 0 0 4 29 1 #"\n" 0 00000000000 diff --git a/collects/htdp/Test/matrix-example.ss b/collects/htdp/Test/matrix-example.ss index 37694463cf..fb05545b5d 100644 --- a/collects/htdp/Test/matrix-example.ss +++ b/collects/htdp/Test/matrix-example.ss @@ -9,7 +9,7 @@ http://www.plt-scheme.org |# - 45 7 #"wxtext\0" + 29 7 #"wxtext\0" 3 1 6 #"wxtab\0" 1 1 8 #"wxmedia\0" 4 1 8 #"wximage\0" @@ -24,22 +24,6 @@ 1 0 36 #"(lib \"cache-image-snip.ss\" \"mrlib\")\0" 1 0 25 #"(lib \"matrix.ss\" \"htdp\")\0" 1 0 22 #"drscheme:lambda-snip%\0" -1 0 8 #"gb:core\0" -5 0 10 #"gb:canvas\0" -5 0 17 #"gb:editor-canvas\0" -5 0 10 #"gb:slider\0" -5 0 9 #"gb:gauge\0" -5 0 11 #"gb:listbox\0" -5 0 12 #"gb:radiobox\0" -5 0 10 #"gb:choice\0" -5 0 8 #"gb:text\0" -5 0 11 #"gb:message\0" -5 0 10 #"gb:button\0" -5 0 12 #"gb:checkbox\0" -5 0 18 #"gb:vertical-panel\0" -5 0 9 #"gb:panel\0" -5 0 20 #"gb:horizontal-panel\0" -5 0 33 #"(lib \"readable.ss\" \"guibuilder\")\0" 1 0 56 ( #"(lib \"hrule-snip.ss\" \"macro-debugger\" \"syntax-browse" @@ -61,7 +45,7 @@ 1 0 32 #"(lib \"text-snipclass.ss\" \"xml\")\0" 1 0 15 #"test-case-box%\0" 2 0 1 6 #"wxloc\0" -00000000000 1 55 0 1 #"\0" +00000000000 1 81 0 1 #"\0" 0 75 1 #"\0" 0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 255 255 255 1 -1 0 9 #"Standard\0" @@ -216,14 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 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 14 +1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 20 +1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 2 +1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 2 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 1 0 0 0 0 0 0 0 0 1 1 1 65 105 225 0 0 0 -1 -1 4 1 +#"\0" +0 -1 1 #"\0" +1 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 255 255 0 -1 -1 19 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 4 +1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 178 34 34 255 255 255 -1 +-1 0 1 #"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 -1 +00000000002 0 00000000000 13 00000000000 507 0 4 3 85 ( #";; The first three lines of this file were inserted by DrScheme. Th" #"ey record metadata" @@ -233,107 +295,99 @@ #";; about the language level of this file in a form that our tools c" #"an easily process." ) 0 0 4 29 1 #"\n" -0 0 4 3 327 +0 0 4 3 192 ( #"#reader(lib \"htdp-intermediate-lambda-reader.ss\" \"lang\"" - #")((modname toy) (read-case-sensitive #t) (teachpacks ((lib \"worl" - #"d.ss\" \"teachpack\" \"htdp\") (lib \"testing.ss\" " - #"\"teachpack\" \"htdp\"))) (htdp-settings #(#t constructor r" - #"epeating-decimal #f #t none #f ((lib \"world.ss\" \"teachpack" - #"\" \"htdp\") (lib \"testing.ss\" \"teachpack\" \"ht" - #"dp\")))))" + #")((modname matrix-example) (read-case-sensitive #t) (teachpacks ())" + #" (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()" + #")))" ) 0 0 4 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 14 3 7 #"require" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 3 #"lib" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 19 3 11 #"\"matrix.ss\"" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 19 3 6 #"\"htdp\"" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" +0 0 22 3 2 #"))" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 17 3 26 #";; Matrix Matrix -> Matrix" -0 0 4 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 17 3 20 #";; add two matrices " -0 0 4 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 15 3 6 #"define" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 2 #"+m" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"one" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"two" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 2 #" " +0 0 69 29 1 #"\n" +0 0 69 3 2 #" " 0 0 22 3 1 #"(" 0 0 14 3 12 #"build-matrix" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" -0 0 14 3 8 #"matrix-n" -0 0 4 3 1 #" " +0 0 14 3 11 #"matrix-rows" +0 0 69 3 1 #" " 0 0 14 3 3 #"one" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" -0 0 14 3 8 #"matrix-m" -0 0 4 3 1 #" " +0 0 14 3 11 #"matrix-cols" +0 0 69 3 1 #" " 0 0 14 3 3 #"one" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 16 #" " +0 0 69 29 1 #"\n" +0 0 69 3 16 #" " 0 0 22 3 1 #"(" 0 0 15 3 6 #"lambda" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 1 #"i" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"j" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 18 #" " +0 0 69 29 1 #"\n" +0 0 69 3 18 #" " 0 0 22 3 1 #"(" 0 0 14 3 1 #"+" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 10 #"matrix-ref" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"one" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"i" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"j" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 21 #" " +0 0 69 29 1 #"\n" +0 0 69 3 21 #" " 0 0 22 3 1 #"(" 0 0 14 3 10 #"matrix-ref" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"two" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"i" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"j" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" +0 0 22 3 5 #")))))" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 14 3 12 #"check-expect" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 2 #"+m" -0 0 4 3 1 #" " -0 13 00000000004 4 12527 +0 0 69 3 1 #" " +0 13 00000000004 69 12527 ( #"(((1 2 3) (0 0 1)) (#(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255" #" 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 " @@ -522,8 +576,8 @@ #" 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 " #"255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0" #" 0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) 40 0 0))\0" -) 0 0 4 3 1 #" " -0 13 00000000004 4 12526 +) 0 0 69 3 1 #" " +0 13 00000000004 69 12526 ( #"(((1 1 1) (2 0 1)) (#(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255" #" 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 " @@ -713,8 +767,8 @@ #"55 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 " #"0 255 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) 40 0 0))\0" ) 0 0 22 3 1 #")" -0 0 4 3 1 #" " -0 13 00000000004 4 12523 +0 0 69 3 1 #" " +0 13 00000000004 69 12523 ( #"(((2 3 4) (2 0 2)) (#(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255" #" 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 " @@ -904,78 +958,74 @@ #"0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 2" #"55 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) 40 0 0))\0" ) 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 17 3 27 #";; Number Matrix -> Matrix " -0 0 4 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 17 3 35 #";; multiply a matrix with a scalar " -0 0 4 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 15 3 6 #"define" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 2 #"*s" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"s" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"mat" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 2 #" " +0 0 69 29 1 #"\n" +0 0 69 3 2 #" " 0 0 22 3 1 #"(" 0 0 14 3 12 #"build-matrix" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" -0 0 14 3 8 #"matrix-n" -0 0 4 3 1 #" " +0 0 14 3 11 #"matrix-rows" +0 0 69 3 1 #" " 0 0 14 3 3 #"mat" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" -0 0 14 3 8 #"matrix-m" -0 0 4 3 1 #" " +0 0 14 3 11 #"matrix-cols" +0 0 69 3 1 #" " 0 0 14 3 3 #"mat" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 16 #" " +0 0 69 29 1 #"\n" +0 0 69 3 16 #" " 0 0 22 3 1 #"(" 0 0 15 3 6 #"lambda" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 1 #"i" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"j" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 1 #"*" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"s" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 10 #"matrix-ref" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"mat" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"i" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"j" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" +0 0 22 3 5 #")))))" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 14 3 12 #"check-expect" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 2 #"*s" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 3 #"100" -0 0 4 3 1 #" " -0 13 00000000004 4 12523 +0 0 69 3 1 #" " +0 13 00000000004 69 12523 ( #"(((2 3 4) (2 0 2)) (#(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255 0 0 0 255" #" 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 " @@ -1165,314 +1215,347 @@ #"0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 2" #"55 0 0 0 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) 40 0 0))\0" ) 0 0 22 3 1 #")" -0 0 4 3 1 #" " -0 0 4 29 1 #"\n" -0 0 4 3 14 #" " +0 0 69 3 1 #" " +0 0 69 29 1 #"\n" +0 0 69 3 14 #" " 0 0 22 3 1 #"(" 0 0 14 3 17 #"rectangle->matrix" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"'" -0 0 22 3 1 #"(" -0 0 22 3 1 #"(" +0 0 22 3 2 #"((" 0 0 20 3 3 #"200" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 3 #"300" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 3 #"400" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 35 #" " +0 0 69 29 1 #"\n" +0 0 69 3 35 #" " 0 0 22 3 1 #"(" 0 0 20 3 3 #"200" -0 0 4 3 1 #" " -0 0 4 3 1 #" " -0 0 4 3 1 #" " +0 0 69 3 1 #" " +0 0 69 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"0" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 3 #"200" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" +0 0 22 3 4 #"))))" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 17 3 41 #";; Matrix[n x m] Matrix[m x k] -> Matrix " -0 0 4 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 17 3 25 #";; multiply two matrices " -0 0 4 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 15 3 6 #"define" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 2 #"*m" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"one" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"two" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 2 #" " +0 0 69 29 1 #"\n" +0 0 69 3 2 #" " 0 0 22 3 1 #"(" 0 0 14 3 12 #"build-matrix" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" -0 0 14 3 8 #"matrix-n" -0 0 4 3 1 #" " +0 0 14 3 11 #"matrix-rows" +0 0 69 3 1 #" " 0 0 14 3 3 #"one" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" -0 0 14 3 8 #"matrix-m" -0 0 4 3 1 #" " +0 0 14 3 11 #"matrix-cols" +0 0 69 3 1 #" " 0 0 14 3 3 #"two" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 16 #" " +0 0 69 29 1 #"\n" +0 0 69 3 16 #" " 0 0 22 3 1 #"(" 0 0 15 3 6 #"lambda" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 1 #"i" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"j" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 18 #" " +0 0 69 29 1 #"\n" +0 0 69 3 18 #" " 0 0 22 3 1 #"(" 0 0 14 3 3 #"Sum" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 12 #"MultiplyEach" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 10 #"matrix-row" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"one" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"i" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 10 #"matrix-col" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"two" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"j" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" +0 0 22 3 6 #"))))))" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 17 3 35 #";; Sum : [Listof Number] -> Number " -0 0 4 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 15 3 6 #"define" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 3 #"Sum" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"lon" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 5 #"apply" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"+" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"lon" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" +0 0 22 3 2 #"))" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 17 3 60 ( #";; MultiplyEach : [Listof Number] [Listof Number] -> Nu" #"mber " -) 0 0 4 29 1 #"\n" +) 0 0 69 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 15 3 6 #"define" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" -0 0 14 3 4 #"Mult" -0 0 14 3 8 #"iplyEach" -0 0 4 3 1 #" " +0 0 14 3 12 #"MultiplyEach" +0 0 69 3 1 #" " 0 0 14 3 3 #"one" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"two" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 3 #"map" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"*" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"one" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 3 #"two" -0 0 22 3 1 #")" -0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" +0 0 22 3 2 #"))" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 15 3 6 #"define" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 10 #"matrix-row" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"M" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"i" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 10 #"build-list" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" -0 0 14 3 8 #"matrix-m" -0 0 4 3 1 #" " +0 0 14 3 11 #"matrix-cols" +0 0 69 3 1 #" " 0 0 14 3 1 #"M" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 15 3 6 #"lambda" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 1 #"j" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 10 #"matrix-ref" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"M" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"i" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"j" 0 0 22 3 4 #"))))" -0 0 4 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 15 3 6 #"define" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 10 #"matrix-col" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"M" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"j" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 10 #"build-list" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" -0 0 14 3 8 #"matrix-n" -0 0 4 3 1 #" " +0 0 14 3 11 #"matrix-rows" +0 0 69 3 1 #" " 0 0 14 3 1 #"M" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 15 3 6 #"lambda" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 1 #"i" 0 0 22 3 1 #")" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 10 #"matrix-ref" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"M" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"i" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 14 3 1 #"j" 0 0 22 3 4 #"))))" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" -0 0 22 3 1 #"(" -0 0 14 3 12 #"check-expect" -0 0 4 3 1 #" " +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" 0 0 22 3 1 #"(" 0 0 14 3 2 #"*m" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 17 #"rectangle->matrix" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"'" 0 0 22 3 2 #"((" 0 0 20 3 1 #"1" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"0" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 39 #" " +0 0 69 29 1 #"\n" +0 0 69 3 39 #" " 0 0 22 3 1 #"(" 0 0 20 3 1 #"0" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"1" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 39 #" " +0 0 69 29 1 #"\n" +0 0 69 3 39 #" " 0 0 22 3 1 #"(" 0 0 20 3 1 #"2" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"1" 0 0 22 3 3 #")))" -0 0 4 29 1 #"\n" -0 0 4 3 18 #" " +0 0 69 29 1 #"\n" +0 0 69 3 18 #" " 0 0 22 3 1 #"(" 0 0 14 3 17 #"rectangle->matrix" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"'" 0 0 22 3 2 #"((" 0 0 20 3 1 #"1" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"0" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 39 #" " +0 0 69 29 1 #"\n" +0 0 69 3 39 #" " 0 0 22 3 1 #"(" 0 0 20 3 1 #"0" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"1" 0 0 22 3 4 #"))))" -0 0 4 29 1 #"\n" -0 0 4 3 14 #" " +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" +0 0 17 3 2 #"#;" +0 0 69 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 14 3 12 #"check-expect" +0 0 69 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 2 #"*m" +0 0 69 3 1 #" " 0 0 22 3 1 #"(" 0 0 14 3 17 #"rectangle->matrix" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"'" 0 0 22 3 2 #"((" 0 0 20 3 1 #"1" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"0" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 35 #" " +0 0 69 29 1 #"\n" +0 0 69 3 39 #" " 0 0 22 3 1 #"(" 0 0 20 3 1 #"0" -0 0 4 3 1 #" " +0 0 69 3 1 #" " 0 0 20 3 1 #"1" 0 0 22 3 1 #")" -0 0 4 29 1 #"\n" -0 0 4 3 35 #" " +0 0 69 29 1 #"\n" +0 0 69 3 39 #" " 0 0 22 3 1 #"(" 0 0 20 3 1 #"2" -0 0 4 3 1 #" " +0 0 69 3 1 #" " +0 0 20 3 1 #"1" +0 0 22 3 3 #")))" +0 0 69 29 1 #"\n" +0 0 69 3 18 #" " +0 0 22 3 1 #"(" +0 0 14 3 17 #"rectangle->matrix" +0 0 69 3 1 #" " +0 0 20 3 1 #"'" +0 0 22 3 2 #"((" +0 0 20 3 1 #"1" +0 0 69 3 1 #" " +0 0 20 3 1 #"0" +0 0 22 3 1 #")" +0 0 69 29 1 #"\n" +0 0 69 3 39 #" " +0 0 22 3 1 #"(" +0 0 20 3 1 #"0" +0 0 69 3 1 #" " 0 0 20 3 1 #"1" 0 0 22 3 4 #"))))" -0 0 4 29 1 #"\n" -0 0 4 29 1 #"\n" +0 0 69 29 1 #"\n" +0 0 69 3 14 #" " 0 0 22 3 1 #"(" -0 0 14 3 15 #"generate-report" +0 0 14 3 17 #"rectangle->matrix" +0 0 69 3 1 #" " +0 0 20 3 1 #"'" +0 0 22 3 2 #"((" +0 0 20 3 1 #"1" +0 0 69 3 1 #" " +0 0 20 3 1 #"0" 0 0 22 3 1 #")" +0 0 69 29 1 #"\n" +0 0 69 3 35 #" " +0 0 22 3 1 #"(" +0 0 20 3 1 #"0" +0 0 69 3 1 #" " +0 0 20 3 1 #"1" +0 0 22 3 1 #")" +0 0 69 29 1 #"\n" +0 0 69 3 35 #" " +0 0 22 3 1 #"(" +0 0 20 3 1 #"2" +0 0 69 3 1 #" " +0 0 20 3 1 #"1" +0 0 22 3 4 #"))))" +0 0 69 29 1 #"\n" +0 0 69 29 1 #"\n" 0 00000000000 diff --git a/collects/htdp/Test/matrix-test.ss b/collects/htdp/Test/matrix-test.ss index 127e9f4a99..e6d59e2c26 100644 --- a/collects/htdp/Test/matrix-test.ss +++ b/collects/htdp/Test/matrix-test.ss @@ -1,8 +1,8 @@ ;; 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 matrix-test) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ()))) -(require (lib "matrix-invisible.ss" "htdp")) -;(require (lib "matrix.ss" "htdp")) +;(require (lib "matrix-invisible.ss" "htdp")) +(require (lib "matrix.ss" "htdp")) (define r1 '((a00 a01 a02) (a10 a11 a12))) @@ -53,4 +53,4 @@ ;; --- IMPERATIVE --- (check-expect (matrix-ref m1 0 0) 'a00) (define m1-modified (matrix-set! m1 0 0 'xxx)) ;; <-------- uncomment this and the test engine breaks -; (check-expect (matrix-ref m1 0 0) 'xxx) +(check-expect (matrix-ref m1 0 0) 'xxx) diff --git a/collects/htdp/Test/mouse-event-test.ss b/collects/htdp/Test/mouse-event-test.ss deleted file mode 100644 index 1c4dfb2c9c..0000000000 --- a/collects/htdp/Test/mouse-event-test.ss +++ /dev/null @@ -1,29 +0,0 @@ -;; code below relies on the felixs-world.ss teachpack. -(define-struct info (count x y s)) - -;; A World is a (make-info Num Num Num MouseEventType) - -;; A MouseEventType is one of: -;; - 'button-down -;; - 'button-up -;; - 'drag -;; - 'move -;; - 'enter -;; - 'leave - -;; handle-mouse-event : World Num Num MouseEventType -> World -(define (handle-mouse-event w x y s) - (make-info (add1 (info-count w)) x y s)) - -;; draw-world : World -> Image -(define (draw-world w) - (overlay - (move-pinhole (text (string-append "count: " (number->string (info-count w))) 20 'blue) 0 -20) - (move-pinhole (text (string-append "x: " (number->string (info-x w))) 20 'red) 0 -40) - (move-pinhole (text (string-append "y: " (number->string (info-y w))) 20 'yellow) 0 -60) - (move-pinhole (text (string-append "type: " (symbol->string (info-s w))) 20 'green) 0 -80) - )) - -(big-bang 500 500 0.1 (make-info 0 0 0 'none)) -(on-redraw draw-world) -(on-mouse-event handle-mouse-event) diff --git a/collects/htdp/Test/world-add-line.ss b/collects/htdp/Test/world-add-line.ss index 85482a6f25..241d2caef8 100644 --- a/collects/htdp/Test/world-add-line.ss +++ b/collects/htdp/Test/world-add-line.ss @@ -1,67 +1,70 @@ -(require htdp/world) +;; 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-beginner-reader.ss" "lang")((modname world-add-line) (read-case-sensitive #t) (teachpacks ((lib "world.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "world.ss" "teachpack" "htdp"))))) +(require (lib "world.ss" "htdp")) (define plain (empty-scene 100 100)) -(add-line plain .5 10.3 -20 80 'red) +(scene+line plain .5 10.3 -20 80 'red) 'verticals -(equal? (add-line plain -10 90 -10 80 'red) plain) -(equal? (add-line plain 110 90 110 80 'red) plain) -(equal? (add-line plain +10 90 +10 80 'red) - (add-line plain +10 90 +10 80 'red)) +(check-expect (scene+line plain -10 90 -10 80 'red) plain) +(check-expect (scene+line plain 110 90 110 80 'red) plain) +(check-expect (scene+line plain +10 90 +10 80 'red) + (scene+line plain +10 90 +10 80 'red)) #; -(equal? (add-line plain +10 900000 +10 80 'red) - (add-line plain +10 100 +10 80 'red)) +(check-expect (scene+line plain +10 900000 +10 80 'red) + (scene+line plain +10 100 +10 80 'red)) ;; can't make image of this size -(equal? (add-line plain +10 -10 +10 80 'red) - (add-line plain +10 0 +10 80 'red)) +(check-expect (scene+line plain +10 -10 +10 80 'red) + (scene+line plain +10 0 +10 80 'red)) 'horizontals -(equal? (add-line plain 20 -10 30 -10 'red) plain) -(equal? (add-line plain 20 110 30 110 'red) plain) -(equal? (add-line plain 20 +10 30 +10 'red) - (add-line plain 20 +10 30 +10 'red)) +(check-expect (scene+line plain 20 -10 30 -10 'red) plain) +(check-expect (scene+line plain 20 110 30 110 'red) plain) +(check-expect (scene+line plain 20 +10 30 +10 'red) + (scene+line plain 20 +10 30 +10 'red)) #; -(equal? (add-line plain 20 +10 30000 +10 'red) - (add-line plain 20 +10 100 +10 'red)) +(check-expect (scene+line plain 20 +10 30000 +10 'red) + (scene+line plain 20 +10 100 +10 'red)) ;; can't make image of this size 'inside-outside -(equal? (add-line plain 10 10 -10 -10 'red) ; upper-left - (add-line plain 10 10 0 0 'red)) -(equal? (add-line plain 10 10 -10 0 'red) ; upper-left - (add-line plain 10 10 0 5 'red)) -(equal? (add-line plain 90 10 110 -10 'red) ; upper-right - (add-line plain 90 10 100 0 'red)) -(equal? (add-line plain 90 10 110 0 'red) ; upper-left - (add-line plain 90 10 100 5 'red)) -(equal? (add-line plain 90 90 110 110 'red) ; lower-right - (add-line plain 90 90 100 100 'red)) -(equal? (add-line plain 90 90 110 100 'red) ; lower-right - (add-line plain 90 90 100 95 'red)) -(equal? (add-line plain 110 110 10 10 'red) ; lower-right - (add-line plain 10 10 100 100 'red)) -(equal? (add-line plain 10 10 210 110 'red) ; lower-right - (add-line plain 10 10 100 55 'red)) -(equal? (add-line plain 10 10 -10 30 'red) ; lower-left - (add-line plain 10 10 0 20 'red)) -(equal? (add-line plain 10 10 -10 210 'red) ; lower-left - (add-line plain 10 10 0 110 'red)) +(check-expect (scene+line plain 10 10 -10 -10 'red) ; upper-left + (scene+line plain 10 10 0 0 'red)) +(check-expect (scene+line plain 10 10 -10 0 'red) ; upper-left + (scene+line plain 10 10 0 5 'red)) +(check-expect (scene+line plain 90 10 110 -10 'red) ; upper-right + (scene+line plain 90 10 100 0 'red)) +(check-expect (scene+line plain 90 10 110 0 'red) ; upper-left + (scene+line plain 90 10 100 5 'red)) +(check-expect (scene+line plain 90 90 110 110 'red) ; lower-right + (scene+line plain 90 90 100 100 'red)) +(check-expect (scene+line plain 90 90 110 100 'red) ; lower-right + (scene+line plain 90 90 100 95 'red)) +(check-expect (scene+line plain 110 110 10 10 'red) ; lower-right + (scene+line plain 10 10 100 100 'red)) +(check-expect (scene+line plain 10 10 210 110 'red) ; lower-right + (scene+line plain 10 10 100 55 'red)) +(check-expect (scene+line plain 10 10 -10 30 'red) ; lower-left + (scene+line plain 10 10 0 20 'red)) +(check-expect (scene+line plain 10 10 -10 210 'red) ; lower-left + (scene+line plain 10 10 0 110 'red)) 'outside-outside -(equal? (add-line plain -100 10 300 50 'red) ;; left-right - (add-line plain 0 20 100 30 'red)) -(equal? (add-line plain -50 0 60 110 'red) ;; left-low - (add-line plain 0 50 50 100 'red)) -(equal? (add-line plain -50 50 60 -5 'red) ;; left-top - (add-line plain 0 25 50 0 'red)) -(equal? (add-line plain -10 -10 110 50 'red) ;; top-right - (add-line plain 10 0 100 45 'red)) -(equal? (add-line plain -10 -10 110 110 'red) ;; top-low - (add-line plain 0 0 100 100 'red)) -(equal? (add-line plain -10 110 110 50 'red) ;; low-right - (add-line plain 0 105 100 55 'red)) +(check-expect (scene+line plain -100 10 300 50 'red) ;; left-right + (scene+line plain 0 20 100 30 'red)) +(check-expect (scene+line plain -50 0 60 110 'red) ;; left-low + (scene+line plain 0 50 50 100 'red)) +(check-expect (scene+line plain -50 50 60 -5 'red) ;; left-top + (scene+line plain 0 25 50 0 'red)) +(check-expect (scene+line plain -10 -10 110 50 'red) ;; top-right + (scene+line plain 10 0 100 45 'red)) +(check-expect (scene+line plain -10 -10 110 110 'red) ;; top-low + (scene+line plain 0 0 100 100 'red)) +(check-expect (scene+line plain -10 110 110 50 'red) ;; low-right + (scene+line plain 0 105 100 55 'red)) 'totally-outside -(equal? (add-line plain -100 -100 -200 -500 'red) plain) +(check-expect (scene+line plain -100 -100 -200 -500 'red) plain) diff --git a/collects/htdp/Test/world-mouse.ss b/collects/htdp/Test/world-mouse.ss index 67d84b7bf3..6a1873b2a8 100644 --- a/collects/htdp/Test/world-mouse.ss +++ b/collects/htdp/Test/world-mouse.ss @@ -1,3 +1,5 @@ +#lang scheme + (require htdp/world) (with-handlers ((exn? (lambda (x) #t)))