aUCBLogo Demos and Tests / fcn
be fcn ;Full Connected Net
pr " pr [Drawing completly meshed nets:]
flist = [1 2 3 4 5 6 7] ; colors
setsc 4 noRefresh
setUpdateGraph false
WindowMode
for [i 1 9 1]
[ start = timemilli
radm 2^(i+1) 300 2
updateGraph
(pr " "Run i "with power 2 i+1 "edges "and anz_v "connections:)
show se (timemilli-start)/1000 "seconds
if keyP [stop]
]
ht
; savePostScript "fcn.ps
;Make "startup [a]
be radm edges radius width
cs home pu setpensize list width width
; Number of edges = number of corners
local [w s elist]
w=360/edges
elist=[]
; calculate corners
s=edges
r=radius
repeat s
[ fd r
elist = lput pos elist
bk r lt w
]
pd ht
earray=Array elist
; connect corners
anz_v = 0 ; number of connections
for [e1 1 s 1]
[ spc (1 + remainder e1-1 7)
for [e2 e1+1 s 1]
[ anz_v += 1
_setpos earray.e1
_setpos earray.e2
]
]
pu home
end
be spc nr
setpencolor flist.nr
end
end