Zoo tutorials: [ SQL | Linux | XML ]
ProgZoo: [ Java | C# | VB | C++ | Perl ]
Log in

A Gentle Introduction to
C# Programming

Tutorial: Bricks - surfaces

 

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

1. Diagonal lines


Big

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

A pattern of bricks

2. Napier Triangle


Big

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
A pattern of bricks

3. Quarter of a pyramid


Big

A pattern of bricks

4. Eighth of an Octahedron


Big

A pattern of bricks