"Rectangular" coding by a sloppy programmer
Posted: Fri Jan 30, 2015 9:03 am
Bad practice, but sB allows it.
Code: Select all
graphics ! graphics clear .8,.8,.8 ! draw color 0,0,0 'xx
option angle degrees ! option screenlock off ! randomize
sw=screen_width() ! cx=sw/2 ! sh=screen_height() !cy=sh/2
xo=cx ! yo=cy ! s=4 ! mc=1 ! shadow on 'xxxxxxxxxxxxxxxx
anew: draw to xo,yo ! draw color rnd(mc),rnd(mc),rnd(mc)
loop: ang=rnd(360) ! x=xo+s*cos(ang) ! y=yo+s*sin(ang) 'x
if x<0 or x>sw then ! xo=cx ! goto anew ! end if 'xxxxxxx
if y<0 or y>sh then ! yo=cy ! goto anew ! end if 'xxxxxxx
draw line to x,y ! xo=x ! yo=y ! goto loop ! end 'xxxxxxx