Coding Exercise 1

Prerequisite Concepts 7
Key Concepts 12, 14, 17

Laces can be combined in a variety of ways. One way to combine laces is to simply build each lace consecutively (i.e., first build one, then another, and so on). We will use the term composite lace to refer to artifacts that have been constructed through the sequential creation (i.e., composition) of individual laces. There are many many ways in which a composite lace can be constructed. The only property that a composite lace must have is that it is connected – meaning that the individual laces that form the composite lace are touching or overlapping in some fashion.

Figure 1 gives the specification of a composite lace in terms of the specification of two basic laces, L1 and L2.

composite_lace_01_spec
Figure 1: Specification of a composite lace.

The composite lace shown in Figure 2 was constructed by composing the laces L1 and L2. Note that I have taken some creative license with respect to the shades of red and blue bricks used to create the composite lace. In this project you are to write a program that builds a composite lace having this structure. Feel free to change colors and build a larger composite lace if you like.

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

Coding Exercise 2

Prerequisite Concepts 7
Key Concepts 12, 14, 17

If we assume all lace patterns begin with a 1-bit brick whose color is unspecied, then a lace pattern is all that is needed to denfine a lace.

Figure 3 gives the specification of a composite lace in terms of the specification of four basic laces, L1, L2, L3, and L4.

composite_lace_02_spec
Figure 3: Specification of a composite lace.

Use the composite lace specification shown in Figure 3 to construct a composite lace artifact similar to the one shown in Figure 4.

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

Coding Exercise 3

Prerequisite Concepts 7
Key Concepts 12, 14, 17

If we assume all lace patterns begin with a 1-bit brick whose color is unspecied, then a lace pattern is all that is needed to denfine a lace.

Figure 3 gives the specification of a composite lace in terms of the specification of five basic laces, L1, L2, L3, L4, and L5.

composite_lace_03_spec
Figure 5: Specification of a composite lace.

Use the composite lace specification shown in Figure 5 to construct a composite lace artifact similar to the one shown in Figure 6.

Composite_Lace_03.png
Figure 6: An implementation of the lace specification given in Figure 5.

Coding Exercise 4

Prerequisite Concepts 7
Key Concepts 12, 14, 17

If we assume all lace patterns begin with a 1-bit brick whose color is unspecied, then a lace pattern is all that is needed to denfine a lace.

Figure 3 gives the specification of a composite lace in terms of the specification of four basic laces, L1, L2, L3, and L4.

composite_lace_04_spec
Figure 7: Specification of a composite lace.

Use the composite lace specification shown in Figure 7 to construct a composite lace artifact similar to the one shown in Figure 8.

Composite_Lace_04.png
Figure 8: An implementation of the lace specification given in Figure 7.