[plt-scheme] thanks, but help again

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Wed Mar 24 20:40:48 EST 2004

P.S. Congratulations to your exhibit!!!


On Mar 24, 2004, at 8:39 PM, Connor Ferguson wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Hey everybody-
>
> Thanks especially to Matthias and Bruce and mathematica for your help. 
> My
> science project of the UFO game (from HTDP) has been chosen to compete 
> in
> the Los Angeles County Science Fair on April 13.
>
> While I’m very happy about this, I am still having some problems. 
> Whenever I
> successfully modify hit-shot? to register the UFO as hit when it passes
> through, it also classifies as hit when the shot has already passed and
> missed and the UFO moves back to the line that the shot traveled. 
> Below is
> my function for hit-shot? If anyone could take a look at it and please 
> tell
> me where I may be going wrong, that would be great.
>
> ;; hit-shot? : shot/f ufo -> boolean
> (define (hit-shot? shot/f ufo)
>  (cond
>    [ (boolean? shot/f) false]
>    [ else
>     (cond
>       [ (and (>= (+ (posn-x (ufo-nw ufo)) 22)
>                 (posn-x (shot-posn shot/f)))
>             (<= (posn-x (ufo-nw ufo))
>                 (+ (posn-x (shot-posn shot/f)) 2))
>             (>= (posn-y (ufo-nw ufo))
>                 (posn-y (shot-posn shot/f)))
>             (>= (posn-y (ufo-nw ufo))
>                 (+ (posn-y (shot-posn shot/f)) 5))) true]
>       [ else false])]))
>
> Thanks again
> -Connor
>



Posted on the users mailing list.