Step 3: The code runs three times, but always creates the same sprite! Let's fix that.

value updates every time the loop runs. First it stores "cat", then "dog", then "pig". The loop now creates three different sprites! You've refactored this program!

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)