It's easier IMHO to do "graphics" with turtle graphics than it is with text. This is basically the same code with things moved around to my own taste. Note that in my modification of Mhelheny's matrix inverse code I had to map his character coordinates (rows and columns of a matrix) to turtle coordinates (I asked the system what the character size was in turtle steps to do this, this is an impartant feature MSWLogo used to lack [i.e. not knowing how big labeled text actually is in turtle steps]). Likewise, Mhelheny took this problem, that was inherintly not character based and made it character based (shifting and rounding in functions X and Y). I simply removed that conversion to get back to the "normal" coordinates. I could of chose to continue to use text with LABEL. But I chose to draw a polygon as a function of the radius, number of sides and color based on distance from the center. to go :b cs for [t 0 180 1] ~ [ localmake "rad 10*(sin (:t*:b))+(cos (:t*:b)) localmake "x :rad*:X_ASPECT*cos :t localmake "y :rad*:Y_ASPECT*sin :t pu setxy :x :y pd setpencolor (list distance [0 0] 0 0) repeat :b [fd :rad rt 360/:b] ] end to goall repeat 20 [go repcount] end make "X_ASPECT 25 make "Y_ASPECT 10 MHELHEFNY@FRCU.EUN.EG wrote: > > ;Hi Olga ! > ;On the occasion of the new-year you asked for the snowball. > ;For the worker's day;here is a simple program to display > ;roses on the text screen. > ;It is easier to run it in UCBLogo; you can also modify it to > ;run in MSWLogo (using the method recently sent by George Mills) > ;try :- > ;go 1 to 5; and go 20 > ;Best Regards > ;Mhelheny > ;----------------- > to go :b > ct for [t 0 360 1][make "rad 10*(sin :t* :b)+(cos :t* :b) > setcursor se x y pr "olga] > end > > to x > op round 40+ :rad*2.5*cos :t > end > > to y > op round 11+ :rad*sin :t > end > ;------------------ > --------------------------------------------------------------- > Please post messages to the Logo forum to logo-l@gsn.org. Mail > questions about the list administration to logofdn@gsn.org. To > unsubscribe send unsubscribe logo-l to majordomo@gsn.org. -- =============================================================== George Mills email: mills@softronix.com http://www.softronix.com The www page contains some very powerful educational software. Our single most important investment is our kids. --------------------------------------------------------------- Please post messages to the Logo forum to logo-l@gsn.org. Mail questions about the list administration to logofdn@gsn.org. To unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home