# Pattern Play in Tinkercad Codeblocks

1,307

8

## Introduction: Pattern Play in Tinkercad Codeblocks

What is pattern? Where do we see patterns? A pattern is something that repeats and repeats. And there are many types of patterns! In this instructable, we start with making some colour patterns and number patterns with coding - the Tinkercad Codeblocks! When making those patterns, you may have an optical illusion. No worries! Because you are also making illusion arts with patterns. Later, we will introduce a special number pattern which is considered to make your art works more perfect. Enjoy and have fun!

Remarks:

1. Try to keep the code as short as possible
2. The code example is for reference only

## Step 1: Make 5 Cubes in a Row

Look at the animation, and try to write the codes by using the following techniques:

1. ADD and MOVE
2. COPY and MOVE
3. VARIABLE and LOOP

Please consider the following information in your programming:

1. The dimension of the cube is W=10, L=10, H= 1
2. The distance between squares is 12

## Step 2: Make 5 Rows

Look at the animation, and try to write the codes by using the following techniques:

1. two seperate LOOPS
2. nested LOOPS

Please consider the following information in your programming:

1. The dimension of the cube is W=10, L=10, H= 1
2. The distance between squares is 12

## Step 3: Make a Checked Pattern (style 1)

Look at the animation, do you see the illusion? Dark dots seem to appear and disappear at intersections. Try to write the codes.

Please consider the following information in your programming:

1. The dimension of the cube is W=10, L=10, H= 1
2. The distance between squares is 12

## Step 4: Make a Checked Pattern (Style 2)

Look at the animation, do you see the illusion? Dark dots seem to appear and disappear at intersections. Try to write the codes.

Please consider the following information in your programming:

1. The dimension of the cube is W=10, L=10, H= 1
2. The distance between squares is 12

## Step 5: Make a Number Tower (Style 1)

What pattern do you see?

• 1, 2, 3, 4 and 5
• This is a number pattern
• It is in ascending order.
• The difference between two numbers is 1!

Look at the animation, and try to write the codes.

Please consider the following information in your programming:

1. The lengths (L) of the objects are 1, 2, 3, 4 and 5 respectively
2. The width (W) and height (H) remain at 1

## Step 6: Make a Number Tower (Style 2)

What pattern do you see?

• This number pattern is similar to the previous one, but all objects are aligned in one end

Look at the animation, and try to write the codes.

Please consider the following information in your programming:

1. The length (L) of the objects should be 1, 2, 3, 4 and 5 respectively
2. The width (W) and height (H) remain at 1
3. All objects should be aligned in one end

## Step 7: Make an Even Number Tower

What pattern do you see?

• This number pattern is in ascending order.
• The difference between two numbers is 2.
• Those numbers can be divided by two.
• They are even numbers.

Look at the animation, and try to write the codes.

Please consider the following information in your programming:

1. The length (L) of the objects should be 2, 4, 6, 8 and 10 respectively
2. The width (W) and height (H) remain at 1
3. Align one end of all objects

## Step 8: Make an Odd Number Tower

What pattern do you see?

• This number pattern is in ascending order
• The difference between two numbers is 2
• Those numbers cannot be divided by two.
• They are odd numbers.

Look at the animation, and try to write the codes.

Please consider the following information in your programming:

1. The length (L) of the objects should be 1, 3, 5, 7 and 9 respectively
2. The width (W) and height (H) remain at 1
3. Align one end of all objects

## Step 9: Number Pattern - Fibonacci Numbers

0, 1, 1, 2, 3, 5, 8, 13, 21... What pattern do you see?

This is a special pattern and it is considered to have a golden ratio and a mystical relationship with nature. Maybe you have seen it in daily life. Do you have any idea what this number pattern is?

This number pattern is called Fibonacci numbers. In this sequence, the next number is the addition of two previous numbers (except the first and second number). For example, by adding 3 and 5, we get the seventh number as 8. In the following activities, the Fibonacci numbers will be applied to the programming to make your unique art works. And let the hidden Fibonacci pattern make your art works awesome!

The above animation shows the drawing of Fibonacci Rectangles, and it is said to be the most beautiful rectangle. This rectangle consists of several squares, in which the square's sides follow the Fibonacci numbers.

## Step 10: Make a Tower With Fibonacci Numbers

What pattern do you see?

• The tower's length follows the pattern of Fibonacci numbers

Look at the animation, and try to write the codes.

Please consider the following information in your programming:

1. The length (L) of the objects should be 1, 2, 3, 5, 8, 13, 21 and 34 respectively
2. The width (W) and height (H) remain at 1
3. Align one end of all objects
4. Make use of variables and loops to reduce redundant code

## Step 11: Make a Sphere With Fibonacci Numbers

What pattern do you see?

• The sphere's radius follows the pattern of Fibonacci numbers

Look at the animation, and try to write the codes.

Please consider the following information in your programming:

1. The radius of the objects should be 1, 2, 3, 5, 8 and 13 respectively
2. Make use of variables and loops to reduce redundant code

## Step 12: Fibonacci Numbers in Nature

The number of sunflower petals is a Fibonacci number. The next petal rotates around 137.5° or 222.5°. This rotation also follows the Fibonacci numbers, and we can make use of the ratio to create some unique art works (in step 13 to 15). Here, all examples use 140° as the rotation degree.

The rotation ratio of sunflower petals:

222.492°137.508° = 1.618...

## Step 13: Example 1: Name Tag

Is there any pattern in this name tag? What are the hidden Fibonacci sequences?

• Fibonacci Rectangle
• Stars (size and rotation)

## Step 14: Example 2: Badge

Is there any pattern in this badge? What are the hidden Fibonacci sequences?

• Stars' size (Fibonacci sequence)
• Stars' rotation (Number pattern)

## Step 15: Example 3: Pocket Mirror

Is there any pattern in this pocket mirror? What are the hidden Fibonacci sequences?

• Stars' size (Fibonacci sequence)
• Rotation of stars, circles and hearts (Number pattern)

## Step 16: More Examples

Here are some examples. Make Your own art works with patterns. Have fun!

Runner Up in the
Block Code Contest

88 13K
1 216 18K
3 1.4K
49 6.9K