Nested Loops Tutorial

From Progzoo
Jump to: navigation, search
Bricks Tutorials
Introduction
for loops
Pairs of loops
Nested loops

In this application we can draw bricks and half-brick.

Warming up

Bricks41.png

CommandMeaning
h(3)Draws 3 half bricks
r()Start a new row in front
s()Start a new surface


The default program draws six lines of two bricks and four bricks high.

Draw six lines of three bricks and four high.

[Font] [Default] [Show] [Resize] [History] [Profile]

Using the Control Variable i

Bricks42.png


Draw a set of steps.

[Font] [Default] [Show] [Resize] [History] [Profile]

Gaps

Bricks13.png

CommandMeaning
h()Draws a half brick
m()Leaves a half brick gap
r()Start a new row in front


Use bricks and misses.

[Font] [Default] [Show] [Resize] [History] [Profile]