Lesson 10: Looking Ahead with Minecraft

Overview

This lesson was originally created for the Hour of Code, alongside the Minecraft team. Students will get the chance to practice ideas that they have learned up to this point, as well as getting a sneak peek at conditionals!

Purpose

This set of puzzles will work to solidify and build on the knowledge of loops, and introduce conditionals. By pairing these two concepts together, students will be able to explore the potential for creating fun and innovative programs in a new and exciting environment.

Agenda

Warm Up (15 min)

Main Activity (30 min)

Wrap Up (15 min)

Extended Learning

View on Code Studio

Objectives

Students will be able to:

  • Define circumstances when certain parts of a program should run and when they shouldn't.
  • Determine whether a conditional is met based on criteria.

Preparation

  • Play through the lesson to find any potential problem areas for your class.
  • Make sure every student has a journal.

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the Students

Vocabulary

  • Condition - Something a program checks to see if it is true before allowing an action.
  • Conditionals - Statements that only run under certain conditions.

Support

Report a Bug

Teaching Guide

Warm Up (15 min)

Introduction

Gather the class together and ask two volunteers to walk straight in some direction in the classroom. If they encounter a chair out of place, they must step over it. If they reach a wall, they must sit down.

Once all of the students are sitting down, ask how you would program a robot to respond to a wall or a chair. Remind students that you cannot simply say "Step over chair" unless you know there is a chair, and you will not always know there is a chair. It might be helpful to translate the task into instructions like:

  • while there is a path ahead
    • walk forward
    • if there is a chair, step over it
  • sit down

Tell students they will be using conditionals during this lesson. Give the definition of:

  • Condition: A statement that a program checks to see if it is true or false. If true, an action is taken. Otherwise, the action is ignored.
  • Conditionals: Statements that only run under certain conditions.

Open up a discussion of when you might use a conditional in your code.

Main Activity (30 min)

Online Puzzles

Students are in for a real treat with this lesson. It's likely most of your students have heard of Minecraft, but give a brief introduction for those that may not know.

Minecraft is a game of cubes. You can play as Alex or Steve as you work through mazes. You'll need to avoid lava, pick up items, and explore in a world made up of cubes of things.

Demonstrate one of the puzzles to the class (we recommend puzzle 11.) Once all questions have been addressed, transition students to computers and let them start pair programming.

Wrap Up (15 min)

Journaling

Having students write about what they learned, why it’s useful, and how they feel about it can help solidify any knowledge they obtained today and build a review sheet for them to look to in the future.

Journal Prompts:

  • Draw a feeling face to show how you felt during today’s lesson.
  • Draw something else you could have built in this Minecraft world.
  • Can you draw a scene where someone is using a conditional?

Extended Learning

More Minecraft

If you find that your class really enjoys the Minecraft environment, here are some links to other Minecraft games they can play online. These games will also teach basic coding skills.

View on Code Studio

Student Instructions

“Hi, I’m Elsa of Arendelle, help me draw a shape.”

Draw a hexagon with 50 pixel long sides.


To draw a hexagon, you will need to: - move forward by 50 pixels - turn right by 60 degrees - repeat a total of 6 times

View on Code Studio

Student Instructions

“Good job!”

After your hexagon, turn right by 60 degrees, then draw a line that is 150 pixels long.

Finish by putting Elsa back to the center of the play area, using the jump to the middle center position block.

View on Code Studio

Student Instructions

“Let’s make a snowflake.”

To turn this code into a snowflake, nest all of the code inside of another repeat loop and run it a total of 6 times. You should only need to add one block.

View on Code Studio

Student Instructions

"Let's make our snowflakes special!"

Inspiration: Where do you need to add code if you want to draw a tiny square at the tip of each long line?


You can try whatever you want in this puzzle, but here is an idea:

Try making a tiny square at the end of each line - Each side should be 15 pixels long - You should turn by 90 degrees - Repeat those actions a total of 4 times

View on Code Studio

Student Instructions

"Try changing the shapes or the lengths of the lines to make this your own!"


Inspiration: You can change your drawing in any way you want, but here is an idea:

  • Try switching the types of shape in the middle of the snowflake with the one at the end of each line!
View on Code Studio

Student Instructions

"Let’s try something new. This time, skate in a zig-zag."


Inspiration: Try changing your long 150 pixel line into 6 short lines of 25 pixels

  • Turn by 45 degrees in alternate directions after each short line to get a zig-zag look
  • Where do you need to put a new repeat block to make this happen?
  • How many times do you have to repeat your pattern of 2 short lines to get 6 total?

Standards Alignment

View full course alignment

CSTA K-12 Computer Science Standards (2017)

AP - Algorithms & Programming
  • 1B-AP-10 - Create programs that include sequences, events, loops, and conditionals.

Cross-curricular Opportunities

This list represents opportunities in this lesson to support standards in other content areas.

Common Core English Language Arts Standards

L - Language
  • 5.L.6 - Acquire and use accurately grade-appropriate general academic and domain-specific words and phrases, including those that signal contrast, addition, and other logical relationships (e.g., however, although, nevertheless, similarly, moreover, in addition).
SL - Speaking & Listening
  • 5.SL.1 - Engage effectively in a range of collaborative discussions (one-on-one, in groups, and teacher-led) with diverse partners on grade 5 topics and texts, building on others’ ideas and expressing their own clearly.
  • 5.SL.1.a - Come to discussions prepared, having read or studied required material; explicitly draw on that preparation and other information known about the topic to explore ideas under discussion.
  • 5.SL.4 - Report on a topic or text or present an opinion, sequencing ideas logically and using appropriate facts and relevant, descriptive details to support main ideas or themes; speak clearly at an understandable pace.
  • 5.SL.6 - Adapt speech to a variety of contexts and tasks, using formal English when appropriate to task and situation.

Common Core Math Standards

MP - Math Practices
  • MP.1 - Make sense of problems and persevere in solving them
  • MP.2 - Reason abstractly and quantitatively
  • MP.4 - Model with mathematics
  • MP.5 - Use appropriate tools strategically
  • MP.6 - Attend to precision
  • MP.7 - Look for and make use of structure
  • MP.8 - Look for and express regularity in repeated reasoning
NBT - Number And Operations In Base Ten
  • 5.NBT.5 - Fluently multiply multi-digit whole numbers using the standard algorithm.

Next Generation Science Standards

ETS - Engineering in the Sciences
ETS1 - Engineering Design
  • 3-5-ETS1-1 - Define a simple design problem reflecting a need or a want that includes specified criteria for success and constraints on materials, time, or cost.