Painting With Loops

Loops

Let's look at the sequence for drawing a square from scratch:

Do you recognize any pattern here?

Is anything repeating over and over?

Those 2 lines are repeating 4 times...

When you detect patterns like these that repeat you can use Loops to simplify your code, so that the above becomes:

See the same transformation in Gears code blocks:

Can be simplified as:

Practice