Preview Mode. Sign in to save progress!
You are in preview mode! Progress will not be saved!
Sign in to save your progress!

Mini-Activity: While Loops with Functions

In this activity, you will add a while loop to the smiley face project you worked on in the Functions unit. In the previous Touch-Screen Smiley Face Mini-Activity, the program only allowed for one touch.  By adding a while loop to the program, you will be able to repeatedly touch the screen to print multiple smiley faces.

1.  Open the smiley face project you worked on in the last Functions mini-activity.

2.  Insert an infinitely true while loop in the program, putting the curly braces around the waitUntil command and function call.
Typing while loop


3.  Download and run the program.

4.  Observe.
Tap repeatedly on the screen to create smiley faces!


  • Press anywhere on the screen.  The smiley face appears in the spot where the screen was pressed.  Repeatedly tap on the screen in random locations.  Smiley faces are printed at each location that is pressed on the screen!
Contact Us