STEP 17: If the bricks list is empty, the user has won! Let's add that condition to our interval event.

  • From add if inside the interval event (indented once for the interval event)!
  • Change choice to bricks_left and "yes" to 0. This will check if there are any bricks left in the list!
  • In GRAPHICS from add Say inside the if-statement (indented twice!).
  • Assign the .say() to paddle and edit the string argument to "You win!"

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)