Workshop

The target audience for this guide plan are middle school or high school participants. Typical participants are computer savvy. They have good typing skills, know how to edit files, and perform system level tasks such as copying and renaming files.

Given the nature of this “short sustained” interaction (e.g., a 5-day workshop), participants want to quickly write their first program. They also want to quickly learn how to use the fully general versions of the Bricklayer “put” functions — those that let you create bricks of arbitrary size and color. And very importantly, participants want to quickly get to the point where they can construct 3D artifacts. Because of this, the coverage of Vitruvia concepts is streamlined and several concepts are covered only minimally or omitted altogether.

A PDF of the lesson plan (containing clickable content) can be found here.

Engaging activities

  • A group exercise that is very engaging involves coding up a pixel art image. Groups of 2-4 can be formed for this activity. The first step involves finding and printing a suitable pixel art image. Using a pair of scissors, the printed image is cut into sections and each group member is given a section to code up. In order for this activity to produce results in the allotted time, group members must have some skill with using basic Bricklayer functions. Upon completion, the code for each of the parts is merged into a single file. Merging requires a bit more sophisticated understanding of Bricklayer programs. In some cases, participants can accomplish this without the help of a guide. However, merging will probably require help from the guide. An example of a group pixel art project can be found here.
  • An art show, in which participants show an artifact they have created to the entire group, is a very engaging activity for most. In an art show, participants (i.e., artists) get to run their code and display the results in a medium (e.g., laptop projector) for all to see. Artists should be encouraged to say a few words about their creation: (1) What did they find most challenging about their artifact, and (2) What do they like the most about their artifact. Observers are encouraged try to guess how the artifact on display was created. An artist ends their presentation by “blowing up” their artifact. This is a very cool feature that LDD provides. At this point, it is the next artist’s turn to present their artifact. Some participants will not have anything ready to display or do not want to display what they have created.

It is expected that prior coding skills of participants will span a broad spectrum. In an effort to sufficiently engage all participants, a guide can select from a comprehensive set of programming assignments. Any given participant will only have time to complete a small number of coding assignments. However, the difficulty of the assignments undertaken can vary from individual to individual.

For many participants, the most complex program they will create will consist of a sequence of Bricklayer 3D function calls. Some participants will use nullary function declarations to structure in their code. A few participants will use offsets or parameterized function declarations. Some participants will not be able to complete the art show assignment — generally this stems from lack of interest rather than a lack of ability.

Remarks: If not controlled, access to computers and the Internet can be extremely disruptive. In some high schools, if a student uses their computer in a manner not appropriate for the course they are given detention. In some elementary schools, if a student uses an iPad in a manner not appropriate for the course they lose iPad privileges for one week. The point of all this is that a firm policy must be in place regarding appropriate computer use and this policy must be enforced. Otherwise a guide can quickly lose control over their group. One possibility for participants who abuse computer privileges is to transition them to paper-and-pencil exercises (such as Laces) for the remainder of the day. NOTE that it is perfectly okay to give participants free time on the computer (e.g., 15 minutes at the end of the day). However, such free time must be officially sanctioned.

Communicating with participants (e.g., given instructions or lecturing) is most effective in small doses (5 minutes at a time). Also it is very important to have participants “step away” from laptops when someone is speaking. One technique that works well is to have participants leave their desktops and come and sit on the floor during any discussion. This includes art shows. Our experiences suggest it is a big mistake to let participants remain in front of a computer while someone is talking.


Day 1

Introduction

Basics

Give a brief overview of Vitruvia Concepts 1,3,4,5, and 6. Before coding can begin, some basic understanding of coordinate spaces and brick positioning must be developed. With this objective in mind, Vitruvia Concepts 1, 3, and 4 establish a natural language-based vocabulary suitable for the communication of brick placement between individuals. More specifically, a means of communication is introduced whereby the construction of a 2-dimensional LEGO artifact can be unambiguously expressed as a sequence of simple English sentences.

Student Activities

  • Students should complete as many of the exercises corresponding to Vitruvia Concepts 1,3, and 4 as time permits.

Level 1 – Concepts 5 and 6

