Tutorial/Bricks/Expressions

From Progzoo

In these example you should NOT change the routine letsGoToWork instead you should change the routine surface. We want to be sure that our code works for all values of n.

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

Diagonal lines

Change the routine surface so that the correct number of spaces are left.

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

Napier Triangle

Change the routine so that the correct number of bricks are drawn at each level.

n      Number of bricks
========================
0       5
1       4
2       3
3       2
4       1
[Font] [Default] [Show] [Resize] [History] [Profile]

Quarter of a pyramid

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

Eighth of an Octahedron

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