Skip to main content
Creating Algorithms

# Face It

Create an algorithm to use [Drive for] and [Turn for] blocks and the VR Pen on the VR Robot to create a regular polygonal facial expression on the Art Canvas+ Playground.

• Download the cartoon facial expressions image as a PNG file from this Google slideshow.
• Select the Art Canvas+ Playground and upload the cartoon facial expressions image.
• To learn more about uploading images to the Art Canvas+ Playground, see this article.
• Design an algorithm to create a regular polygonal facial expression.
• Use variables to store the number and length of sides for the polygon, and calculate the angle the robot needs to turn to draw the polygon.
• Utilize the Pen on the VR Robot and use a loop to repeat the [Drive for] and [Turn for] commands for a set number of times to code the VR Robot to draw a regular polygon on the Canvas. Use the value of variables to determine the drive distance, the angle to turn, and the number of times to repeat.
• Drive the VR Robot into the polygon and use the [Fill area with color] block to fill in the shape area with a specific color.

#### Helpful Hints

• Use the formula to calculate the angle the robot needs to turn to draw a polygon:
• The angle to turn = 360 / the number of sides
• Use the divide report block from the Operators category to express the formula to calculate the angle the robot needs to turn

• Matching Python command:

• Use the variable report block from the Variables category to get the value of the number of sides of the polygon to determine the number of times to repeat.

• Matching Python command: