WARNING: This program has a logic error which means we need to fix it!

RULE: Set the coordinates to a random value every time the loop runs to place the sprites randomly on the stage!

  • Click Run and watch the stage, then Run again. The loop should make 10 sprites, but we only see 1.
  • The x and y are set randomly, but only once! Then all the sprites appear in the same spot.
  • Debug the program by placing the random commands inside the loop, before the sprite is created.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)