The objective is to create a monkey, starting with the algorithm, meaning the steps to do it then write the code in pencilcode.net. Start with the review of the concept of algorithm.
An algorithm is a list of steps that you can follow to finish a task.
Let’s write an algorithm to make this monkey:
Have the students give you the instructions step by step to create the monkey
Draw a brown circle
Draw another circle same size
Draw a bigger orange circle
draw a small black circle for the right eye
Draw a small black circle for the left eye
You may think about the instructions for the smile
Before starting with the code, review the concept of a Program
Program – An algorithm that has been coded into something that can be run by a machine.
Programming – The art of creating a program.
We are going to create a program to make the monkey
Login to http://www.pencilcode.net
Make a new file: monkey
Add the coding blocks in pencilcode.net one by one showing the results and talking about each coding line.
Make sure they follow you by line #
MAKE THE EARS
Line 1: Draw the first brown circle for the right ear
Notice the turtle is facing up
Line 2-3: Turn the turtle left and move forward
Line 4: Draw the second brown circle for the left ear
Notice the turtle is facing left
MAKE THE FACE
Line 5: Move back to the middle of the two circles
Line 6: Draw the orange circle for the face
The turtle is in the middle facing left
MAKE THE EYES
Line 7: Move back to the right side of the face
Line 8: Draw a small black circle for the right eye
The turtle is facing left
Line 9: Move forward to the left side of the face
Line 10: Draw a small black circle for the left eye
The turtle is covering the left eye
You can add another command to hide the turtle, as shown in line 11
Here is the code
dot ‘brown’, 100
dot ‘brown’, 100
dot ‘orange’, 200
dot ‘black’, 20
Challenge of the day
Have them to figure out how to make the smile.
Here is the code to add the smile
Challenge Part two
Improve the monkeys smile by filling it in.
What would you change to his program?
What would you add to this program?
If you exchange the order of the code would you get the same result?