Thursday, January 1, 2009

Shapes

Shapes with sides of the same length are generally easy to make. In fact, there is one, solve-all formula which you can use. It is:

TO POLYGON :length :sides
REPEAT :sides [FD :length RT 360.0/:sides]
END

Type in polygon, the length you want the sides to be, and then how many sides you want, and boom, you have yourself a square or a triangle or a decagon or chiliagon (1,000 sides) , depending on what you entered.

2 comments:

Vasant barve said...

Nice to visit your blog.

I will like to learn rendered solids.

i am 69 year old os want lots of comments in code

Vanderdecken12 said...

Oh, wow. I almost forgot about this blog :) Sorry, I'm not sure I can help you anymore. It's been a long time since I've used MSWLOGO. If you are more specific, I might be able to give you some advice....