Random Circles in BB4Win

Random Circles One   

     rem change the graphics mode
     
mode 12

     rem create two colour pots
     
colour 1, 100, 123, 9
     colour 2, 20, 20, 20

     rem change the background colour
     
colour 1 + 128 : cls

     gcol 
2 : rem change graphics colour

     rem repeatedly draw random circles
     
repeat
       proc
_myCircle( rnd(1000), rnd(1000) )
     until false

     stop

     
defproc_myCircle( x%, y% )
     rem draws ever increasing circles
     
local r%
     for r% = 1 to 200 step 10
       circle fill x%, y%, r%
       wait 5
     next
     endproc



Random Circles Two  

     mode 10 : rem sets up a graphics mode

     
myCount% = 0 : rem set counter to zero

     rem repeat forever
     
repeat
       
rem choose a random colour
       
gcol rnd(16)
       rem create a random circle
       
circle fill rnd(1400), rnd(1300), rnd(100)
       wait 5
       myCount% += 1  : rem add one to the counter

       rem clear the screen once I have displayed
       rem the right number of circles
       
if myCount% = 50 then
         cls
         
myCount% = 0
       endif
       
rem and then do it again...
     
until false

Random Colours Thingy - DONT RUN IT! 

     rem mesmerising colour thing
     rem DO NOT EXECUTE IF YOU
     rem SUFFER FROM
     rem PHOTO-SENSITIVE EPILEPSY
     
mode 10

     rem three nested loops to control the colour
     
for red% = 1 to 255 step 5
       for green% = 1 to 255 step 5
         for blue% = 1 to 255 step 5
           rem choose a random colour
           
colour 1, red%, green%, blue%
           colour 2, 255-red%, 255-green%, 255-blue%

           rem set to the background colour (1)
           
colour 1 + 128 : cls
           gcol 
2
           rem draw circle in the opposite colour (2)
           
circle fill 700,600, 300

         next
       next
     next