[plt-scheme] HTDP Extended Exercise: Interactive Games

From: mathematica (mathematica at citiz.net)
Date: Mon Mar 8 21:52:43 EST 2004

Please don't mind that I reply.

;; SHOT is a Posn
;; SHOT/f is SHOT of false, false indicate that now there is no shot

draw-scene only draw the AUP, UFO and SHOT. It is clear-scene which clear AUP, UFO and SHOT


--  mathematica

>
>Matthias-
>
>Sorry to take so long to get back to you. If draw-scene draws the AUP and
>UFO and draws and clears the shot, what would clear-scene do? Would it need
>to do anything with the shot, since draw-scene has already cleared it from
>the canvas?
>
>-Connor
>
>on 3/7/04 10:19 AM, Matthias Felleisen at matthias at ccs.neu.edu wrote:
>
>> 
>> 
>> On Mar 6, 2004, at 6:55 PM, Connor Ferguson wrote:
>> 
>>> For list-related administrative tasks:
>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>> 
>>> I am working on the extended exercise for HTDP: Interactive Games
>>> (http://www.ccs.neu.edu/home/matthias/HtDP/Extended/igames.html). In
>>> Exercise 2.4.5, it says to modify draw-scene and clear-scene to also
>>> consume
>>> a Shot/f. What do they do with this shot (draw it, move it?)?
>> 
>> What did draw-scene and clear-scene do before? According to 2.3.2 (the
>> pointer in 2.4.5),
>> 
>>> Design the function draw-scene. It consumes an AUP and a UFO and draws
>>> them on the canvas.
>>> Also design clear-scene, which consumes a AUP and a UFO and clears
>>> them from the canvas.
>> 
>> So I'd say that draw-scene now draws and clears the shot, if it has
>> been fired.
>> 
>> Hint: If the shot/f argument is false, no shot has been fired. Later
>> you will see that it is -- as often -- easier to deal with the
>> generalization of the problem, when you draw an entire list of shots
>> per scene. Then, when no shot has been fired, you just get empty.
>> 
>> -- Matthias
>> 




Posted on the users mailing list.