REBOL [ title: "dotflowers pattern generator" author: cyphre@seznam.cz type: 'graphic Purpose: "Inspire awe and amazement" ] time: func [b /local start] [ start: now/precise do b print ["Time:" difference now/precise start] ] init-vals: does [ c1: to-decimal ((img-size/y / 20) + random ((img-size/y / 16) - (img-size/y / 32))) c2: to-decimal (random img-size/y / 8) m1: to-decimal (-32 + random 64) m2: to-decimal (-32 + random 64) ; print [c1 c2 m1 m2] ] img-size: 640x480 ;512x384 random/seed now init-vals px: to-integer img-size/x / 2 py: to-integer img-size/y / 2 isx: img-size/x img: make image! img-size insert-event-func func [f e][ if e/key [ init-vals ] e ] view/new layout [ origin 0 im: image img at 0x0 text white "DotFlowers -- press any key to change shape" ;at 334x365 text white "press any key to change shape" ] ii: 0.0 dotflowers: rebcode [/local nx ny ra][ repeatz j 720 [ set nx 0.0 set jj j to-dec jj set ii i to-dec ii set ra jj div.d ra 2.0 add.d ra ii mul.d ra pi div.d ra 180.0 cos ra mul.d ra c1 add.d nx ra set ra jj div.d ra 2.0 mul.d ra m1 add.d ra ii mul.d ra pi div.d ra 180.0 sin ra mul.d ra c2 add.d nx ra add.d nx ra set ra jj div.d ra 2.0 mul.d ra m2 add.d ra ii mul.d ra pi div.d ra 180.0 cos ra mul.d ra c1 add.d nx ra to-int nx add.i nx px set ny 0.0 set ra jj div.d ra 2.0 add.d ra ii mul.d ra pi div.d ra 180.0 sin ra mul.d ra c1 add.d ny ra set ra jj div.d ra 2.0 mul.d ra m1 add.d ra ii mul.d ra pi div.d ra 180.0 cos ra mul.d ra c2 add.d ny ra add.d ny ra set ra jj div.d ra 2.0 mul.d ra m2 add.d ra ii mul.d ra pi div.d ra 180.0 sin ra mul.d ra c1 add.d ny ra to-int ny add.i ny py set idx ny mul.i idx isx add.i idx nx poke img idx 16777215 ] add.i i 2 rem.i i 359 ] while [not empty? system/view/screen-face/pane] [ im/image/rgb: black dotflowers show im wait 0;.001 ]