2_resized-554x368.png

Python 101 - Lesson 2

11-13 yrs old

14-18 yrs old

Computer Science

Technology

LOCATION, LOCATION, LOCATION... Parameters and coordinates

10
avatar Submitted By: Minecraft Education

September 8, 2020

Skills

  • Creativity
  • Critical Thinking

Learning Objectives

  • Decompose (break down) the steps needed to solve a problem into a precise sequence of instructions. 1A-AP-11
  • Compare and refine multiple algorithms for the same task and determine which is the most appropriate. 1B-AP-08
  • Systematically test and refine programs using a range of test cases. 2-AP-17

Guiding Ideas

Tell the students that they need to help Coding Mine with their new project to expand their office space. They are working with engineers to make this happen, however, CodingMine is also developing software to make the construction process easier. This software will automatically place blocks in the desired locations. The students need to write down Minecraft Python commands to place blocks in the right locations in a three-dimensional space and find the most efficient way to construct objects.

Student Activities

Coding concepts:

- Commands inside commands

- Relative position

User interface. In this lesson the students will:

- use commands by dragging and dropping them into the coding window.

- edit commands placed in the coding window.

- use the code completion tool to select correct block names.

Syntax/ Operators: commas command_group.command_name(parameter1, parameter2, parameter3)

Coding activities: (30 min)

1. Activity 1: Place the correct block.

Objective: Explain to the students that the programmer needs their help to develop software that is going to place specific block types on the marked areas. They will be doing this by using the place block at position command from the block tab. In this command they will be changing the first parameter (block) to place the desired block type. They do not need to change the second parameter, position of the block; it should be on its default setting (0, 0, 0).

2. Activity 2: All of the lights.

Explain to the students that the electrical engineer needs their help to place ceiling lights at different heights. They will be doing this by changing the second coordinate of the second parameter in the place block at position command. Tell the students that to determine the required heights more easily, measuring scales have been placed next to each of the designated areas and they should refer to these when coding.

3. Activity 3: One step at a time.

Explain to the students that the construction engineer wants their help to complete a set of stairs. The students will be constructing these stairs by using the second and third coordinate of the place block at position command.

4. Activity 4: Getting across

Explain to the students that the next construction engineer wants their help to complete the floor of the hallway. They will be constructing this floor by using negative numbers in the first and second coordinate of the place block at position command.

 

Performance Expectations

Ask the students about the skills that they have learned during the lesson, to reinforce the concepts.

Q. What command do we use if we want to place a block in a relative position?

A. The place block at position command.

Q. What is a relative position, relative to?

A. It is relative to the player’s position in Minecraft.

Q. Are coordinates written in quotes?

A. No, because coordinates are a numerical value.

Q. Look at the code: blocks.place( BRICKS, pos(0, -1, 0) ).

A. Where is the bricks block placed.

Skills

  • Creativity
  • Critical Thinking