Vitruvia Concept 5 exercises establish a correspondence between the natural language brick-placement instructions used in concept 3 and Bricklayer Level 1 function calls. Vitruvia Concept 6 is a minor extension of concept 5 and introduces the syntax for expressing sequential composition of function calls.

Student Activities

  • Students should complete as many of the exercises corresponding to Vitruvia Concepts 5 and 6 as time permits.
  • At this point, participants are ready for Level 1 coding assignments relating to Vitruvia Concepts 5 and 6. Participants need not complete all exercises, but should successfully complete at least 3 coding exercises for Concept 5-6. If time permits, students can create something similar of their own imagining.

Level 1 – Concept 7

Give a brief overview of Vitruvia Concept 7, which introduces the notion of overwriting. Specifically, what happens when one attempts to put a brick at a location occupied by another brick? In Bricklayer, the default behavior is that the most recent brick placement takes precedence over (i.e., overwrites) previous brick placements. Concept 7 also introduces the EMPTY brick type. When placing an empty brick at a location, the contents of that location is emptied.

Student Activities

  • Students should complete as many of the exercises corresponding to Vitruvia Concept 7 as time permits. At least 3 exercises should be successfully completed.
  • At this point, participants are ready for coding assignments relating to Concept 7. If time permits, students can use overwriting to create something of their own imagining.

Debugging

Challenge: Find the syntax error. It is essential to spend time early on to understand how to interpret SML’s error messages and how to use this information to correct syntax errors in programs. The following set of slides show the most common syntax errors that Level 1 coders make.

Powerpoint    PDF


Day 2

Debugging

Challenge: Fix the syntax error. It is essential to spend time early on to understand how to interpret SML’s error messages and how to use this information to correct syntax errors in programs.

Student Activities

  • The following zipped file contains a number of short Level 1 programs having syntax errors. Participants are to get all programs running.

fix these programs

Level 2

Level 2 coding spans Vitruvia concepts 10 – 13. Level 2 primarily focuses on using function declarations to structure the code that creates a LEGO artifact. It is through such structure that the construction of complex LEGO artifacts becomes intellectually manageable. The key ideas introduced in Level 2 are (1) nullary function declarations, and (2) parameterized function declarations. The concept of an offset is also introduced in order to increase the expressive power of nullary function calls, and to provide a framework for understanding (and transitioning to) parameterized functions.

In Level 2, parameterized function declarations are exclusively parameterized on the location of a brick. Level 2 ends with an introduction to rings and circles which are Bricklayer-defined functions that accept multiple parameters in a curried fashion. However, given the time constraints of a short sustained interaction (e.g., a week-long workshop) it is recommended that rings and circles be skipped.

Student Activities

  • Concept 10 – Participants should successfully complete at least 3 Vitruvia exercises for Concept 10. When this has been done participants can start on the coding  assignments for Concept 10, or they can create something appropriate of their own imagining.
  • Concept 11 – Participants should successfully complete at least 3 Vitruvia exercises for Concept 11. When this has been done participants can start on the coding assignments for Concept 11, or they can create something appropriate of their own imagining.
  • Concept 12 – Participants should successfully complete at least 3 Vitruvia exercises for Concept 12. When this has been done participants can start on the coding assignments for Concept 12, or they can create something appropriate of their own imagining.

Level 3

Level 3 coding spans Vitruvia Concepts 14-18. However, due to time constraints we will only cover Vitruvia concept 14. Concept 14 introduces a generalized version of the “put” function, called put2D, that is parameterized on brick shape, type, and location. Through the put2D function, all bricks supported by Bricklayer are now accessible. Furthermore, rectangular shapes of any size can now be created using a single function call. For example, a pink brick whose shape is 3×8 and whose location is (2,4) will be created by the following function call.

put2D (3,8) PINK (2,4)

The function put2D underscores the power of parameterization. At this stage, students are encouraged to parameterize their own user-defined function declarations on attributes other than location (e.g., on brick shape and type). Most of the participants of a short sustained interaction (e.g., a week-long workshop) will not develop the skills and familiarity necessary to accomplish this. However, an understanding of how to call the function put2D is fully within reach, and therefore is given special attention. An overview of level 3 Bricklayer functions (including put2D) can be found here.

