diff --git a/collects/frtime/demos/pong.ss b/collects/frtime/demos/pong.ss index 073b10f09e..a90f9e3a53 100644 --- a/collects/frtime/demos/pong.ss +++ b/collects/frtime/demos/pong.ss @@ -22,7 +22,7 @@ (define-values (paddle1-pos ball-pos ball-vel) (letrec ([paddle1-pos (make-posn - (clip (+ 100 + (clip (+ 150 (integral (hold (merge-e (key-strokes @@ -40,7 +40,7 @@ ((when-e (<= (posn-x paddle1-pos) 30)) . -=> . 0)) 0))) 30 170) - (clip (+ 100 + (clip (+ 150 (integral (hold (merge-e (key-strokes @@ -106,6 +106,6 @@ (make-circle paddle2-pos paddle-radius "black") (make-graph-string (make-posn 30 30) (number->string p2-score) "black") (make-graph-string (make-posn 350 30) (number->string p1-score) "black") - (make-graph-string (make-posn 120 30) (number->string (posn-len ball-vel)) "black") + ;(make-graph-string (make-posn 120 30) (number->string (posn-len ball-vel)) "black") (make-line (make-posn 0 150) (make-posn 0 250) "red") (make-line (make-posn 399 150) (make-posn 399 250) "red"))) diff --git a/collects/frtime/demos/push-pull-ball.ss b/collects/frtime/demos/push-pull-ball.ss index b51bbaf950..aa6e64215d 100644 --- a/collects/frtime/demos/push-pull-ball.ss +++ b/collects/frtime/demos/push-pull-ball.ss @@ -1,35 +1,33 @@ -(module push-pull-ball (lib "frtime.ss" "frtime") - - (require (lib "etc.ss" "frtime") - (lib "animation.ss" "frtime")) - - (define radius (new-cell 20)) - - (define pos1 - (rec pos - (until (make-posn 200 200) - (delay-by - (let ([brnch (posn+ pos - (posn* (normalize (posn- mouse-pos pos)) - (- (posn-diff pos mouse-pos) (sub1 radius))))]) - (if (> (posn-diff pos mouse-pos) radius) - brnch - pos)) - 0)))) +(require (lib "etc.ss" "frtime") + (lib "animation.ss" "frtime")) - (define pos2 - (rec pos - (until (make-posn 100 100) - (delay-by - (let ([brnch (posn+ pos - (posn* (normalize (posn- pos1 pos)) - (- (posn-diff pos pos1) (add1 (* 2 radius)))))]) - (if (< (posn-diff pos pos1) (* 2 radius)) - brnch - pos)) - 0)))) +(define radius (new-cell 20)) - (display-shapes - (list - (make-circle pos1 radius "blue") - (make-circle pos2 radius "blue")))) +(define pos1 + (rec pos + (until (make-posn 200 200) + (delay-by + (let ([brnch (posn+ pos + (posn* (normalize (posn- mouse-pos pos)) + (- (posn-diff pos mouse-pos) (sub1 radius))))]) + (if (> (posn-diff pos mouse-pos) radius) + brnch + pos)) + 0)))) + +(define pos2 + (rec pos + (until (make-posn 100 100) + (delay-by + (let ([brnch (posn+ pos + (posn* (normalize (posn- pos1 pos)) + (- (posn-diff pos pos1) (add1 (* 2 radius)))))]) + (if (< (posn-diff pos pos1) (* 2 radius)) + brnch + pos)) + 0)))) + +(display-shapes + (list + (make-circle pos1 radius "blue") + (make-circle pos2 radius "blue"))) diff --git a/collects/mztake/debug-tool.ss b/collects/mztake/debug-tool.ss index 68f4548411..f5f8a901e3 100644 --- a/collects/mztake/debug-tool.ss +++ b/collects/mztake/debug-tool.ss @@ -496,7 +496,9 @@ breakpoints (lambda (pos status) ; possible efficiency problem for large files with many breakpoints - (when (and (>= pos 0) (not (memq pos break-posns))) + (when (and (>= pos (syntax-position top-e)) + (< pos (+ (syntax-position top-e) (syntax-span top-e))) + (not (memq pos break-posns))) (hash-table-remove! breakpoints pos)))) (for-each (lambda (posn) (hash-table-put!