Independent project

In this lesson, you learned how organizing blocks of code into separate functions makes your code more readable and saves space. Functions generally contain sections of code that go together logically and accomplish one thing. The function’s name usually tells you what it does.

Functions can call other functions. Although functions in MakeCode do not accept parameters, you can use an ||player:on chat command|| block to pass in a parameter. You might pass in a number to affect what the function does. Also, you could update the value of an existing variable and then any function can access that.

Dream house

Now it’s your turn to practice using functions as you build something in Minecraft. One of the first things to do in Minecraft is build yourself a house. Your house can be decorated in different kinds of wood, use big windows to let in lots of natural light, or be dark and dungeony with traps to catch unwary visitors. It could have tall castle-like turrets, or go several levels underground and blend in with the natural landscape. You might also use the land around you to grow carrots and wheat to feed yourself and the animals around you. Your house, and the grounds around it, are a chance for you to express yourself.

For this independent project, build your dream house or build a replica of an actual building in Minecraft. Either way, use functions to automate creating as many different sections of the house as possible. You might start with creating a floor command that creates a floor by filling blocks in a square area at your feet. Or, you might have a carpeting agent that creates long carpet runners that run the length of your house. How about a builder that can create a farm for you automatically?

Project criteria

Come up with something original that meets the following criteria:

  • Creates, or helps to create, a building, temple, monument, or other piece of architecture in Minecraft
  • Provides at least three separate and distinct functions
  • Includes descriptive names that represent what each function does

Ideas

Some ideas for functions:

  • Create carpet.
  • Create the walls of a room.
  • Create a decorative fountain.
  • Create a castle turret.
  • Level an area of terrain so you have a flat place to build.
  • Create a swimming pool.
  • Build different levels for a garden or house.
  • Build a doorway.
  • Dig a basement.

Minecraft diary

Compose a diary entry addressing the following:

  • What did you decide to build? Why?
  • Describe each of your three functions and what each of them does.
  • What kinds of building tasks did you decide needed to be done by hand? Why?
  • Include at least one screenshot of your finished building or piece of architecture.

NOTE: If you decided to improve one of this lesson’s activities, please talk about the new code you wrote in addition to what was already provided in the lesson.

Assessment

Competency scores: 4, 3, 2, 1

Diary

4 = Minecraft Diary addresses all prompts.
3 = Minecraft Diary entry is missing 1 of the required prompts.
2 = Minecraft Diary entry is missing 2 or 3 of the required prompts.
1 = Minecraft Diary entry is missing 4 or more of the required prompts.

Project

Criteria

  • Creates, or helps to create, a building, temple, monument, or other piece of architecture in Minecraft
  • Provides at least three separate and distinct functions
  • Includes descriptive names that represent what each function does

Scoring

4 = Project addresses all required elements effectively and efficiently.
3 = Project is missing 1 of the required elements or is mostly effective and efficient.
2 = Project is missing 2 of the required elements or is somewhat ineffective and/or inefficient.
1 = Project is largely ineffective and/or inefficient.

Functions

Criteria

  • Creates, or helps to create, a building, temple, monument, or other piece of architecture in Minecraft
  • Provides at least three separate and distinct functions
  • Includes descriptive names that represent what each function does

Scoring

4 = At least three separate functions, logically separate and appropriately named.
3 = Two separate functions, logically separate and appropriately named.
2 = One function logically separate and appropriately named.
1 = No functions logically separate nor appropriately named.