STEP 14: Now that we have the player's guess, we need to use a conditional to see if they are correct.

  • In LOGIC, click . Drag out if and drop it indented inside the loop.
  • Change the test variable from choice to guess and the test value from "yes" to savings.
  • In GRAPHICS, from drag out Say and drop it indented inside the if-block.
  • Assign .say() to bank using dot notation.

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)