[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

LOGO-L> Re: Davi's star




On Fri, 15 May 1998, Gines Planas Buil wrote:
> Hi everybody !!
> How can I draw a star with 6 points ?
> 
> Gines Planas Buil
> Sao Paulo - Brasil

And what about a star with N points?
Try the following with some different :node's, best of all primes (why?)

to a.star :nodes :module
 draw.wg w2arr :nodes :module int quotient :nodes 2
end

to draw.wg :ww :k
 make "n count :ww
 bury [n]
 pu setpos first :ww
 pd
 repeat :n [setpos item sum 1 remainder product :k repcount :n :ww]
end

to w2arr :n :l 
 pu
 make "arr []
 bury [arr]
 repeat :n [queue "arr pos fd :l lt 360/:n]
 output :arr
end

; You may also try this
to and.whats.that :nodes :module
  repeat int quotient :nodes 2 [draw.wg w2arr :nodes :module repcount]
end

Isn't it cool that it works without calculating angles and distances?

Best regards.
Andrzej B.
Lodz, Poland

---------------------------------------------------------------
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