Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Logo > Re: [LogoForum]...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 1533 of 1596
Post > Topic >>

Re: [LogoForum] Re: How can I shrink/grow squares in mswlogo

by "John St. Clair" <john.stclair@[EMAIL PROTECTED] > Jan 23, 2008 at 10:47 PM

The message below is being cross-posted from the LogoForum.  Please 
reply here at comp.lang.logo and it will be cross-posted back to the 
LogoForum.  The original author of this message is 
gene_sullivan@[EMAIL PROTECTED]
 course the guts of the square-drawing code have to be in there.
I was highlighting the control structure.

repeat 4 [fd :side_length <lt or rt> 90]

I'm sure you will figure out where to insert this within
your implementation of `square' or `recursive_square'.

Cheers!
Gene

__._,_.___
LogoForum messages are archived at: 
http://groups.yahoo.com/group/LogoForum



> The message below is being cross-posted from the LogoForum.  Please 
> reply here at comp.lang.logo and it will be cross-posted back to the 
> LogoForum.  The original author of this message is 
> gene_sullivan@[EMAIL PROTECTED]
> 
> 
> 
> --- In LogoForum@[EMAIL PROTECTED]
 John St. Clair <john.stclair@[EMAIL PROTECTED]
> 
> wrote:
> >
> > The message below is being cross-posted from comp.lang.logo. Please 
> > reply to LogoForum@[EMAIL PROTECTED]
 or a11 <ashabsurya@[EMAIL PROTECTED]
>.
> > 
> > Hi
> > 
> > I want to draw [ shrink or grow squares ] using recursion in logo
> > like stacking them . Can anyone please help me with this?
> 
> Maybe. I'll let you decide how helpful this is.
> 
> If you define a word `square' with a parameter for side length
> it is fairly easy to do as want.
> From inside your `square' you can invoke another square
> with the parameter fed the argument of the present call,
> which has been scaled -- either up or down -- by multiplying
> it by a number greater or less than 1, depending on whether
> you want larger or smaller squares.
> 
> Of course, the im****tant issue is the `stop condition'.
> When entering the `square' word you are creating
> you will want to test for a stop condition so your
> recursive square doesn't recurse indefinitely.
> 
> Here is a template 
> 
> to square :side_length :scaling_factor
> ;stop condition
> if not <too big or small> [
> square :side_length * :scaling_factor
> ]
> end
> 
> Something like this --^.
> As to whether the stop condition is handled as 
> a constant inside `square', a global variable,
> or a parameter is up to you.
> 
> Q: what happens if one picks a scaling factor of 1?
> 
> Best of luck,
> Gene
> 
> > 
> > 
> > Thanks
> >
> 
> __._,_.___
> LogoForum messages are archived at: 
> http://groups.yahoo.com/group/LogoForum
 




 2 Posts in Topic:
[LogoForum] Re: How can I shrink/grow squares in mswlogo
"John St. Clair"  2008-01-23 22:44:19 
Re: [LogoForum] Re: How can I shrink/grow squares in mswlogo
"John St. Clair"  2008-01-23 22:47:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 17:50:09 CDT 2008.