From 261aa3937ac7a768c332313ee352b7b68c00cec5 Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Sat, 2 Jan 2010 21:47:08 +0000 Subject: [PATCH] performance bug, more fixes svn: r17463 --- collects/2htdp/private/world.ss | 45 +- collects/2htdp/tests/perform-robby.ss | 21 + collects/2htdp/tests/perform-whack.ss | 1361 +++++++++++++++++++++++++ collects/2htdp/tests/profile-robby.ss | 14 + 4 files changed, 1431 insertions(+), 10 deletions(-) create mode 100644 collects/2htdp/tests/perform-robby.ss create mode 100644 collects/2htdp/tests/perform-whack.ss create mode 100644 collects/2htdp/tests/profile-robby.ss diff --git a/collects/2htdp/private/world.ss b/collects/2htdp/private/world.ss index 2a26e7679b..989450c601 100644 --- a/collects/2htdp/private/world.ss +++ b/collects/2htdp/private/world.ss @@ -210,6 +210,10 @@ (rec on-receive)) (define drawing #f) ;; Boolean; is a draw callback scheduled? + (define (set-draw#!) (set! draw# (random 3)) (set! drawing #f)) + (define draw# 0) + (set-draw#!) + (define-syntax-rule (def/pub-cback (name arg ...) transform) ;; Any ... -> Boolean (define/public (name arg ...) @@ -218,6 +222,13 @@ (with-handlers ([exn? (handler #t)]) (define tag (format "~a callback" 'transform)) (define nw (transform (send world get) arg ...)) + (define (d) (pdraw) (set-draw#!)) + ;; --- + ;; [Listof (Box [d | void])] + (define w '()) + ;; set all to void, then w to null + ;; when a high priority draw is scheduledd + ;; --- (when (package? nw) (broadcast (package-message nw)) (set! nw (package-world nw))) @@ -230,14 +241,24 @@ (when draw (pdraw)) (callback-stop! 'name) (enable-images-button)) - (let ([changed-world? (send world set tag nw)]) - (unless changed-world? - #; - (when draw (pdraw)) - (when (and draw (not drawing)) - (set! drawing #t) - (queue-callback (lambda () (pdraw) (set! drawing #f)) - #f)) ;; low priority, otherwise it's too fast + (let ([changed-world? (send world set tag nw)]) + (unless changed-world? + (when draw + (cond + [(not drawing) + (set! drawing #t) + (let ([b (box d)]) + (set! w (cons b w)) + ;; low priority, otherwise it's too fast + (queue-callback (lambda () (unbox b)) #f))] + [(< draw# 0) + (set-draw#!) + (for-each (lambda (b) (set-box! b void)) w) + (set! w '()) + ;; high!! the scheduled callback didn't fire + (queue-callback (lambda () (d)) #t)] + [else + (set! draw# (- draw# 1))])) (when (pstop) (when last-picture (set! draw last-picture) @@ -259,9 +280,13 @@ (def/pub-cback (prec msg) rec) ;; ---------------------------------------------------------------------- - ;; draw : render this world - (define/private (pdraw) (show (ppdraw))) + ;; -> Void + ;; draw : render the given world or this world (if #f) + (define/private (pdraw) + (show (ppdraw))) + ;; -> Scene + ;; produce the scene for the this state (define/private (ppdraw) (check-scene-result (name-of draw 'your-draw) (draw (send world get)))) diff --git a/collects/2htdp/tests/perform-robby.ss b/collects/2htdp/tests/perform-robby.ss new file mode 100644 index 0000000000..15f9503631 --- /dev/null +++ b/collects/2htdp/tests/perform-robby.ss @@ -0,0 +1,21 @@ +#lang scheme +(require 2htdp/universe 2htdp/image) + +(define (slow) + (let sloop ([n (expt 2 22)]) + (unless (zero? n) + (sloop (- n 1))))) + +(define (update-world w) + (slow) + (- w 1)) + +(define (render w) + (circle 30 'solid (if (odd? w) 'red 'green))) + +(big-bang 10 + (on-tick update-world) + (on-draw render) + (stop-when zero?)) + +(printf "done\n") diff --git a/collects/2htdp/tests/perform-whack.ss b/collects/2htdp/tests/perform-whack.ss new file mode 100644 index 0000000000..07cbda281d --- /dev/null +++ b/collects/2htdp/tests/perform-whack.ss @@ -0,0 +1,1361 @@ +#reader(lib"read.ss""wxme")WXME0108 ## +#| + This file uses the PLT Scheme editor format. + Open this file in DrScheme version 4.2.3.8 or later to read it. + + Most likely, it was created by saving a program in DrScheme, + and it probably contains a program with non-text elements + (such as images or comment boxes). + + http://www.plt-scheme.org +|# + 44 7 #"wxtext\0" +3 1 6 #"wxtab\0" +1 1 8 #"wxmedia\0" +4 1 8 #"wximage\0" +2 0 34 #"(lib \"syntax-browser.ss\" \"mrlib\")\0" +1 0 16 #"drscheme:number\0" +3 0 44 #"(lib \"number-snip.ss\" \"drscheme\" \"private\")\0" +1 0 36 #"(lib \"comment-snip.ss\" \"framework\")\0" +1 0 43 #"(lib \"collapsed-snipclass.ss\" \"framework\")\0" +0 0 19 #"drscheme:sexp-snip\0" +0 0 40 #"(lib \"image-core.ss\" \"2htdp\" \"private\")\0" +1 0 36 #"(lib \"cache-image-snip.ss\" \"mrlib\")\0" +1 0 33 #"(lib \"bullet-snip.ss\" \"browser\")\0" +0 0 29 #"drscheme:bindings-snipclass%\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-browser\")\0" +1 0 45 #"(lib \"image-snipr.ss\" \"slideshow\" \"private\")\0" +1 0 26 #"drscheme:pict-value-snip%\0" +0 0 38 #"(lib \"pict-snipclass.ss\" \"slideshow\")\0" +2 0 55 #"(lib \"vertical-separator-snip.ss\" \"stepper\" \"private\")\0" +1 0 18 #"drscheme:xml-snip\0" +1 0 31 #"(lib \"xml-snipclass.ss\" \"xml\")\0" +1 0 21 #"drscheme:scheme-snip\0" +2 0 34 #"(lib \"scheme-snipclass.ss\" \"xml\")\0" +1 0 10 #"text-box%\0" +1 0 32 #"(lib \"text-snipclass.ss\" \"xml\")\0" +1 0 15 #"test-case-box%\0" +2 0 1 6 #"wxloc\0" + 0 0 93 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" +0 75 23 #"Lucida Sans Typewriter\0" +0 12 90 -1 90 -1 1 -1 0 1 0 1 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 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 -1 -1 2 24 +#"framework:default-color\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 2 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 150 0 150 0 0 0 -1 -1 2 15 +#"text:ports out\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 150 0 150 0 0 0 -1 -1 2 1 +#"\0" +0 -1 1 #"\0" +1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 255 0 0 0 0 0 -1 +-1 2 15 #"text:ports err\0" +0 -1 1 #"\0" +1.0 0 -1 -1 93 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 255 0 0 0 0 0 -1 +-1 2 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 175 0 0 0 -1 -1 2 17 +#"text:ports value\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 175 0 0 0 -1 -1 2 1 +#"\0" +0 -1 1 #"\0" +1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1 +-1 2 27 #"Matching Parenthesis Style\0" +0 -1 1 #"\0" +1.0 0 92 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 1.0 1.0 1.0 34 139 34 0 0 0 -1 +-1 2 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 38 38 128 0 0 0 -1 -1 2 37 +#"framework:syntax-color:scheme:symbol\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 38 38 128 0 0 0 -1 -1 2 38 +#"framework:syntax-color:scheme:keyword\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 38 38 128 0 0 0 -1 -1 2 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 194 116 31 0 0 0 -1 -1 2 +38 #"framework:syntax-color:scheme:comment\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 194 116 31 0 0 0 -1 -1 2 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 41 128 38 0 0 0 -1 -1 2 37 +#"framework:syntax-color:scheme:string\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 41 128 38 0 0 0 -1 -1 2 39 +#"framework:syntax-color:scheme:constant\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 41 128 38 0 0 0 -1 -1 2 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 132 60 36 0 0 0 -1 -1 2 42 +#"framework:syntax-color:scheme:parenthesis\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 132 60 36 0 0 0 -1 -1 2 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 255 0 0 0 0 0 -1 -1 2 36 +#"framework:syntax-color:scheme:error\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 255 0 0 0 0 0 -1 -1 2 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 2 36 +#"framework:syntax-color:scheme:other\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 2 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 81 112 203 0 0 0 -1 -1 2 +38 #"drscheme:check-syntax:lexically-bound\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 81 112 203 0 0 0 -1 -1 2 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 2 28 +#"drscheme:check-syntax:set!d\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 2 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 68 0 203 0 0 0 -1 -1 2 31 +#"drscheme:check-syntax:imported\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 68 0 203 0 0 0 -1 -1 4 1 +#"\0" +0 70 1 #"\0" +1.0 0 -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1 -1 -1 0 0 0 0 1 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 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 20 1 +#"\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0 0 0 0 0 0 255 165 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 1 0 0 0 0 0 0 255 165 0 0 0 0 -1 -1 17 1 +#"\0" +0 -1 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 +20 1 #"\0" +0 -1 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 255 255 255 -1 -1 +0 1 #"\0" +0 75 7 #"Monaco\0" +0.0 14 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 +255 255 1 -1 0 1 #"\0" +0 75 1 #"\0" +0.0 10 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 +255 255 1 -1 0 1 #"\0" +0 75 12 #"Courier New\0" +0.0 10 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 +255 255 1 -1 2 1 #"\0" +0 71 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 1.0 1.0 1.0 1.0 1.0 1.0 0 0 0 0 0 0 +-1 -1 2 1 #"\0" +0 71 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 0 100 0 0 0 +0 -1 -1 2 41 #"profj:syntax-colors:scheme:block-comment\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 194 116 31 0 0 0 -1 -1 2 +35 #"profj:syntax-colors:scheme:keyword\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 2 1 +#"\0" +0 -1 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 139 0 139 0 +0 0 -1 -1 2 37 #"profj:syntax-colors:scheme:prim-type\0" +0 -1 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 139 0 139 0 +0 0 -1 -1 2 38 #"profj:syntax-colors:scheme:identifier\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 38 38 128 0 0 0 -1 -1 2 1 +#"\0" +0 -1 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0 +0 0 -1 -1 2 34 #"profj:syntax-colors:scheme:string\0" +0 -1 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0 +0 0 -1 -1 2 35 #"profj:syntax-colors:scheme:literal\0" +0 -1 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0.0 0.0 0.0 1.0 1.0 1.0 34 139 34 0 +0 0 -1 -1 2 35 #"profj:syntax-colors:scheme:comment\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 194 116 31 0 0 0 -1 -1 2 +33 #"profj:syntax-colors:scheme:error\0" +0 -1 1 #"\0" +1 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0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1 0.0 0.0 0.0 0.0 0.0 0.0 255 165 0 0 +0 0 -1 -1 24 1 #"\0" +0 -1 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 1.0 1.0 1.0 0 0 0 0 0 0 +-1 -1 24 1 #"\0" +0 -1 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 +255 255 -1 -1 0 1 #"\0" +0 75 12 #"Courier New\0" +0.0 12 90 -1 90 -1 3 -1 0 1 0 1 0 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 255 +255 255 1 -1 24 1 #"\0" +0 -1 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 0 1 0.0 0.0 0.0 0.0 0.0 0.0 255 165 0 0 +0 0 -1 -1 0 1 #"\0" +0 75 15 #"Lucida Console\0" +0.0 15 90 -1 90 -1 3 -1 0 1 0 1 0 0 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 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 0 0 0 +-1 -1 20 1 #"\0" +0 -1 1 #"\0" +1.0 0 -1 -1 -1 -1 -1 -1 0 0 0 0 1 0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 0 0 0 0 +-1 -1 0 480 0 4 3 85 +( + #";; The first three lines of this file were inserted by DrScheme. The" + #"y record metadata" +) 0 0 4 29 1 #"\n" +0 0 4 3 85 +( + #";; about the language level of this file in a form that our tools ca" + #"n easily process." +) 0 0 4 29 1 #"\n" +0 0 4 3 183 +( + #"#reader(lib \"htdp-intermediate-reader.ss\" \"lang\")((modname whack" + #"-a-mole) (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 51 3 1 #" " +0 0 14 3 14 #"2htdp/universe" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 14 3 7 #"require" +0 0 51 3 1 #" " +0 0 14 3 10 #"htdp/image" +0 0 22 3 1 #")" +0 0 4 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 14 3 3 #"req" +0 0 14 3 1 #"u" +0 0 14 3 3 #"ire" +0 0 4 3 1 #" " +0 0 14 3 7 #"profile" +0 0 22 3 1 #")" +0 0 4 29 1 #"\n" +0 0 4 29 1 #"\n" +0 0 17 3 1 #";" +0 0 17 3 51 #"; If the following constant is set to 16 or higher," +0 0 4 29 1 #"\n" +0 0 17 3 66 +#";; the window locks up and it appears that the only events getting" +0 0 4 29 1 #"\n" +0 0 17 3 72 +( + #";; through are tick events. At 12, it's sluggish but almost accepta" + #"ble." +) 0 0 4 29 1 #"\n" +0 0 4 29 1 #"\n" +0 0 17 3 6 #";; I c" +0 0 17 3 4 #"an n" +0 0 17 3 3 #"ow " +0 0 17 3 6 #"do 24 " +0 0 17 3 2 #"an" +0 0 17 3 13 #"d it is okay " +0 0 4 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 4 3 1 #" " +0 0 14 3 9 #"num-grass" +0 0 4 3 1 #" " +0 0 20 3 2 #"24" +0 0 22 3 1 #")" +0 0 14 29 1 #"\n" +0 0 51 29 1 #"\n" +0 0 17 3 35 #";; world is a (make-world num posn)" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 13 #"define-struct" +0 0 51 3 1 #" " +0 0 14 3 5 #"world" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 9 #"mole-time" +0 0 51 3 1 #" " +0 0 14 3 8 #"mousepos" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 17 3 74 +( + #";; Interp: time the mole will remain onscreen, and current mouse pos" + #"ition." +) 0 0 51 29 1 #"\n" +0 0 17 3 11 #";; Example:" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 14 3 6 #"world1" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 10 #"make-world" +0 0 51 3 1 #" " +0 0 20 3 4 #"1000" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 9 #"make-posn" +0 0 51 3 1 #" " +0 0 20 3 1 #"0" +0 0 51 3 1 #" " +0 0 20 3 1 #"0" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 29 1 #"\n" +0 0 17 3 17 #";; Mouse handler:" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 12 #"accept-mouse" +0 0 51 3 1 #" " +0 0 14 3 3 #"wrl" +0 0 51 3 1 #" " +0 0 14 3 3 #"m-x" +0 0 51 3 1 #" " +0 0 14 3 3 #"m-y" +0 0 51 3 1 #" " +0 0 14 3 10 #"event-type" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 3 2 #" " +0 0 22 3 1 #"(" +0 0 14 3 10 #"make-world" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 15 #"world-mole-time" +0 0 51 3 1 #" " +0 0 14 3 3 #"wrl" +0 0 22 3 1 #")" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 9 #"make-posn" +0 0 51 3 1 #" " +0 0 14 3 3 #"m-x" +0 0 51 3 1 #" " +0 0 14 3 3 #"m-y" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 29 1 #"\n" +0 0 17 3 16 #";; Tick handler:" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 12 #"update-world" +0 0 51 3 1 #" " +0 0 14 3 3 #"wrl" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 3 2 #" " +0 0 22 3 1 #"(" +0 0 14 3 10 #"make-world" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 4 #"sub1" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 15 #"world-mole-time" +0 0 51 3 1 #" " +0 0 14 3 3 #"wrl" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 14 #"world-mousepos" +0 0 51 3 1 #" " +0 0 14 3 3 #"wrl" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 29 1 #"\n" +0 0 17 3 25 #";;;; Graphical constants:" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 14 3 6 #"hammer" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 6 #"circle" +0 0 51 3 1 #" " +0 0 20 3 1 #"3" +0 0 51 3 1 #" " +0 0 19 3 7 #"\"solid\"" +0 0 51 3 1 #" " +0 0 19 3 8 #"\"yellow\"" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 14 3 9 #"mole-look" +0 0 51 3 1 #" " +0 3 29 51 1 #"\0" +2 -1.0 -1.0 0.0 0.0 0 9 500 +( + #"\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0(\0\0\0(\b" + #"\6\0\0\0\214\376\270m\0\0\17\277IDATx\234U\230k\214]Wy" + #"\206\237\265\326\336\373\334\317\231\273\347\342" + #"xl\217\355\330\236\304\271\30r\241I(4D\242\210\224[TAT\252B\213" + #"\250Z\225V \265\245\250J\372\243\5!ZU\324I\243\240\"~\320?\5\251" + #"R)PZn\201\224\204\220\330\220\200" + #"\215=c\317\214\347\342\271\234\231s?{\357u\353\217}\306\241[Zgk\237" + #"}\373\276o\275\353}\337o\213\207?" + #"3\355\363\371\34*\b\b\303\200\270\0373>1\306\316v\235~?fo\247\201" + #"\aN\335v\2340\214\350t;\24\2539\312\3452?}~\221\365\327:\264\256" + #"[Z\365>\2\b\303\220^7\2452T \356\367\31>\224\343\370\203\243\24\306" + #"<\345J\t\23;\n\305<8(\225K\354\356\356\21\4\1A\240\270\276\264\6" + #"\2\202 \240Z\253P\e\252\22\214O\214r}y\215\332P\215r\271\210\265\226" + #"\265\325\rJ\345\"\"\26\234\274\3558\227/-\222\313G4\232M\232\365\16/" + #"|e\227\e?\325\34\21%\346gG8q|\210[\177c\2040T\b)\20" + #"B\240\265\243\321N\270\270T\347\207_Z\347r\322\340\360\275%&\356\b(U" + #"r\324\206j\320\355\22\205\21A\240X" + #"_\337\344\304\251c\\\372\305\25\216\36" + #";\314\302\345\253\250@!\336\373\314I" + #"\337\355\364(\226\n\264\232mJ\345\"" + #"I\234\"\a/\212\343\204\326^\233\273" + #"\357\277\235\205\237\255s\376\213;\234\316" + #"\225\270w~\234\a\316\316`\275\0)AJ\204T\b\1\2\201\0\20\240\4\24" + #"C\305s?Y\345\271\363k<\277\276\306\331\17MP\233\216p\32" + #"F\307\206YYZ\5\340\370\255s\264\333\35\352;\273T*e\372" +) 500 +( + #"\375\30\361\340\223\243\376\310\334,/\375" + #"\350\2G\216\335\302\322\302*GO\314b\214aj\372\0ZkzI\227\265\363" + #"=^|j\215O\276\357\24s\207\207\361J!T@\30\5\204A\200\n\2\244" + #"\224\203\n\2^\340\275\303{\2175\26)<\241\202kKM\376\354\251\3479\371" + #"\201\n\367\277\373V\256_]\343\300\344" + #"\4\265\241\32\255f\213\265\325\r\206\206" + #"k\\\271t\215b)OP*\227\330\336\252s\372\314\t\232\215\26g\336p\n" + #"\357\34J\5\354l\327Im\302\302\217" + #"\366\330\370j\3023\37\235\247a$\315~J!\37\21\205\1B\tP\203\300\224" + #"D\n\1B\200\367\b$\316:\204\24h\353\350\3655C#!\337\370\364#\274" + #"\357S\337!\312/Q\2365\364z}\326V78q\362\30\336{\272\235\36\0" + #"\371|\169>1\312\310\350\20\306\30F\307\206i7;\224\312ez\275>\371" + #"b\216R\276\306\306\177$\374\371\273\16" + #"\262\\\217I\265\3059\217G\200\a\357" + #"E6\0\234\307y\360\16\262\303A\260d\347=`R\307\302F\213s\177z\17" + #"\313_\355\242|H\30\5\314\35?\302\325\205%\16\3362M.\27q\313\3544" + #"\225j\31\271\267\333 M5\345r\211" + #"\225\2455\246\17N\321l\264\20B\220" + #"\352\204\27\276|\203\273\17\344i%\32" + #"m\f\316\372l\332\234\317^\352<\316" + #";\274\363X\357p\316\341\234\305:\207w.K\306\373\233{\353<\306Z\366z" + #"}\368\\\345\322\327c:\235\16+Kk\24\213\5\244\224\24\212y\272\335\36" + #"\215\275&\262\333\355a\255%I\22\242\\\304\312\322*\245R\221\\!bea" + #"\e.\264\271o\276L\242\301Z\217\321" + #"\26c\34\3269\214v\30\347\261\326\242\215%\325\206TkRc\320" + #"\332\222ZCj,\332z\254u\30\353\320\326b\255\243\333\323\274\365\r" +) 500 +( + #"\243\24\27\f\215\235>;\333u\204\24lo\325\351vz\344r\21\225j\5Y" + #"\e\252b\264\301\30K\24\205\0\\]XBHOc\301RP\202~\352qx" + #"\274\27\244\326`lv\275\266\26\243S\2646\244iJ\232\32\2224%Itv" + #"\234\30\214\326h\2551&\273\307\30\207" + #"\31$\320\350\246\224\2\301\362O\232L" + #"\35\32\247\323\356\322n\265\251\326*Xk\251\rU\220\373T\22\4\1B\b\274" + #"\367L\3372E\263\323d\365E\303o\336Y\315\2t\36\353\a\323j\34\316Z" + #"tjH\22C\22k\3428%\211\23\222~B\322\217\211\343\204$I\210\223\224" + #"d\20\2543\26\234\305XK\2525\255v\314\273\356\31f\373**\276\3657\213\244" + #"\313\26\251 \222`\235\300\252\201\24\b" + #"\301\361\251\34\207F\24u?\311\307>\365Y\36~\370aFje~\360\277\257" + #"\360\261\307\316rx&\217q\257\323\264" + #"\302\260ffy\361\302\2\316\303\362\312" + #"\6\237\371\333\277\346\342\17\376\25\355\24" + #"\257-\367H\255\347\310xH+v\314:Gj,k]I\373\220\344\241OL" + #"\22\312\34\201\f\241\261li/[B\5J\n\20\36/\340@Eqr2b" + #"q\307pi-\346\247\313\236O\376\325" + #"\373y\317\243\357 \b\202\314X,\376" + #"\222\335&\24\3136\363\177\3\2226\332" + #"\260\331\333\30\30C\313\370H\231\371\333" + #"\356\340\231g\277\210\360\226\371C\5\216" + #"O\344(\347\340\271\313=\224PT\2" + #"\301\250\364l.\e\322\255\210\374A\201" + #"\272\353\375SO\374\327\223\v\310\276G" + #"(\201\222\36\205\304\1\371Pr\313\220bz$GD\312;>\360G\374\313\27" + #"\236\341\225W^\341\267\36}\224\335\335" + #"]\356\270m\236\363WV\370\366\367/\20HK/\261,\337\260\264]\221'?" + #"\375O\23486\207\367\236\337\371\340\a9\367\3249\236" + #">w\216\346\316\22g\306\272x!\260\6V\366R\206\21" +) 500 +( + #"D\n\214sx\3\257\276\274\307]\357" + #"\235B<\366\364\355\376\337\376\360UB" + #"\231e\256D&\356\306z\306\252\212339\202P\360\322\245.Wvb\256\\" + #"\3729\233[[\314\315\315\241\323\24\251" + #"\24\265Z\215\37\277\3642\377t\356\363" + #"\364\373}\36y\333#<\376\370\343H" + #"\1q\34\23\4\1\213\213\213\214\217\217" + #"s\346\314\35|\350\367?\214\276\374\25R\27!q\374h\261\307!/(\206\236" + #"V\342\331Ia\261gy\347\337\37'hluo\272\16qS\332\308\223l" + #"\312R\3Q\16>\376\361\217s\361\342k\274\365-oa|l\2148\216\1\250" + #"\357\35403u\200\177\374\334\347\220J" + #"\21\3071\33376\260\3a\316\347\363" + #"\274\360\342\213\374\317\267\277\315\233\37z" + #"3\27_\273\300\221 S\0341@\255\367\36o=\271P\22\31C\4\244=O" + #"\220\352\364\246\t\361b?\310\f\203\355" + #"\304\363\263\265\204z\317\221hx\372\237" + #"\317\361\320\3\17R)\225\330\333\331!" + #"\325\232\233\233\20\344\302\20\244\304h\215" + #"\265\366\346\251~\30R*\24p\326r\356\351g\330\335\335\346RA2R\16\230" + #"\254H\22\233\3315%\5rP\226\20" + #"2\251\213\202\20G6\265\336\201\6\254" + #"\313*\232\364-\326I\246\252\212\231\221" + #"\220^\234\222\313\3479rx\216T\e\2146x\371\227T\253e" + #"\214\326x\262\226\340\2367\274\221n\354\330\\\371;\3569Tfe[\263\276g" + #"\270^\327X\347i\n\230*H\16\25 \n\24\n\203\265\226`\277\n\36\201\20" + #"\231GSY\3659PU\334>\23\1\2\25\bF\313Ez7\236\343O>\372" + #"=\16\35\235gr\346\b\371B\211\335\235\r\226\256]bDmqv\252" + #"\304_|\342w\231>t\232\311\351" + #"\375\363\353\\[\274D\321\336\340\376\243" +) 500 +( + #"U\264\225T\362\212\223S\216^lyy%A%\236\255\3041\21\202\20\22\0" + #"\235\30\2\37\245\3[\225\31\316Pe" + #"\213\305\271\f\224\3328\20\2\207\4\341" + #"(\26\"\336tR\241\365\25\222\353\277" + #"$\1J\271\200\373\216\344\310\205#8" + #"\17\217\334\35\321\351.\321\273q\205\226" + #"\361\24\2\301\331\203!R\16\221\244\16" + #"k\34\306\202\321\216HB(a\266 \310+\205\366\220\30\217\3\306gk\4\23" + #"\2635j3\273\264\326\fb\20\334>h\361\36\357\301\343Qdf\324Z\2171" + #"\236(\f)\26$J\n\204\24x\a\375\304\355\303\2210\f\251\5\341\300a" + #"\24\342\234C\247\232\251\231I._\\" + #"\240T.\21\4\212\332p\25\213a\267" + #"\321\242\265\326\247\32\24\250\277\332F\355" + #"\bt\263\207\213\r\312B(%2\0+\300!\260\241 \254\26h\347z\4\263" + #"\202\3\307&)OE4\353-\362a\236(\n)\24\362\364\3731\355V\a\245" + #"\24\205B\236\\>\207\265\226\235\355]\202B!\217\20\240\265A\bA\230\vY" + #"\274|\rc\262\317_\333[u\256/\257\243\224\342\320" + #"\321\31\222ZB\"\22\336\370\221yv\367\366\20J\320" +) 88 +( + #"h\264\251\324\31247\273\324/\246\fM\226\tg\22\306F\206I\23\315\336N" + #"\203\221\241!t\242\t\\\310Hm\230N\273K}{\227(\27\321\330m11" + #"9\306\330\370\bB\b\366v\et:]j\265\n\377\a\236" + #"\235\2\375mi\4d\0\0\0\0IEND\256B`\202" +) 0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 14 3 10 #"grass-look" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 11 #"put-pinhole" +0 0 51 3 1 #" " +0 3 31 51 1 #"\0" +2 -1.0 -1.0 0.0 0.0 0 10 500 +( + #"\211PNG\r\n\32\n\0\0\0\rIHDR\0\0\0(\0\0\0(\b" + #"\6\0\0\0\214\376\270m\0\0\21\300IDATx\234=\230\331\217\34\211}" + #"\337?uwU\365Q}\367\364\334\34rx\314\236\334\325J{Jk\371H," + #"\310\27\344+p`\310F\202 ~\260_\374\224\27\"\17\371\a\364\22\4\360S" + #"\20\344\200a#\216rm$mV\226\245\365.\315].\271\344\222\\\222\303a" + #"OO\367\364U\335]\367\351\207\36\261" + #"^\v\5\374\352\367\373\376\276\307O\370" + #"\265\357\355\345A\20bU\313H\222D\30F\354\356m\263\230/\231Nf\314\355" + #"\5\213\371\222f\253N\24\305\244iJ" + #"\357\311\200\257\275u\225\351d\206a\352" + #"\210\242\210a\32\364{\3fS\233f" + #"\253\316\243/\217\250\325+\344y\316\245" + #"\203}~\376|\374\263O8\351E\374\342\257>O\251\\\342t8\"K3\232" + #"\355\6\207\217\216\330\273\260K\340\a\334" + #"\377\342!\242( \354\375\v\362?\370" + #"\356o\362?\377\373{\24\313&\212\242" + #"\260\261\331EVd\306\243\t\313\205C\24\305$qL\275Q\243Z\263(\226\212" + #"<\270\367\220\311h\306\305+{,\27\16s{\301\333\337x\235\321h\202\263t" + #"\330;\277K\24\307Da\304r\351\0" + #"\220&)\212\252\260\276\336A\224$\376" + #"\313\177\374k\252\2652f\321$\bB\352\215*\273{\333<\372\362\220$N\30" + #"\217\246\b\177\3627\357\344\337\377\353\37" + #"\363\366\273/\361\364\250O\241\240\261\273" + #"\267\r\300pp\312\334^\260\276\261\306\243/\17\251XeN\ac\362<\307Y" + #"\372\374\301\37}\207\277\372\257\337\247\331" + #"\256s\360\374%>\370\341Oy\375\355WI\222\224\345bI\226et7\326\230" + #"\333\213g\0354M\203;\267\357\221\246){\27v" + #"i\267\233\304IB\222$\234\34\17x\357\373\267\250" +) 500 +( + #"T\341\215w^b\271t\220\322\215\321\265\244\273\321\341\306Gw\350n4X\314\35\332kM&\243)\255N" + #"\203\a_<\341\352k\a$IJ\30\204\224+%\332\235\26\213\305\222R\251\310" + #"t2C+h\24\n\32\256\353\361\360\301!\262,q~\377\34O\36?\245T" + #".\"\374\356_\34\344\0\222$\241\252*wn\337C\24ETU\341\360\341\230" + #"\257\377\342\313\344yN\30F\344y\316" + #"\361\323\23\236\177\351\n\267>\275\303\301" + #"\v\227\350\35\365\21\4\201\331\324f\357" + #"\302\16\247\3031\233\333\353|\364\323O" + #"0\314\2\257\275~\225<\317\31\16F\b\202@\253\335\340t8F\222D6\267" + #"7\270}\363.\222$\3428.\233[\3534\333\r\36|\361\220\345\322a" + #":\266\221^\374\255\265k\0\236\3473\36M(\227\213\244iJ\232\246H" +) 500 +( + #"RN\263]'I\22\26s\aEU\310\262\fY\226\310s\230Mm\4A@" + #"Qd\n\5\rQ\24I\342\204R\271H\222$(\212L\265f1\31OI\323" + #"\fE\221I\223\24Q\24\250\326\252\330" + #"S\233\351tF\273\323\"\216\343g\243" + #"\236\333\v\3428\241\331\252!\aA\310ljcU+\b\202@\30Fg\30\263" + #"\260gKfS\233b\311$\317s\306\243)\353\e\35\354\331\34Y\226\360<\37" + #"\303\320)\225\213\344y\316b\276D\222" + #"Dt\275\200\246\251X\325\nQ\0301\36MQ\24\5\331*\341\272\36\205\202F" + #"\222$\4A\300tl\223\304\t\202(\3428\36q\24S*\27)W\212\24\n" + #"\5\304~o\200i\32\230\246\1\300\311\361)q\24\243\0254\332k\r\246\23\e" + #"\3234\2517\252\224\313E\3020\242T" + #".\342\373\1\335\3656Y\226a\317\346" + #"\317 0\267\27\364\236\366I\222\224\376\361\200\311xJ\275Q#\216cDQ$" + #"MSDQ\344\356\31\224:\335\26\313" + #"\271\213\242\310\344Yv\366^\240\273\276" + #"\306d\217\353x\230Ec" + #"\5\223$\5\300\266\27\210{\373\333<\270\367\20EUh\257Y\350z\1\263\250" + #"\3\20G1\273{\333\4~\300\334^\240\353\5TMe:\2661\213\6I\222" + #"\220\245\31\345r\211\243\307=\6\375S" + #"t\275@\22\307\364\216\372di\6@\236eH\222\304\351`D\251\\\"\317s" + #"\254j\5\253Z\301\367|\3020D\226%d" + #"E\306uW\205\16\a#\312\225\22r\261h\"" +) 500 +( + #"\3132\242(0\35\317Q\324>W\236\273D\236\3474Zu\6'C\256~\345" + #"E\362<\307\236\331\314\355%\202.\20" + #"\3071a\20Q\337\2501\34\2140\212\3063*\t\303\350\31\320\223$\241\323m" + #"3\350\17\2517j(\212B\256\347\374" + #"\335\a\37\321\335h\223\246\253\t\344y" + #"\216(\212\310\262\214\357\ah\5\25I\22\21\3030BQd\236<\356a\26u" + #"\366.\354\"\b\260wa\27{6'\3132\36>x\314\341\243#\356\337}\264" + #"\332\364J\t\263hR\3205\312\225\22" + #"\316\322\347\345W^\0\340\351\223c\302" + #" DU\25\254j\205F\263\316\326\366" + #"\6\252\246R\253W\271\373\371}\346\366" + #"\202r\245\310r\341\20G1\213\371\22" + #"\317\363\211\302\210$I\20E\221F\263" + #"\316b\356 \275\362;\e\327\216{'" + #"\234\236L\371\205_y\eY\226\370\374" + #"\326=\266\266\327\211\242\bY\226Y." + #"\34\362\177\373\376\207\274\362\332\213\244" + #"i\212=\233\243i*\235n\233,\315\30\16F\330\2639[\333\eHW\177{" + #"\343Z\22'\324\352\25\202 @\24$*V\t{6\247\337\e\342:\36V\255" + #"L\265Za6\265\251\326,\232\255:A\20\221g9" + #"FQg<\232\341.\3\2420FQd\3428>\303" +) 500 +( + #"hH\226e|\363\227\277\316\347\267\357\21G1\256\3432\36M\251\325-\6'" + #"\247t7\326\330\336\331d2\231\221&)Y\226R,\232x\236\217 \bH\372" + #"e\367Z\265^ec\263K\232d\fNN\231Nl$I\244\325i\0\2k" + #"\335\26\206\251\363\340\336!V\265\314t" + #"b\223\347\31\212\252\322l\325\361=\237" + #"R\331\240\325ip:\230P\261\212T*e\234\245\313\302^\"\313\22\256\353Q" + #"*\27Y.]\262,\5\4\6\375\21\252\246\340:.\366l\301\340xH\226\347" + #"DQDvFk\322\333\337\335\277vr< \a\32\315:\375\336\200\212Ub" + #"\377\342\371\225S6\f \243P\320\310" + #"\363\214(\212\317\n\314\231N\246|y" + #"\357\204\356F\203\235s[\310\262D\305*\242j\5*V\tA\20h\2575\371" + #"\364\372\347\354]\330\346\352\253/\362\350" + #"\313C|/@\325T\366/\355q\373\323{\244YJ\305*\23\3071\25\253L" + #"\24\306\b\202@\232fH\277\372\247\257" + #"\\\e\234\f\321\n\32\276\347\23E!\223\361\24UU9:\216\343\242\252\n99\335" + #"\215\3163\v\267R#\210\343\210V\273" + #"\311\370tL\24\256\322\336I\177\205}" + #"\327\361\230\214&V\265\202a" + #"\26\210\302\30I\226Y\314\27\30\246\376,\367\26K&A\20P*\2278\177q" + #"\e\327\361V?\266\\\222\304)\216\343 \212\"q\24#I\22\363\371\2028\212" + #"9|\370t\25i\v\332\252\243\206N\271RB\214\242\b\255P\300u\\\6\375" + #"\341\231L%\4~\300\341\243\36/\274" + #"|\200\353\270\b\2\214\6\23\306\247S\\\307CQUL\263H\226\201,KH" + #"\222H\236\347\370~\300t2g6\265i\265\233dY\202\347.\317\212.\"I" + #"\3423\31\213\242\230O\256\177F\20\204" + #"\354_\336c\347\334\26a\20\262\261\331" + #"\245V\257b\317\346\210V\265\2\b\b\202@\263\335\340\341\375CTU\3010u" + #"4MA7\n\204aJ\20Dl\355\256\343,\35$I\3044\rdEB\24" + #"A\20\4\26\366\2224\315\20E\201Ri\25\274N\372\247t7:Tk\26\0" + #"Y\226\261sn\v\317]\25\370\364\3111fq\225wdY\302uV\316HV" + #"d\216\236\34\263sn\vq:\261\211" + #"\302\210b\251\210a\350T\353\26\312\231\2273K&?\370\337?\301Y:\314&" + #"sJ\345\"\316\322'I\4\3224\341\370\250\377\314p\252\232\302d4\303u<" + #"\252\265\n\255v\203\223\343\23|/8" + #"\343Xp\35\27\327q\331\335\333\"\3132\352\215*Vue\333\312\2252Q\264" + #"Jv\223\361\224$\216\261\252\25\244\363" + #"\277\\\2716\31O\261\2542\276\347\3" + #"\2\363\331\234(\212\361\275\200\347_\276" + #"H\30\206\344\371\312\26Uke\2420" + #"\3050Uj\315\32\316\302\241\337\263\331\277\274K\30\370\244\311j\271" + #"\nz\201\354L\273\2535\2138N(\226L\346\366\342Yp2L}" +) 500 +( + #"\345\320\1A\340\314t\24\31\217\246\264" + #":M\246\223\31\322\273\377\362\312\265O>~\314ra3\235\314Y.\34Z\235" + #"\6\343\341\214bI\347\235w\337\244\337" + #"?\241\331j\220$)y\16\215\246\205\357\207DaD\243YG\24S\16\37\36" + #"\263\267\277\213a\32<\376\362\210f\273" + #"\201n\350\370\276\217(\211t\326Z\b" + #"\202\2602\265\256\217\357\373,\27\16a" + #"\30b\230\6w>\273\217\357\373\254o" + #"\254\201\300*\346\236N\220eY\346\265" + #"7\366W\256Y\0Q\20\250\326,\352\325*3\333\246\331j\340\314W\324\" " + #"\340-=Z\235&\375\336\20\323\324y\370\340\220w\336\375*\267n\336%\n#" + #"t\323$\216s\352\215\32\236\353Q*" + #"\231\314\347\v\2420\242\177|\202\263\364" + #"\2507\253$I\212\347z\254u\333\210\222H\331*R\255Y\224\312ETM%" + #"I\22\342(F\354\35\35\23\305\21[\233\353\324\353\26\265Z\205,KQt\225" + #"\235\363;\374\267\377\364W\34\37\215\221D\21I\2218wq\233\303\307=^}" + #"\375\25n\177:F\310\341\307?\372\220" + #"\265\365\16\222,\361\371\315;\\:\330" + #"\345\311\343\36K\307\341\302\245\363<~" + #"\360\4E\225\361\275\220\235\275M$IF\222D\316\357\357>\313\"\27.\356b" + #"U\313Dq\314\255O>\307s=\2224Cx\347\3376r\243d\220\2041\265" + #"F\225<\313\311\362\224\34\221\305\334A" + #"\327\24\256<\177\211\243\307G$B\216" + #"c;\274\365\2157\370\331O\256\263\277" + #"\277\215$)|\360\376\207\324\233\26\222(\"\b9\5\275H\340\373\224kEN" + #"\216N\330\334Z\347\301\375\207\204AB" + #"\255Q\"\2122\302(\342\312\301>7\376\376\26\2)\227_\270H\226\345\204Q" + #"D\32\245\244Y\212Y1\221\256|\273yM\24\5" + #"Dqu\257\23%\tA\20\211\302\20\337\367h\265\233" +) 500 +( + #"\374\315_\376\204\335\v\35\226s\227f" + #"\253\311\17\376\317\a\253[\n\2\255v" + #"\235\223\223\1\205B\2014IY\333\350\262\260m\f\263\300h8er:\341\270" + #"\177\312\271\363;\224*E*V\5M\323\330\332^\247\323ia\224\f\266v\267" + #"\b\202\220(\212)\26M\262\354\354$\374\345S\304V\273A\253\325\244T61" + #"\f\235<\317\t\374\0Y\225\271\362\374" + #"%\0\276\361K/\362?\376\362\26\25" + #"\253J\251\\\342;\277\377\233|\375\233" + #"_\343\335o\276\311\372F\227(\214\30" + #"\235\216\320\215\2?\376\341O\321\r\235" + #",\3M\321X:\21/]\275\202\246\251<\367\374e\262,\343\312\301EF\303" + #"1\377\341{\337G\222%>\372\351\rN\207cdY\342\343\237}J\226e|" + #"z\375\26\313\205\273\32\261\252\251\24\n" + #"\32G\207\307t7:\317\244k6\265" + #"\31\236\214\371\326o\374\22\213\371\202~" + #"\357\4\317\v\351\256wx\375\3157\370" + #"\367\337\373\v\262,\345\317\377\315\237\361" + #"\303\367~\300x8\306q=\20\4\302" + #" D\3234\276\365\353\377\224\217\377\376" + #"\343\325\267n\300\332z\233\e\37=\341\327\177\373\r<\327c1_\322;\32\0" + #"9\305\262I\275Yess\235(Z\5/\351\233\377\352\271k\272^\240l\225" + #"\271|\260\217\357\373\334\374\207{\354]" + #"\330\242X2\251\325-\306\243\t\225J" + #"\205\2337\356\360\235\337\3735\3428\346" + #"\375\37\274\317\306\326\32\325Z\231\367\377" + #"\337\377\307q\274g\324\22E\21\317\275" + #"x\205A\177\200 \346\334\275\365\200\177" + #"\376\307\277\307\366N\27\253f\321\356\224" + #"\370\374\326\27\234;\277\303\315\ew\370" + #"\327\177\372G\224\255\"\212,3\267\227" + #"\347\316o\321l7\270{\373>\27.\236\343t8\346\37" + #"\1\177\211o\367\4 \2,\0\0\0\0IEND\256B`\202" +) 0 0 51 3 1 #" " +0 0 20 3 1 #"0" +0 0 51 3 1 #" " +0 0 20 3 1 #"0" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 14 3 7 #"sc-size" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 1 #"*" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 11 #"image-width" +0 0 51 3 1 #" " +0 0 14 3 10 #"grass-look" +0 0 22 3 1 #")" +0 0 51 3 1 #" " +0 0 14 3 9 #"num-grass" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 29 1 #"\n" +0 0 17 3 42 #";; Functions for building the grass field:" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 6 #"mt-row" +0 0 51 3 1 #" " +0 0 14 3 8 #"num-left" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 3 2 #" " +0 0 22 3 1 #"(" +0 0 14 3 2 #"if" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 2 #"<=" +0 0 51 3 1 #" " +0 0 14 3 8 #"num-left" +0 0 51 3 1 #" " +0 0 20 3 1 #"1" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 3 6 #" " +0 0 14 3 10 #"grass-look" +0 0 51 29 1 #"\n" +0 0 51 3 6 #" " +0 0 22 3 1 #"(" +0 0 14 3 10 #"overlay/xy" +0 0 51 3 1 #" " +0 0 14 3 10 #"grass-look" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 11 #"image-width" +0 0 51 3 1 #" " +0 0 14 3 10 #"grass-look" +0 0 22 3 1 #")" +0 0 51 3 1 #" " +0 0 20 3 1 #"0" +0 0 51 29 1 #"\n" +0 0 51 3 18 #" " +0 0 22 3 1 #"(" +0 0 14 3 6 #"mt-row" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 4 #"sub1" +0 0 51 3 1 #" " +0 0 14 3 8 #"num-left" +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 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 7 #"make-mt" +0 0 51 3 1 #" " +0 0 14 3 8 #"num-left" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 3 2 #" " +0 0 22 3 1 #"(" +0 0 14 3 2 #"if" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 2 #"<=" +0 0 51 3 1 #" " +0 0 14 3 8 #"num-left" +0 0 51 3 1 #" " +0 0 20 3 1 #"1" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 3 6 #" " +0 0 22 3 1 #"(" +0 0 14 3 6 #"mt-row" +0 0 51 3 1 #" " +0 0 14 3 9 #"num-grass" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 3 6 #" " +0 0 22 3 1 #"(" +0 0 14 3 10 #"overlay/xy" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 6 #"mt-row" +0 0 51 3 1 #" " +0 0 14 3 9 #"num-grass" +0 0 22 3 1 #")" +0 0 51 3 1 #" " +0 0 20 3 1 #"0" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 12 #"image-height" +0 0 51 3 1 #" " +0 0 14 3 10 #"grass-look" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 3 18 #" " +0 0 22 3 1 #"(" +0 0 14 3 7 #"make-mt" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 4 #"sub1" +0 0 51 3 1 #" " +0 0 14 3 8 #"num-left" +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 51 29 1 #"\n" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 14 3 9 #"simple-mt" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 12 #"nw:rectangle" +0 0 51 3 1 #" " +0 0 14 3 7 #"sc-size" +0 0 51 3 1 #" " +0 0 14 3 7 #"sc-size" +0 0 51 3 1 #" " +0 0 19 3 7 #"\"solid\"" +0 0 51 3 1 #" " +0 0 19 3 7 #"\"brown\"" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 14 3 2 #"mt" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 11 #"place-image" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 7 #"make-mt" +0 0 51 3 1 #" " +0 0 14 3 9 #"num-grass" +0 0 22 3 1 #")" +0 0 51 3 1 #" " +0 0 20 3 1 #"0" +0 0 51 3 1 #" " +0 0 20 3 1 #"0" +0 0 51 3 1 #" " +0 0 14 3 9 #"simple-mt" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 29 1 #"\n" +0 0 17 3 16 #";; Draw handler:" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 6 #"render" +0 0 51 3 1 #" " +0 0 14 3 3 #"wrl" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 3 2 #" " +0 0 22 3 1 #"(" +0 0 14 3 11 #"place-image" +0 0 51 3 1 #" " +0 0 14 3 6 #"hammer" +0 0 51 29 1 #"\n" +0 0 51 3 15 #" " +0 0 22 3 1 #"(" +0 0 14 3 6 #"posn-x" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 14 #"world-mousepos" +0 0 51 3 1 #" " +0 0 14 3 3 #"wrl" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 3 15 #" " +0 0 22 3 1 #"(" +0 0 14 3 6 #"posn-y" +0 0 51 3 1 #" " +0 0 22 3 1 #"(" +0 0 14 3 14 #"world-mousepos" +0 0 51 3 1 #" " +0 0 14 3 3 #"wrl" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 3 15 #" " +0 0 22 3 1 #"(" +0 0 14 3 11 #"place-image" +0 0 51 3 1 #" " +0 0 14 3 9 #"mole-look" +0 0 51 3 1 #" " +0 0 20 3 2 #"50" +0 0 51 3 1 #" " +0 0 20 3 2 #"50" +0 0 51 3 1 #" " +0 0 14 3 2 #"mt" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 51 29 1 #"\n" +0 0 22 3 1 #"(" +0 0 15 3 6 #"define" +0 0 51 3 1 #" " +0 0 14 3 11 #"final-state" +0 0 4 29 1 #"\n" +0 0 4 3 2 #" " +0 0 22 3 1 #"(" +0 0 14 3 5 #"profi" +0 0 14 3 2 #"le" +0 0 51 29 1 #"\n" +0 0 4 3 3 #" " +0 0 22 3 1 #"(" +0 0 14 3 8 #"big-bang" +0 0 51 3 1 #" " +0 0 14 3 6 #"world1" +0 0 51 29 1 #"\n" +0 0 4 3 13 #" " +0 0 22 3 1 #"(" +0 0 14 3 7 #"on-tick" +0 0 51 3 1 #" " +0 0 14 3 12 #"update-world" +0 0 22 3 1 #")" +0 0 51 29 1 #"\n" +0 0 4 3 13 #" " +0 0 22 3 1 #"(" +0 0 14 3 8 #"on-mouse" +0 0 51 3 1 #" " +0 0 14 3 12 #"accept-mouse" +0 0 22 3 1 #")" +0 0 4 29 1 #"\n" +0 0 4 3 13 #" " +0 0 22 3 1 #"(" +0 0 14 3 5 #"state" +0 0 4 3 1 #" " +0 0 14 3 4 #"true" +0 0 22 3 1 #")" +0 0 4 29 1 #"\n" +0 0 4 3 13 #" " +0 0 22 3 1 #"(" +0 0 14 3 7 #"on-draw" +0 0 51 3 1 #" " +0 0 14 3 6 #"render" +0 0 22 3 2 #"))" +0 0 22 3 2 #"))" +0 0 51 29 1 #"\n" +0 0 diff --git a/collects/2htdp/tests/profile-robby.ss b/collects/2htdp/tests/profile-robby.ss new file mode 100644 index 0000000000..306e633b49 --- /dev/null +++ b/collects/2htdp/tests/profile-robby.ss @@ -0,0 +1,14 @@ +#lang scheme/gui +(require profile) +(profile-thunk + (λ () + (parameterize ([current-eventspace (make-eventspace)]) + (let ([s (make-semaphore 0)]) + (queue-callback + (λ () + (dynamic-require "perform-robby.ss" #f) + (semaphore-post s))) + (semaphore-wait s)))) + #:threads #t) + +