EasyCode Foundations

EasyCode Sample Lessons 16-20 for Grades 3-8

Turtle Lake: Challenges 16 – 20codemonkey-screenshot1

In the previous 3 lessons your students have learned how to move around using code. They have actually mastered the foundation to programming, as they are now able to write a block of code that will carry out the instructions they intend to give the computer. We will take the current lesson to practice and reinforce this knowledge, and to deepen their understanding of what is actually going on. (Estimated time: 45 minutes)

Primary Objectives

  • Students will practice using functions with different objects (monkey, turtle).
  • Students will apply what they have learned: step, turn, turnTo, step- and activate code by clicking on run as they complete challenges 16-20.

Warm Up (5 Minutes)

Discussion – 5 minutes

Recall with your students that in EasyCode we are writing code in a programming language called CoffeeScript. As they experienced in the previous lessons, the code has to be written in a particular way in order for the computer to do what we are trying to achieve.

Explain that this is because a programming language, just like any language, has its own rules on how things can be said or written. In programming this is called the syntax of the language. There might be more than one correct way to say or write a certain thing in CoffeeScript, just like in English or any language. An important difference between programming languages and other languages is this: In a spoken language, sometimes we can say something incorrectly but still be understood. However, with the computer even the slightest mistake will definitely cause our code to fail. So we always have to pay attention to syntax and be very accurate. For example, if we forget a dot or a space in turtle.step 10 we will get turtle step 10 or turtle.step10, and the code will not do the right thing.

Activity (35 minutes)

Access EasyCode – 1 minute

Today you will start learning basic coding principles through a game called EasyCode. The language we will learn is called CoffeeScript.

Ask the students to:

  1. Log in to Learning.com.
  2. Go to the Turtle Lake: Challenges 16-20 assignment.
  3. Click the link to launch EasyCode.

If a student is having trouble remembering his or her login information, use your Learning.com roster or provide students with log in cards.

Walk-through – 5 minutes

Click the EasyCode button to go to your EasyCode account.

  1. codemonkey-helpboxOpen challenge #15 and click reset to reset the code to what it was initially (blank).
  2. Use typing only, no clicking, and enter the following code: turtle step 10
  3. Click run to execute the Read out loud the error message that appears. Explain that the dot (.) is important. In this example the computer was able to guess what we meant, but this is not always the case.
  4. Edit the code to this code: turtle.step 10 step15
  5. Execute it and read the error message with the students.
  6. Repeat the same with the following modification to the 2nd line (capital S): turtle.step 10 Step 15
  7. And with the following (without breaking between lines): step 10 step 15
  8. Conclude that spelling, punctuation, capitals and new lines are part of the syntax and are essential for our code to do what we want.
  9. Finally, run a 3-star solution: turtle.step 10 step 15
  10. When it completes, click replay and edit it to the following: step 10 monkey.step 15

Conclude with your students that step and monkey.step can be used interchangeably, because the computer assumes we are referring to the monkey. When we refer to the turtle or any other object, we must use its name.

Play Time – 29 minutes

All students should complete challenges 16 to 20 with at least two stars. Use the teacher dashboard to keep track of students achievements.

Note that challenge #16 is a tricky one to achieve three stars. Make sure your students do not stay on this challenge for too long and encourage them to keep going and come back to it if they have time left. At the end of the lesson, you can open a discussion regarding this challenge and try to solve it together with your students in order to get those sneaky three stars.

In challenge #19 there are different ways to make the monkey turn the right way after catching 3 bananas. One way is by using the island: turtle.turnTo island                                                                                        codemonkey-screenshot2

One way is by using any of the bananas along that path: turtle.turnTo bananas[3]

In both cases, hovering and/or clicking will do the trick. Remind your students that hovering over an object shows its name, and clicking enters that name into the editor. If your students ask you about the meaning of something like bananas[3] just tell them that it is the way to access a particular banana and we will get back to it later on.

Note that challenge #20 is an assessment challenge that covers everything your students have recently learned.

Encourage students who finish early to open skill mode on the map and complete unlocked challenges.

As part of this lesson, students are asked to answer the following questions to reflect on what they have learned:

  • What is the importance of being accurate with our syntax when we are coding? (Answer may include: if we are not accurate, the computer may not be able to understand our commands or may do the wrong command.)
  • How is a programming language different from a spoken language? (Answers may include: with spoken language, you can often have grammatical errors and still be understood; with programming language, you have to be exact in order for the computer to understand you command.)
  • What is the name of the programming language that we are using in EasyCode? (CoffeeScript)

Wrap-up (10 minutes)

Discussion – 10 minutes

Revisit challenge #16 and discuss what challenges your students had when trying to get their three stars. As a group, work together to find a solution for getting the three stars.

Next, open skill challenge 2-7 from the class score book and solve it with your class. Ask them to explain how they plan the solution for this challenge. You can even invite a student to solve this challenge in front of the class. The trick in this challenge is similar to the one in challenge 16: tell the monkey to walk backwards in order to have less lines of code, and to get the third star.

Ask students if this challenge seems similar to one they’ve solved before. (As noted above, this is similar to challenge 16.) Explain that it is fairly common to use references from old projects when programming, or even full blocks of code. Encourage students to go back to old challenges to get inspiration or help when needed.