[plt-scheme] HTDP Extended Exercise: Interactive Games

From: Connor Ferguson (psfreak at linkline.com)
Date: Tue Mar 9 21:39:28 EST 2004

Matthias and mathematica,

Thank you both for your advice. I am having problems with getting the AUP to
fire one shot. Attached is my code. If you could look at it when you get a
chance and give me some pointers. When I execute the new version of the game
that should allow the UFO to fire one shot, it just acts like the one where
you just catch it. Whenever I press the up arrow it does nothing.

Please help,
-Connor


on 3/8/04 7:09 PM, Matthias Felleisen at matthias at ccs.neu.edu wrote:

> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> 
> On Mar 8, 2004, at 9:52 PM, mathematica wrote:
> 
>> For list-related administrative tasks:
>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>> 
>> Please don't mind that I reply.
> 
> Never. I love it when "students" help each other.
> 
>> 
>> ;; 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
>> 
> 
> Yes.
> 
> -- Matthias
> 
> 
>> 
>> --  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
>>>> 
>> 
> 
> 

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20040309/e9f066e2/attachment.ksh>

Posted on the users mailing list.