Now we'll use a for loop to make the bricks. We'll create 4 rows of 6 bricks and stack them in columns.

  • Drag out Loop with Range. Change the counter variable to row. Change the range to 4.
  • Drag another Loop with Range inside of that loop. Change the variable to column and the range to 6.
  • Go to and drag Rectangle into your nested loop.
  • Name it block. Change the coordinates to the variables x and y.

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)