Introduction: Tinkercard Codeblocks

The Instructions
Build Some Context Around Math & Coding
How can mathematicians or computer scientists be more like artists? Making patterns is one thing they all have in common. A pattern is a repeated decorative design.The study of pattern is the foundation of mathematics. It is the thread that binds all parts of mathematics together. In coding – like in math – patterns are made from ideas. Mathematicians and computer programmers use patterns to express themselves and to make their work more efficient. For example, they might use loops to allow for the repetition of a sequence of code multiple times. Artists and crafts people such as the ones in southern Africa, produce objects with cultural patterns. The steps they take to create the patterns is similar to the way designers create 3D models on computers.Have students look at some examples of patterns in cultural artifacts such as South African baskets and hats. Have students or small groups of students pick one example and have them identify a shape pattern that follows a given rule. For example, triangles are common shapes in Zulu baskets. Students can use these shape patterns to explore triangular numbers.


Computers, Internet, Tinkercad (a free, easy-to-use, web-based 3D CAD design tool); optional, but useful: 3D printer, color printouts of the Codeblocks used in this lesson.

Step 1: Give Students Some Code to Play With

Give Students Some Code to Play With
One of the best ways to introduce coding to students is to have them play or tinker with existing code. Also, introduce relevant vocabulary to them such as variables, transformation (rotation, scale) and repetition.Discuss terms such as “variable” which is stored in a code file and, when paired with an associated symbolic name or identifier, contains some known or unknown quantity of information referred to as a “value”. “Repetition” means repeating a sequence of instructions a certain number of times, or until some specific result is achieved. A “loop” is a sequence of instruction (algorithm) that is repeated until a certain condition is reached. By repeating an instruction, students can generate patterns. Have students start using Codeblocks in Tinkercad. The first step (for teachers) is to set up an account for each student. Once students are logged in, they have to choose Codeblocks from below their profile image on the main web page. On the next screen, they can choose “New Design.”When they are inside the Codeblocks editor, they can copy the script below to make a random shape generator.

Step 2: Create the Basket / Crown

the Basket or Crown
Students simulate the process of weaving a basket in Codeblocks by taking advantage of coding aspects like loops and variables to control and iterate your designs.In traditional Tinkercad, students build models by dragging basic shapes like a box, cone, or wedge onto the work plane. Codeblocks is similar, but rather than dragging a shape out to the work plane and then resizing it, they drag a block of code for an object whose parameters they can adjust.The basket/hat in the example below consists of a three-sided torus shape that is repeatedly rotated up and around 20 times to form a circle (or crown).

Step 3: Exporting

Have students use the example above to create a different version of the basket/crown. Then, export the final shape as an .stl file.

Step 4: Standards

I can create a program with more than one instruction.
Generate a number or shape pattern that follows a given rule. Identify apparent features of the pattern that were not explicit in the rule itself. For example, given the rule "Add 3" and the starting number 1, generate terms in the resulting sequence and observe that the terms appear to alternate between odd and even numbers. Explain informally why the numbers will continue to alternate in this way.