My port of the fill screen with circles. Even randomized the Pallete , hw, sw, vw, to see if it affected the color range.
1 'Ported from QB64 Game Programing by Terry Ritchie
40 'variables
45 circles=50
50 screenwidth=PSIZE(0):REM 256
60 screenheight=PSIZE(1):REM 224
70 x=screenwidth/2-1
75 y=screenheight/2-1
168 oktopaint=-1
170 'main loop
175 SCREEN 5
180 CLS
185 DO
186 FOR count=0 TO circles-1
189 CALL dir(xdir,ydir)'update dir
192 CALL cir(x,y,c,r)
200 IF x<=r THEN xdr=-xdir 'edje of circle hit left wall then reverse x direction
210 ELSE IF x>=eenwidth-r HEN xdir=-xdr'edje of circle hit right wall then reverse x direction
230 ENDIF
235 IF y<=r THEN ydir=-ydr 'edje of circle hit top wall then reverse y direction240 ELSE IF y> creenheight-1 T N ydir=-ydir 'edje of circle hit bottom wall reverse y direction
240 ELSE IF y>=screenheight-1 T N ydir=-ydir'edje of circle hit bottom wall reverse y direction
245 ENDIF
258 IF oktopaint=-1 THEN 'paint circles
259 CIRCLE x,y,r,c,c
270 ENDIF
272 NEXT count
275 LOCATE 2,26
278 k=KEY(27)
280 PRINT " Press Down Arrow to stop"
290 LOOP WHILE k=0
300 END
315 PROC cir(x,y,c,r)
320 x=x+xdir'update direction
325 y=y+ydir
328 PALETTE 0,RND(7),RND(7),RND(7),1
330 red=RND(255)'randomise colors
335 green=RND(255)
340 blue=RND(255)
345 c=RGB(red,green,blue)
350 r=RND(20)+11/2'randomise radius
353 RETURN
354 PROC dir(xdir,ydir)
361 xdir=RND(128)-x/2'randomise direction
362 ydir=RND(112)-y/2
365 RETURN