[REBOL] Re: Another coffee break problem?
From: tomc:darkwing:uoregon at: 16-Nov-2003 22:27
since the length? magic-squares n is known to be 8 * n * n
lets try a variation and plot wall time in thousandths of a second.
run: func [f [word!] n[integer!] /local then][
then: now/time/precise
do f n
to-integer 1000 * subtract now/time/precise then
]
draw-bar: func [n height /local p1 p2 p3 p4][
p1: to-pair reduce [(n * 20) 270]
p2: p1 - (height * 0x1 / 20)
p3: p2 + 18x0
p4: p1 + 18x0
compose/deep [
text (p1 + 0x4) (form n)
polygon (p1) (p2) (p3) (p4) (p1)
text (p2 - 0x18) (form height)
]
]
draw-blk: compose[
pen sky fill-pen white font (probe make face/font [size: 10])
]
view/new center-face layout [
b: box black 500x300 effect compose/deep [draw[(draw-blk)]]
]
repeat n 23[
if odd? n[append b/effect/draw draw-bar n run 'magic-squares n show b]
]
wait none
On Mon, 17 Nov 2003, Anton Rolls wrote: