Pencilcode: Make a face

Time: 15-30 minutes

This activity uses the free web-based coding site Pencil Code, at pencilcode.net.

Step 1


Start with a blank Pencil Code project.

Steps:

Instructions Code Result
1. Draw a large dot (look in the Art section) Step 1 Step 1
2. Turn right and go forward using the rt and fd blocks from the Move section. We’re moving to where we can draw an eye! Step 2 Step 2
3. Draw an eye by drawing a small dot Step 3 Step 3
4. Turn all the way around (180 degrees) so you’re pointed back where you came from, take a big step forward, and draw the other eye Step 4 Step 4
5. Turn all the way around again, and step forward into the middle of the large circle Step 5 Step 5
6. Let’s get in position to draw the mouth! Turn right so you’re pointed downwards, step forward, and set the pen to draw where the turtle goes Step 6 Step 6
7. Turn right and go forward to draw one side of the mouth Step 7 Step 7
8. Turn all the way around, and then take a big step forward to draw the other side of the mouth Step 8 Step 8

Things to try:

Instructions Code Result
Try changing the colors of the different parts of the face. What color combination is your favorite? What if all the colors are the same? Try Try
Try putting a Speed block at the beginning. Can you understand what the turtle is doing if the speed is very fast? Try  
Try changing the pen size! Does it look better when it’s large? Or small? Try  
Try changing the size of the eyes! Does the face look weird when they’re big? Try  
Try changing the size of the big dot that makes the face at the beginning!<p>Does it look like a baby when it’s big? Like an alien when it’s small? Try  
This face seems kind of sad, right? Try removing the mouth code from your program (everything under the last Pen block) and putting in this code instead, starting where it says line #14. Does that cheer the face up? Try  

Challenges:

Instructions Result
Challenge 1: Can you give the face a nose? Challenge
Challenge 2: Can you make the face surprised? Challenge
Challenge 3: Can you give the face some hair? Try entering this code and seeing what happens. (pu picks the pen up, so the turtle won’t draw lines where it goes; pd puts the pen back down.) Challenge