# 11. Draw spirals¶

In this practice we are going to move a character around the screen so that it draws several colored spirals.

1. We start the Scratch editor.

2. Press the language button in the top bar and choose English.

3. We add a new variable Side that will store the size of the side that is currently being drawn.

Press the variables button ,

click on create a variable .

We change the name of the variable to Side

4. We add a new extension with the button add extension down left.

We select the Pencil extension to be able to draw.

A new icon will appear in the code bar, the Pencil , with dark green instructions.

5. We create a new block called start.

First click on the button my blocks

Then click on create a block

Then we change the name of the new block to start

6. The start block will be used to start the program. It will move the cat to the center of the screen with small size. Hide the Side variable, lower the pen to paint, set the pen thickness and color, and clear the screen.

7. We create a new block called square.

First click on the button my blocks

Then click on create a block

Then we change the name of the new block to square

8. The square block will be used to draw a square spiral on the screen.

The size of the side starts with the value 5 and grows by 4 steps until it is equal to or greater than 340.

Each step draws a line of "Side" size, increases the size of the side, rotates 90º and increases the color of the pencil.

9. If we click on the "define square" block, the square spiral will appear on the screen.

10. Now we are going to create a new block called triangle.

First click on the button my blocks

Then click on create a block

Then we change the name of the new block to triangle

11. The triangle block is very similar to the square block, only the angle of rotation changes.

To take advantage of the program already done, we are going to click with the right mouse button on the square instructions and choose the duplicate option.

Once the program has been duplicated, we hook it to the triangle block and change the angle of rotation.

12. If we click on the block "define triangle", the triangular spiral will appear on the screen.

## Challenges¶

1. Make a new block that draws a star spiral. Modify the parameters of the new block to rotate 150 degrees.

2. Create a new block to draw an octagonal spiral. Turns must be 45 degrees. The side must add to 1 on each repetition and must be repeated until the side is greater than 150.

3. Experiment with the program to create new original drawings.