Re: [racket] ufo structure problem

2012-04-02 Thread Stephen Bloch
On Apr 2, 2012, at 7:29 AM, Roelof Wobben wrote: > I like the way you do these things. > but what did you mean with "p-x" ? p-x doesn't exist, but it's a mistake my students often make: (define p (make-posn 3 5)) ... p-x ; they expect 3, but get an error message instead. > Following your way o

Re: [racket] ufo structure problem

2012-04-02 Thread Roelof Wobben
Op 2-4-2012 13:02, Stephen Bloch schreef: On Apr 2, 2012, at 3:25 AM, Pierpaolo Bernardi quoted: I thought that the position of the ufo can be find at (posn-y p) and (posn-x) because the postition is a struct of Posn. and replied: You must pay more attention to small details. What is the p i

Re: [racket] ufo structure problem

2012-04-02 Thread Stephen Bloch
On Apr 2, 2012, at 3:25 AM, Pierpaolo Bernardi quoted: >> I thought that the position of the ufo can be find at (posn-y p) and >> (posn-x) because the postition is a struct of Posn. and replied: > You must pay more attention to small details. What is the p in (posn-y > p)? Isn't an argument mi

Re: [racket] ufo structure problem

2012-04-02 Thread Pierpaolo Bernardi
On Fri, Mar 30, 2012 at 16:56, Roelof Wobben wrote: > Op 30-3-2012 12:17, Pierpaolo Bernardi schreef: > >> On Fri, Mar 30, 2012 at 11:53, Roelof Wobben  wrote: >>> >>> Op 30-3-2012 9:46, Pierpaolo Bernardi schreef: >>> Hello Roelof, On Fri, Mar 30, 2012 at 09:32, Roelof Wobben    wr

Re: [racket] ufo structure problem

2012-03-30 Thread Roelof Wobben
Op 30-3-2012 12:17, Pierpaolo Bernardi schreef: On Fri, Mar 30, 2012 at 11:53, Roelof Wobben wrote: Op 30-3-2012 9:46, Pierpaolo Bernardi schreef: Hello Roelof, On Fri, Mar 30, 2012 at 09:32, Roelof Wobbenwrote: (define (show-ufo ufo) (place-image BLU (ufo-loc u) MTS)) But still I c

Re: [racket] ufo structure problem

2012-03-30 Thread Roelof Wobben
Op 30-3-2012 9:46, Pierpaolo Bernardi schreef: Hello Roelof, On Fri, Mar 30, 2012 at 09:32, Roelof Wobben wrote: (define (show-ufo ufo) (place-image BLU (ufo-loc u) MTS)) But still I can't get the show-ufo work. Check carefully the name of your variables! Doesn't DrRacket give you an exp

Re: [racket] ufo structure problem

2012-03-30 Thread Pierpaolo Bernardi
Hello Roelof, On Fri, Mar 30, 2012 at 09:32, Roelof Wobben wrote: > (define (show-ufo ufo) >  (place-image BLU (ufo-loc u) MTS)) > > But still I can't get the show-ufo work. Check carefully the name of your variables! Doesn't DrRacket give you an explicative error message in this case? P. __

Re: [racket] ufo structure problem

2012-03-30 Thread Roelof Wobben
Sorry, I forget to give you the chapter and the book. Im talking about this chapter 2.5.2Programming with Structures Which can be found at this url: http://www.ccs.neu.edu/home/matthias/HtDP2e/htdp2e-part1.html#%28part._structure%29 Roelof Op 30-3-2012 9:32, Roelof

[racket] ufo structure problem

2012-03-30 Thread Roelof Wobben
Hello, I try to make the ufo exercise work on this chapter : So I have this : ; visual constants (define MTS (empty-scene 100 100)) (define BLU (place-image (rectangle 25 25 "solid" "blue") 50 50 MTS)) (define-struct velocity (dx dy)) ; A Velocity is a structure: (make-vel Number Number) ; int