Task

Generate 100 <x,y> coordinate pairs such that x and y are integers sampled from the uniform distribution with the condition that 




10
≤



x

2


+

y

2




≤
15


{\displaystyle 10\leq {\sqrt {x^{2}+y^{2}}}\leq 15}

. 
Then display/plot them. The outcome should be a "fuzzy" circle. The actual number of points plotted may be less than 100, given that some pairs may be generated more than once.

There are several possible approaches to accomplish this. Here are two possible algorithms.

1) Generate random pairs of integers and filter out those that don't satisfy this condition:





10
≤



x

2


+

y

2




≤
15


{\displaystyle 10\leq {\sqrt {x^{2}+y^{2}}}\leq 15}

.
2) Precalculate the set of all possible points (there are 404 of them) and select randomly from this set.




PROC DrawCircle(BYTE rmin,rmax,max,x0,y0)
  BYTE count,limit
  INT x,y,r2,rmin2,rmax2
 
  limit=rmax*2+1
  rmin2=rmin*rmin
  rmax2=rmax*rmax
  count=0
  WHILE count<max
  DO
    x=Rand(limit) y=Rand(limit)
    x==-rmax y==-rmax
    r2=x*x+y*y
    IF r2>=rmin2 AND r2<=rmax2 THEN
      Plot(x+x0,y+y0)
      count==+1
    FI
  OD
RETURN
 
PROC Main()
  BYTE CH=$02FC,COLOR0=$02C4
 
  Graphics(5+16)
  Color=1
  COLOR0=$0C
 
  DrawCircle(10,15,100,40,24)
 
  DO UNTIL CH#$FF OD
  CH=$FF
RETURN