STEP 10: Let's calculate the x-coordinate for our first square in the top lefthand corner.

  • Inside your for loop in create_maze(), change the variable to the left of the = sign from my_var to x.
  • Change number 2 to -250 and the number 3 to square_length/2.
  • We place squares using their center coordinates, so we're adding half the square's length to -250. Also, we're placing this code inside our first for loop, so x refreshes for every row.

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)