I could not resist attaching a .gif of this one. It looks great. A few constructive :-) comments about your code though. These are my own opinions and others here may disagree. > setfc colour repcount Where does this repcount come from? REPEAT is fast and simple, but often not as clear as using FOR. Lot's of implicit parameter passing, which is manageable in this amount of code, but will become unmanageable as your code size increases. Ideally think of every procedure as a room. There is an IN door and an OUT door. OUTPUT is the OUT door. Your procedures parameters' are the IN door. Everything coming IN or OUT a door is labeled at the door. Any time you need to know where data came from or needs to go, you check with the DOORs (and who directly can visit the ROOM). By allowing other means of data in or out of the room is like data coming in and out of a WINDOW, SKYLIGHT, DUCTWORK, CHIMNEY, you name it. You have no idea where it came from or where it needs to go. MHELHEFNY@FRCU.EUN.EG wrote: > > ;Hello George Mills > ;I should like to thank you very much for your advice for fixing my > ;last code to use colour in MSWLogo. > ;Realy I am starting to enjoy MSWLogo; few weeks ago I was comfortable > ;with UCBLogo only. Actually both of them are Great gifts to the Logo > ;community thanks to you and to Brian Harvey. > ;After writing the code for all known surfaces of revolution,some fractals > ;on the sides of a cube some cubes inside cubes (which idea was your's) > ;and also for the "Dodekaeder"; I feel that the 3-D extensions are great. > ;Here is the coloured and revised code for a box which I have sent two > ;days ago to Olga Tuzova. > ;Hoping that some body in the logo-l will enjoy it. > ;With Best Regards. > ;Mhelhefny > ;---------------------------------------------------------- > > to colour :f > make "s [[255 0 0][255 255 0][0 255 0][0 0 255][200 100 200] > [200 0 200][255 150 90]] > op item :f :s > end > > to fil > pu rt :a fd :size*.7 pd fill pu bk :size*.7 lt :a pd > setfc colour :lev > end > > to go > turnon3d cs lt 90 ht > repeat 4[repeat 3[side fd 247] down 90] rr 90 > repeat 3[pu setxyz -247*3 247 -247*(repcount- 1) pd repeat 3[side fd 247]] > end > > to poly_star :size :n :lev > if :lev =0 [stop] > repeat :n [fd :size/ 4 > poly_star :size/3 :n :lev-1 fd :size/ 2 rt 360/ :n] > setfc colour repcount > fil > end > > to side > make "n 5 make "lev 2 > make "c 180/ :n make "a 90- :c > square 247 fd 48 poly_star 200 :n :lev bk 48 > end > > to square :a > repeat 4[fd :a rt 90] > end > > to turnon3d > ; This can be a library procedure > perspective > setturtle -1 > setxyz 1500 1500 1700 > setturtle 0 > end > ;------------------------------------------------------ -- =============================================================== George Mills (mills@softronix.com) http://www.softronix.com/ The www page contains some very powerful educational software. Our single most important investment is our kids.
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