Pipegon — ProgramsLOGO
last changed 29 May 2008
 

Pipegon





to PIPEGON :rp :rr :theta :clen :n
CNGON 50 :rp
repeat :n [
pu
fd :rp + :rr
pd
; setc random 140
CNGON 50 :rr
lt :clen * :rp / :rr
ARROW :rr
rt :clen * :rp / :rr
pu
bk :rp + :rr
pd
lt :theta
set :clen (:theta + :clen)
]
end

to APIPEGON :rp :rr :n
let [:clen 0 :theta 360 / :n]
CNGON 50 :rp
repeat :n [
pu
lt :theta
set :clen (:theta + :clen)
fd :rp + :rr
pd
; setc random 300
; CNGON 50 :rr
lt :clen * :rp / :rr
ARROW :rr
rt :clen * :rp / :rr
pu
bk :rp + :rr
pd
]
end

to SPIPEGON :rp :rr :theta :n
let [:clen 0]
;CNGON 50 :rp
repeat :n [
pu
fd :rp + :rr
pd
setc random 300
; CNGON 50 :rr
lt :clen * :rp / :rr
CNGON 2 :rr
rt :clen * :rp / :rr
pu
bk :rp + :rr
pd
lt :theta
set :clen (:theta + :clen)
]
end

to FLASH :l
setc random 300
pu fd :l pd
repeat 6 [fd 2 bk 2 rt 60]
pu bk :l pd
end

to LPIPEGON :rp :rr :n :l
let [:clen 0 :theta 360 / :n]
setc black
CNGON 50 :rp
repeat :n [
pu fd (:rp + :rr) pd
; setc random 300
; CNGON 50 :rr
lt :clen * :rp / :rr
FLASH :l
rt :clen * :rp / :rr
pu bk (:rp + :rr) pd
lt :theta
set :clen (:theta + :clen)
]
end

to ARROW :length
setc blue
fd (:length * 1.3) lt 135
fd (:length * 0.2) bk (:length * 0.2) rt 270
fd (:length * 0.2) bk (:length * 0.2) lt 135
bk (:length * 1.3)
setc black
end

to CNGON :n :rad
pu fd :rad rt 90 + 180 / :n pd
NGON :n ((sin 180 / :n) * :rad * 2)
pu lt 90 + 180 / :n bk :rad pd
end

to NGON :n :edge
repeat :n [fd :edge rt 360 / :n]
end

1