Re: More than one input for a script?

"Harness, Kathleen" <kharness-nzINlOoChub2fBVCVOL8/[email protected]>
Newsgroups gmane.comp.lang.smalltalk.squeak.squeakland
Message-ID <B61E9C817826784A8DCE87FEF284B94C08C9B149@CITESMBX2.ad.uillinois.edu>
Randy,
Perhaps this project is a partial answer to your questions below:
http://etoysillinois.org/library?sl=1630
Kathleen
________________________________
From: [email protected] [[email protected]] on behalf of R.D. Latimer [[email protected]]
Sent: Wednesday, August 31, 2011 11:01 AM
To: [email protected]; Allard, Fred
Subject: Re: [squeakland] More than one input for a script?

note that drawPolygon should be "turn 360/sides" (below)


On Wed, Aug 31, 2011 at 11:41 AM, R.D. Latimer <[email protected]<mailto:[email protected]>> wrote:
I'd like to make a simple drawPolygon script that needs two inputs, one of length of each side and one for number of sides.

The basic prototype is:

 drawPolygon (length, sides):
    repeat sides
        forward length
        turn sides/360   <-- turn 360/sides

With Etoys, It looks like the limit is one input parameter for a script, so that the script would be limited to:

 drawPolygon (sides):
   repeat sides
      forward 100         <-- the user would need to hard code the length of the sides
      turn sides/360

Can I use more than on numerical input in a script?

Thanks,
 Randy Latimer

_______________________________________________
squeakland mailing list
[email protected]
http://lists.squeakland.org/mailman/listinfo/squeakland
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.