aUCBLogo Demos and Tests / fdemo
to fdemo [n 20][l 280][useBitFill true]
t0=TimeFine
clearScreen
disableLineSmooth
repeat n
[ pu fd l/2 pd
(rbox l 2)
pu bk l/2 pd
rt 360/n
]
rt 180/n
pu
WindowMode
if useBitFill
[ setXY -400 -300
bm=BitCopy 800 600
bw=BitMaxX bm
bh=BitMaxY bm
]
nf=int n*1.757
white=RGB 1 1 1
home
repeat nf
[ i=repcount/nf
p=pos
; h=Heading
repeat nf
[ j=repcount/nf
setfc hsb i*360 1 j
fd l/nf
; updatevars
ifelse useBitFill
[ x=(400+xCor)/800*bw
y=(300+yCor)/600*bh
BitFill bm x y
;Why use BitFill?
;Because it's much faster than fill!!!
][ (fill FILL_SMALL)
;Why use fill?
;Because it supports high resolutions.
]
]
; setXY -400 -300
; setH 0
; BitPaste bm
; updateGraph
setpos p
; setHeading h
rt 360/nf
if keyp [stop]
]
if useBitFill
[ clearScreen
setXY -400 -300
BitPaste bm
]
enableLineSmooth
;pause
Home
setHeading 0
repeat n
[ pu fd l/2 pd
(rbox l 2)
pu bk l/2 pd
rt 360/n
]
t=TimeFine-t0
(pr t [Seconds])
end