|
Post by tenochtitlanuk on Sept 17, 2018 16:14:42 GMT -5
Hadn't noticed this suggested Rosetta Code task before. Nice one to auto-generate attractive variations by programmatically changing the fill colours...
' Sunflower
nomainwin
WindowWidth = 800 WindowHeight = 800
c =( 5^0.5 +1) /2
numberofseeds = 13000 Pi = 3.14159265
open "Sunflower" for graphics_nsb as #wg
#wg "trapclose quit"
#wg "fill 0 0 150 ; flush" #wg "color 255 0 0"
for i =0 to numberofseeds r =i^c /numberofseeds angle =2 *Pi *c *i x =r *sin( angle) +400 y =r *cos( angle) +360 #wg "up ; goto "; int( x); " "; int( y); " ; down"
pix = numberofseeds mod 256 col$ =str$( pix); " "; str$( pix); " 50"
#wg "backcolor "; col$ #wg "circlefilled "; 4'cr
next i
#wg "getbmp scr 1 1 800 800" bmpsave "scr", "sunflowerJhf.bmp"
wait
sub quit h$ close #wg end end sub
|
|
|
Post by tenochtitlanuk on Sept 17, 2018 16:55:29 GMT -5
|
|