[plt-scheme] scaling and rotating images using image.ss

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Sat Sep 26 10:41:54 EDT 2009

On Sep 26, 2009, at 10:20 AM, Yaron Minsky wrote:

> I'll be very interested in reading the approach to testability.

We will provide two forms:
  (check-member-of (f ...) 1 2 3 4)
  (check-range (f ...) -10 +10)

We recommend that you write a 'main' function f that does nothing but  
generate random values and calls f-aux:

  (define (f x y z) (f-aux (random x) x y z))

You can then test f-aux as before, and only f needs 'random testing.

> I'm also curious about how one effectively tests the rendering  
> functions --- it's really not obvious to me what if anything one can  
> do there.

The ICFP paper is one starting point. HtDP/2e see (links) is another  
one. It's more than anyone else can offer at this level, but yes, it  
ain't perfect. In general I tell students to play with expressions at  
the repl. When they are happy with the outcome they should use the  
expressions (not the image) as the expected result expression. As they  
do so -- for the various cases and value ranges of the parameter, they  
develop decent coverage and an idea of how to complete the template.

-- Matthias




>
> y
>
> On Sat, Sep 26, 2009 at 10:01 AM, Matthias Felleisen <matthias at ccs.neu.edu 
> > wrote:
>
> We are not ideologues:
>
>  ;; random: Nat -> Nat
>  ;; (random n) is an element of [0,n)
>
> See http://www.ccs.neu.edu/home/matthias/HtDP2e/Itemizations_and_Structures.html 
> , look for random. But yes, this is the only compromise so far.
>
> The November release will contain forms (and recommendations) for  
> testing functions that employ random.
>
>
>
>
>
>
> On Sep 26, 2009, at 9:56 AM, Yaron Minsky wrote:
>
>> Argh.  I was still running 4.1 by mistake.  It's right there in  
>> plain sight in 4.2.1.
>>
>> Another question about the world/universe approach: how do you guys  
>> think about randomness?  I've found that adding a bit of randomness  
>> can make games considerably more compelling.  But it's not clear  
>> how to include randomness in a reasonably simple way that doesn't  
>> compromise on the purely-functional nature of the callbacks...
>>
>> y
>>
>> On Sat, Sep 26, 2009 at 9:49 AM, Matthias Felleisen <matthias at ccs.neu.edu 
>> > wrote:
>>
>> On Sep 26, 2009, at 9:43 AM, Yaron Minsky wrote:
>>
>>> Nice to see everyone up so early on a Saturday morning!
>>
>> You're late :-]
>>
>>
>>> Where is 2htdp/universe?  I just installed the latest PLT scheme  
>>> release, and I don't see anything called "universe" in the list of  
>>> teachpacks that comes up when I try to add a teachpack.
>>
>>
>> Use the scrollbar. It's there.
>>
>>
>>
>>
>>> Anyway, I'm glad to see this getting worked on.  I think one of  
>>> the things that Scratch got right is that it provides simple image  
>>> transformations, which turn out to be very useful in constructing  
>>> simple-yet-compelling games.  I think having more of this stuff  
>>> for drscheme will make it considerably more compelling for the  
>>> younguns.
>>>
>>> y
>>>
>>> On Sat, Sep 26, 2009 at 9:29 AM, Matthias Felleisen <matthias at ccs.neu.edu 
>>> > wrote:
>>>
>>>
>>> 1. htdp/world is deprecated, use 2htdp/universe instead.
>>>
>>> 2. we consider the pinhole approach to our image library as a  
>>> mistake. To solve the problem Robby is working on 2htdp/image, a  
>>> replacement for the image library. When it comes out (end of  
>>> semester probably) it will support rotate and other such  
>>> operations, plus comparisons will be much faster.
>>>
>>> -- Matthias
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Sep 26, 2009, at 9:17 AM, Yaron Minsky wrote:
>>>
>>> I'm playing around with the image.ss and world.ss teachpacks, and  
>>> I couldn't figure out how to scale and rotate images.  Are there  
>>> such image transformation functions in some other teachpack?
>>>
>>> y
>>> _________________________________________________
>>>  For list-related administrative tasks:
>>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>>
>>>
>>
>>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090926/e2003fdd/attachment.html>

Posted on the users mailing list.