8-10 yrs old
11-13 yrs old
Running Out of Time: We Need Beets! Creativity in Coding – Functions and Notes
September 3, 2020
Educator Guide Block 3 Lesson 5
Block 3 Lesson 5 world
Tell students: Today you will be investigating and becoming more familiar with utilizing all the skills you have been learning about in this course. We are going to get the Agent to plant beets for us today as we will be visiting the future.
In this lesson the students will be introduced to Functions and a skill of commenting the code.
Coding activities: (30 min)
Activity 1: Learn to Plant
Tell the students: We are going to need a lot of beets. Luckily, we have landed on a roof top of a farm. Let’s teach the Agent how to farm the beets. Get some seeds from the chest and put them in the Agent’s inventory. Using the Agent’s coding block drawer, program the Agent to till and plant the seeds.
Activity 2: Planting Continues
In the same room the Agent is moved to a line of dirt 11 blocks long. Students are given the function “Plant Seed” which is simply the code they wrote in the previous activity. They will need to use that functer in a sequence (probably a repeat loop) to call the plantSeed function and plant seeds on all the dirt blocks.
Activity 3: Multiple Rows
Similar to Activity 2 now the Agent will do two rows of beets. Introducing nested loops (much like we did in Block 1 Lesson 5) and setting up the final function the students will need.
Activity 4: Planting Even More Rows
The students are presented with an 11x11 plot of dirt surrounded by the blue and white checker pattern. The students must piece together all the functions they’ve learned so far to fill this entire area with crops. The Agent should end on the gold block.
Ask the students about the skills that they have learned during the lesson, to reinforce the concepts.
1. Q. What is a Function?
A. Functions allow you to repeat code in a bit powerful way.
2. Q. Why is it important to take notes/ comment the code?
A. Comments help make the code more readable and understand what decisions were made and why by developers.
3 Q. What is On Player Walk?
A. Event trigger/handler.
4. Q. Name 1 coding concept and explain how it works.
A. The answers may vary.
Sign in with your Microsoft account and sign up for the Minecraft: Education Edition newsletter. We promise to respect your inbox.