Coding Exercise 1

Prerequisite Concepts 7, 12
Key Concepts 14, 17

Rather than using a single lace pattern (over and over again) in the construction of a lace, a lace can be generated by alternating between two or more lace patterns. We call the resulting structure an intertwined lace.

For example, suppose we are given two lace patterns L1 and L2. An intertwined lace can be constructed from these patterns as follows: First, perform one iteration of the L1 stamping pattern using a 1-bit brick as a seed shape. Then perform one iteration of the L2 stamping pattern using the artifact created in the previous step as a seed shape. Continue on in this fashion alternating between the L1 and L2 stamping patterns to construct larger and larger artifacts.

Figure 1 species an intertwined lace constructed from two stamping patterns.

intertwined_lace_01_spec
Figure 1: Specification of an intertwined lace.

The intertwined lace shown in Figure 2 is an implementation of the intertwined lace specification given in Figure 1. The colors in this artifact are the result of random brick selections which were accomplished using Bricklayer’s random brick function.

In this exercise you are to write a Bricklayer program that implements the intertwined lace specified in Figure 1. Your implementation should make use of Bricklayer’s random brick function to select the bricks in your artifact. Feel free to change colors and build a larger intertwined lace if you like.

intertwined_lace_01
Figure 2: An implementation of the lace specification given in Figure 1.

Coding Exercise 2

Prerequisite Concepts 7, 12
Key Concepts 14, 17

Rather than using a single lace pattern (over and over again) in the construction of a lace, a lace can be generated by alternating between two or more lace patterns. We call the resulting structure an intertwined lace.

Figure 3 species an intertwined lace constructed from two stamping patterns. Note that these two patterns have different sizes.

intertwined_lace_02_spec
Figure 3: Specification of an intertwined lace.

The intertwined lace shown in Figure 4 is an implementation of the intertwined lace specification given in Figure 3. The colors in this artifact are the result of random brick selections which were accomplished using Bricklayer’s random brick function.

In this exercise you are to write a Bricklayer program that implements the intertwined lace specified in Figure 3. Your implementation should make use of Bricklayer’s random brick function to select the bricks in your artifact. Feel free to change colors and build a larger intertwined lace if you like.

intertwined_lace_02
Figure 4: An implementation of the lace specification given in Figure 3.