Rotating Squares

Create a new Scratch project, and construct the following program. Or, you can download the starter program here.

starter

Now consider a program that produces an output like this:

rotating

If you look carefully at this figure, the simple square shape that the original program would draw just once is now being drawn six times (each one rotated a bit more than the previous one), so we get a circular overall shape. Making this modification will consist of adding a repeat loop which will enclose the existing repeat loop (in other words, you’ll end up with a repeat loop inside of another one). In addition, you will need to add a “turn” command.

For this problem, modify the starter program to output a drawing like below, drawing precisely 36 squares.

rotating36

How to Submit

  1. On Scratch, select File > Save now. Then select File > Save to your computer and keep that file so that you can submit it. If prompted by your computer to Open or Save the file, be sure to Save it.
  2. Rename your file to rotatingSquares.sb3.
  3. Go to CS50’s Gradescope page.
  4. Click “Problem Set 0: Rotating Squares”.
  5. Drag and drop your .sb3 file to the area that says “Drag & Drop”.
  6. Click “Upload”.

You should see a message that says “Problem Set 0: Rotating Squares submitted successfully!” You may not see a score just yet, but if you see the message then we’ve received your submission!