Tutorial/Bricks/Repeats

From Progzoo

We can specify the number of bricks to be drawn.

CommandMeaning
b(3)Draw three long bricks
h(3)Draw three half bricks
m(3)Leave three half brick spaces
r(3)Start a new row three times

Making an E

Finish of the "E".

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

Rectangle

Change so that the are 3 rows of 4 half-bricks.

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

Triangle

There should be one half-brick, then two, then three, four and five.

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

Triangle II

The triangle starts with a row of zero half-bricks. The initial row of 6 is simply so that we can see where the triangle starts.

In each row we must

  • draw some bricks h(...)
  • miss some spaces m(...)
  • draw one brick h()
In row 0 we need 1 brick then we miss 4 then draw 1.
In row 1 we need 2 brick then we miss 3 then draw 1.
We must calculate the number of bricks to draw and the number to miss.

row h  m
0   1  4
1   2  3
2   3  2
3   4  1
4   5  0

Draw the framed triangle as shown.

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

Triangle III

We must calculate the number of spaces to miss then the number of bricks to draw.

row  m  b
0    4  1
1    3  3
2    2  5
3    1  7
4    0  9

In row 0: miss 4, draw 1.
In row 1: miss 3, draw 3.
In row 2: miss 2, draw 5.
...

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