Running program window So I'm doing this exercise from pictured programs and I've got the program to do as the exercise wants, but the image in the interaction window looks like a bunch of stacked backgrounds. I'm missing something with this program and I don't know what it is. Interaction window after program runs
Also I might add that this must be done without conditionals, for loops etc... advanced functions.
You can see that it overlays a white background that keeps the program from populating that space and I can't seem to find a way around this. I've literally brute forced every possible combination that I can think of and this is the best I could come with at this moment.
Exercise explanation is below:
Write an animation that starts with a blank screen, and each half second adds a small dot at a completely random location — both the x coordinate and the y coordinate are chosen at random.
Hint: Since you need to keep all the previous dots and add one more, your “model” should probably be an image rather than a number. How can you add a dot at a specified location to an existing image?
Hint: It would be especially nice if you could start the animation with any image, of any size or shape, and it would sprinkle dots at random all over that background, without rewriting the handlers.
; Random dots
(define DOT
(circle 4 "solid" "black"))
(define blank-screen
(rectangle 200 200 "solid" "white"))
(define (next-dot x)
(overlay/xy x
(min 200 (random 200)) (min 200 (random 200))
(old-dot DOT)))
(define (old-dot x)
(overlay/xy x
(min 200 (random 200)) (min 200 (random 200))
blank-screen))
(big-bang DOT
(on-tick next-dot 1/2)
(on-draw old-dot 200 200))