aUCBLogo Demos and Tests / fcn2
be fcn2
pr " pr [Drawing Fully Connected Nets:]
setsc 0 noRefresh
setUpdateGraph false
WindowMode
imax=10
clist = se iseq 0 1 iseq 9 14 ; colors
nr_col=count clist
for [k 1 2] ; number of repetitions
[
for [j 2 3] ; number of edge function
[
for [i 1 imax 1]
[ wait 30
start = timemilli
fcnm give_edges i j 300 2
updateGraph
; if j==1 [(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
be fcnm 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]
[ setpencolor item (1 + remainder e1-1 nr_col) clist
for [e2 e1+1 s 1]
[ anz_v += 1
_setpos item e1 earray
_setpos item e2 earray
]
]
pu home
end
be give_edges i j
if j==1 [op 2^(i+1)]
if j==2 [op (2*i)^2]
if j==3 [op 4*i]
end
end
;Make "Startup [fcn]