Christos #1 Posted January 8, 2017 In my continuing effort to bring DLA to as many platfoms I own, here's an rb+ version. Honestly it's about as interesting as watching paint dry, but I am really fond of this algorithm so here it is: ' ' Your code goes here ' Have fun! ' rlist=(RAPTOR_LIST *)strptr(RAPTOR_sprite_table) basic_r_indx=1 basic_r_size=1 RLOCATE 0,202 RPRINT " RAPTOR BASIC+ - REBOOT " basic_r_size=0 basic_r_indx=0 RLOCATE 0,218 RPRINT " Derived from BCX BASIC v6 " 'set variables and arrays dim screen[320,200] as short dim x%,y%,counter%,d%,xo%,yo%,dnew%,sticky%,i%,j%,d2%,helperd!, distance! dim dice! for i%=0 to 319 for j%=0 to 199 screen[i%,j%]=0 next j% next i% for i%=1 to 120 vsync next i% cls 'logic screen[160,100]=1 colour 10 'rlocate 160,100 'rprint("8") plot(160,100) xo%=0 yo%=0 x%=0 y%=0 d%=0 d2%=0 counter%=0 do 'let particle d%= 5 + int(counter%/12) xo% = 160+int(d%*cos(rnd*360)) yo% = 100+int(d%*sin(rnd*360)) x%=xo% y%=yo% sticky%=0 while sticky% <> 1 dice! = rnd if dice!<= 0.25 then x%=x%+1 y%=y% elseif dice! >0.25 and dice!<= 0.5 then x%=x%-1 y%=y% elseif dice! >0.5 and dice! <= 0.75 then y%=y% +1 x%=x% elseif dice! >0.75 and dice! <=1 then y%=y% -1 x%=x% end if if x%>319 or x%<1 or y%>199 or y%<1 then exit while end if 'check for sticky if screen[x%+1,y%] or screen[x%,y%+1] or screen[x%,y%-1] or screen[x%-1,y%] =1 then sticky%=1 screen[x%,y%]=1 counter% =counter% +1 plot(x%,y%) print "particles: ", counter% end if wend loop dla.abs 5 Quote Share this post Link to post Share on other sites
+CyranoJ #2 Posted January 8, 2017 Depends what got painted.... .....ah Mystique..... Quote Share this post Link to post Share on other sites