
- Type
- Lesson plan
- Subject
- Computer Science & Coding
- Topics
- Computer Science
- Ages
- Ages 11-18
- Duration
- about 60 min (suggested)
How can writing reusable functions with parameters and return values help us solve complex programming problems efficiently?
Overview
In this lesson, students explore the Kingdom of the Floating Islands while learning foundational computer science concepts in Python. The core focus is on functions, which act as reusable mini-programs within a larger codebase. Learners discover how to encapsulate instructions, pass data into functions using parameters, receive values back with return statements, and break larger engineering problems into manageable algorithmic steps through decomposition and logical sequencing.
Students partner with their in-game Agent to execute tasks they could not accomplish alone. Navigating through Island 5, students write Python code across four distinct challenges: building supporting towers, operating a light translator, handling bouncing mechanics, and wiring a power linkup to connect a telescope. The lesson culminates when students report their completed work to the Prime Minister in the parliament building.
Learning objectives
By the end of this lesson students will be able to:
- Define custom Python functions to execute repeatable sets of instructions with the Agent
- Pass data into functions using parameters and send values back using return statements
- Apply problem decomposition to break island repair tasks into sequential coding steps
- Explain the role of events and ordered sequencing in controlling Agent actions in Minecraft
Blocks and items used in this lesson
Key vocabulary
- Function
- A named block of reusable code designed to perform a specific task when called.
- Parameter
- A variable in a function definition used to receive information passed into the function.
- Return Statement
- A command that exits a function and sends data back to the part of the program that called it.
- Decomposition
- The process of breaking a complex problem down into smaller, easier-to-manage parts.
- Sequencing
- Arranging coding instructions in a precise step-by-step order so the computer executes them correctly.
- Event
- An action or occurrence detected by a program that can trigger a specific block of code to run.
Before class
Lesson sequence
Suggested timing: about 60 minutes in total.
- Introduction and Review10 min
Introduce the setting of the Kingdom of the Floating Islands and explain that Island 5 builds directly on skills learned in Island 4. Discuss why programmers use functions rather than writing duplicate code. Introduce key terms such as parameters, return statements, and decomposition.
- Coding Tasks 1 and 220 min
Direct students to launch the world and access their Python notebooks. Guide them through Activity 1 (Supporting towers) to construct structural supports with the Agent, followed by Activity 2 (Light translator) where they use functions to process and translate light signals.
- Coding Tasks 3 and 420 min
Have students advance to Activity 3 (Bouncing) to program movement routines, and Activity 4 (Power linkup) to establish the electrical connection required for the island telescope. Encourage students to check their function sequencing and parameter values if their Agent encounters errors.
- World Completion and Wrap-up10 min
Once the telescope power linkup is complete, instruct students to enter the parliament building and speak with the Prime Minister to finish the world. Conclude with a brief class discussion reflecting on how functions simplified their Agent scripts.
Assessment: success criteria
- The student defines working Python functions that accept parameters and run without syntax errors.
- The student successfully commands the Agent to finish the Supporting towers, Light translator, Bouncing, and Power linkup activities.
- The student connects the telescope and talks with the Prime Minister in the parliament building to complete the world.
Differentiation
Provide a template showing the basic syntax of a Python function definition with blank spaces for function names and parameters.
Challenge students to refactor their solution scripts to use fewer total lines of code by combining repetitive movements into generalized helper functions.
Knowledge check
5 questions to check understanding after the lesson. Tap an answer to see if it is right; the score appears at the end.
1What is the primary role of a function in Python?
Answer: B. Functions act as mini-programs that can be run repeatedly throughout a program without rewriting the code.
2What mechanism allows a programmer to pass specific information into a function?
Answer: A. Parameters are defined in a function signature to receive input data that the function needs to operate.
3What does a return statement do inside a Python function?
Answer: C. A return statement ends function execution and delivers a calculated value or status back to the parent code.
4Which computational thinking concept involves breaking a complex task into smaller, manageable parts for the Agent?
Answer: B. Decomposition is the practice of breaking down large problems into simpler, codable tasks.
5What final action indicates the complete conclusion of the Island 5 world?
Answer: C. After the telescope has been hooked up in Activity 4, visiting and speaking with the Prime Minister officially completes the world.
Resources
Part of the Python Island curriculum
This is lesson 5 of 6 in Python Island.
Frequently Asked Questions
Do students need to complete Island 4 before starting this lesson?
Yes, Island 5 directly builds upon the Python concepts and Agent mechanics taught in Island 4. Prior experience with basic Agent commands is strongly recommended.
How do students verify that the final coding task is finished?
After completing the power linkup in Activity 4 to connect the telescope, students must enter the parliament building and speak to the Prime Minister to finish the world.
Adapted from Island 5 by Minecraft Education on Minecraft Education, last updated Mar 19, 2025. This classroom version, the timings and the quiz were written by 9Minecraft Education.




