Student Activities

  • Participants should successfully complete at least 3 Vitruvia exercises for Concept 14. When this has been done participants can start on the coding assignments for Concept 14, or they can create something appropriate of their own imagining. Coding assignments for Concept 15 are optional.

Group Pixel Art

Preparation for pixel art group project. The last 15-30 minutes of the session should be spent forming groups consisting of 2-4 participants. Each group is then to search the web for pixel art images which they believe they could code. An example of a group pixel art project can be found here. All pixel art images must be approved by a guide. A copy of each approved image is given to the guide who is responsible for printing at least two color copies of this image to be made available to groups at the next meeting. Once a group is finished a guide may grant them free time on the computer for the remainder of this session.

Student Activities

  • Form groups of 2-4.
  • Search the web for pixel art images.

Day 3

Group Pixel Art

Group (2-4 members) pixel art project in 2D – if they have not already done so, teams are asked to search the web an find a suitable pixel art image. At least two copies of this image are then printed out (in color). Teams then cut up one of the images and each member codes up their portion. An example of a group pixel art project can be found here.

Oftentimes, a group consists of members having diverse coding skills. Some members may only be comfortable coding at Level 1, while others may be comfortable coding at Level 3 or even Level 4. The rules for the pixel art project is that a group must work with the members it has. In particular, a member cannot re-code the portion of a pixel art assigned to another member. However, it is perfectly acceptable to add functions to the code a member is writing. The reason for this is to provide access to colors (and possibly shapes) not supported in Level 1 (or Level 2). An example of such an extension is shown below.

Adding functions to Level 1

Student Activities

  • Complete group pixel art project.

Level 4

Level 4 coding involves the creation of three-dimensional LEGO artifacts. The three-dimensional function for placing bricks is called put. Due to its two-dimensional nature, learning three-dimensional concepts using Vitruvia is limited. However, Bricklayer provides on-line documentation (here) as well as coding examples (see table shown below) that describe the syntax and semantics of three-dimensional Bricklayer functions.

Code Demo Download Source Code
putMultibrick 01
putMultibrick 02
putHollow 01
putHollow 02
hollowSphere 01
hollowSphere 02
ringX
ringY
ringZ
coneX and coneNegX
coneY and coneNegY
coneZ and coneNegZ
hollowCylinderX
hollowCylinderY
hollowCylinderZ

In three-dimensional space, it is very easy to create artifacts that have thousands of pieces. For example, a 30x30x30 solid cube will contain 27,000 pieces. Though the rules are not hard and fast, LEGO Digital Designer (LDD) has difficulty displaying LEGO artifacts that contain more than 25K pieces. For this reason, Bricklayer introduces functions that create “hollow” shapes. For example, the function putHollow is a function that creates a hollow rectangular prism. Similar functions exist for creating, hollow spheres, cylinders, and cones.

In Level 4, a variety of Bricklayer functions accept brick lists. The elements of a brick list are randomly selected when constructing a given structure. This random selection of bricks provides a way to add “texture” to an artifact.

Student Activities

  • Participants should successfully complete at least 3 Vitruvia exercises for Concept 19. When this has been done participants can start on the coding assignments for Concept 19, or they can create something appropriate of their own imagining.

Day 4

Finish up work that was not completed on previous days. Revisit/review concepts as necessary.

Work on art show project. Participants should spend the entire session working on one or more projects. These projects can be at any of the coding levels 1 – 4. Participants can work on more than one project. They can even work on group projects in a manner similar to what was done for the pixel art project. Specifically, each participant should be coding on their own machine (as opposed to three group members looking on as the fourth group member codes).

Project themes that are very popular include:

  • Minecraft
  • Pixel art
  • Star wars
  • LEGO artifacts that look cool when blown up

Day 5

  • Finish art show project
  • Present

Remarks: Some participants will not want to present anything or will not have anything ready to present. Sometimes the reason for this is that the choice to attend this event was not theirs.