WARNING: This program has a bug, so we need to fix it. This bug is a logic error.

RULE: Use add value inside of your loop to change the variable's value as the loop runs.

  • Click Run and watch the stage to see the problem. Our loop should make 9 butterflies, but we only see 1.
  • Debug the program so that the butterflies appear in a row.
  • Use an Add Value command to add 50 to x each time the loop runs.

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)