We'll add each color the player guesses to a guess list and display the color on the game board.

  • Change the user input variable to color_guess. Append each color_guess to the list guess.
  • Add a Circle named peg with the coordinates x and y, a diameter of 13, and color_guess as the color.
  • Have the stage Wait 1 second, then use Add Value to add 50 to x each time the loop runs.
  • Inside the function and outside the loop, use Return Statement to return the variable guess.

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)