Count the Balls


Basic Features

Step 1: From the Cloud9 dashboard: Create a new workspace
Fill in the following text boxes on the form:
→ Workspace name: count-the-balls Copy
→ Clone from Git or Mercurial URL: Copy
Click Create workspace button
Open index.html and click Run

Step 2: Create a div to represent a ball, and put it in the box.
Hint: Watch the creating element video.

Step 3: Randomly position the ball in the box.
Hint: Watch the positioning video. The video shows an example. Do NOT copy it exactly.

Step 4: Put a random number of balls in the box.
Hint: If you're having trouble, rewatch the loop video. The video shows an illustration. Figure out how it relates to your code.

Step 5: Show how far off the user's guess was when the submit button is clicked.

Debugging help

Last topic Next topic