I've coded the basics. Just need to add a distance check to the far edge of the small circles.
red = 65536*255
cyan = 65535
bigr = 360 // radius of bounding circle
ratio = 8 // ratio of bounding radius to inner radii
rem co-ordinates to draw the image at on screen
posx = screen width()/2 - bigr
posy = screen height()/2 - bigr
hide mouse
sync rate 30
sync on
do
rem adjust radius ratio
inc ratio, upkey()-downkey()
if ratio < 2 then ratio = 2
if ratio > 32 then ratio = 32 // arbitrary limit
lilr = bigr/ratio // radius of inner circles
rem draw bounding circle
ink red,0
circle posx+bigr,posy+bigr,bigr
origin(posx+bigr,posy+bigr)
rem draw inner circles
for y = lilr to bigr+bigr step (lilr + lilr)
for x = lilr to bigr+bigr step (lilr + lilr)
dx = bigr-x
dy = bigr-y
d = sqrt(dx^2 + dy^2)
if d > bigr then ink red,0 else ink cyan,0
circle posx+x,posy+y,lilr
origin(posx+x,posy+y)
next x
next y
ink -1,0
text 0,0,"ratio = 1:"+str$(ratio) + " (use UP and DOWN to adjust)"
sync:sync:cls
loop
// END
function origin(x,y)
box x-2,y,x+3,y+1
box x,y-2,x+1,y+3
endfunction
For choosing random circles without duplicates, an efficient solution is to create a list of all possible values and shuffle it:
dim list$(25)
for i = 0 to 25
list$(i) = chr$(65+i)
print list$(i);
next i
print
// shuffle the list
for i = 0 to 25
temp$ = list$(i)
x = rnd(25)
list$(i) = list$(x)
list$(x) = temp$
next i
for i = 0 to 25
print list$(i);
next i
wait key
end
Then just read off as many items from the shuffled list as you want.
The difficulty in learning is not acquiring new knowledge but relinquishing the old.