block3_lesson5-554x368.jpg

We need beets!

8-10 yrs old

11-13 yrs old

Computer Science

Technology

Running Out of Time: We Need Beets! Creativity in Coding – Functions and Notes

favorite 3
Icon_Print Icon_Rework
avatar Submitted By: Minecraft Education

September 3, 2020

Skills

  • Creativity
  • Critical Thinking

Learning Objectives

  • Create programs that include sequences, events, loops, and conditionals. 1B-AP-10
  • Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process. 1B-AP-11
  • Modify, remix, or incorporate portions of an existing program into one's own work, to develop something new or add more advanced features. 1B-AP-12
  • Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended. 1B-AP-15
  • Describe choices made during program development using code comments, presentations, and demonstrations. 1B-AP-17

Guiding Ideas

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.

Coding objectives:

In this lesson the students will be introduced to Functions and a skill of commenting the code.

 

Student Activities

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.

Performance Expectations

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.

 

Skills

  • Creativity
  • Critical Thinking