STEP 11: If the user guessed correctly, we need to stop the loop!

  • Change the string to "You guessed my word!".
  • Go to LOGIC and . Drag out Break and drop it inside the if statement.
  • It will also be indented twice, or 8 spaces total!

If the player guesses correctly, the break command will stop the loop so they won't be asked to keep guessing!

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)