[plt-scheme] HTDP Extended Exercise: Interactive Games

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sun Mar 7 13:19:57 EST 2004

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.