Nesting Loops (Loops Inside Loops)
Nesting means putting one loop inside another. The inner loop completes fully every time the outer loop runs once.
Example: Spiral-Like Pattern
- repeat (4) — outer loop
- repeat (4) — inner loop
- move (50) steps → turn ↻ (90) degrees
- turn ↻ (30) degrees — rotates after each square
The inner loop draws one square; the outer loop draws 4 squares, each rotated 30° from the last.
Tip: Start small — get the inner loop working before adding the outer one.