## Lesson goal: The while-loop and mouse clicks

Previous: Average some numbers | Home | Next: You guess my number

Here's a use of the while-loop that waits (with a while loop) for you to click inside of the circle drawn on the screen. It computes the distance of your mouse click to the origin to see if you are inside of the circle of radius 20 pixels. Note the logic...setting the variable called done to false, to "prime" the while-loop. The while-loop executes over and over while the done variable is false.