WorksheetsFinal Exam: Minecraft Education Microsoft MakeCode(Block Coding)
Total questions: 50
Worksheet time: 50mins
What is the purpose of an event in coding?
To store data for later use
To trigger a piece of code when something happens
To repeat a sequence of actions indefinitely
To define a function
Which of the following is an example of a variable?
"move forward"
10
set player Score to 100
teleport (10, 20, 30)
What is the main purpose of a loop in programming?
To execute a sequence of code multiple times
To make decisions based on conditions
To store different types of values
To detect player movements
Which type of loop runs an unknown number of times until a condition is met?
Repeat Loop
For Loop
While Loop
Forever Loop
Which of the following best describes an algorithm?
A sequence of steps to solve a problem
A loop that runs indefinitely
A special function in MakeCode
A set of conditions in an "if" statement
Which of the following is an example of a Boolean variable?
"PlayerName"
10
True
[1, 2, 3, 4]
Which of the following is a valid condition in an "if" statement?
if x = 5
if x
if (5 + 3)
if "hello"
What happens if an array index is out of range?
The program ignores it
The program crashes or returns an error
The value at index 0 is returned
A new value is automatically inserted
Which event block is best for detecting when a player moves forward?
On chat command
On player walked
If statement
While loop
What will happen if you forget to update a loop variable inside a while loop?
The loop will run indefinitely
The loop will execute only once
The loop will not run at all
The program will crash immediately
Your Agent needs to collect 10 blocks of stone, but you don’t know how far away they are.
What should you do?
Use a Repeat loop (10 times)
Use a While loop checking if stone is in front
Use a For loop
Use an If statement
You are programming a teleportation system where a player moves to a safe zone (x: 100, y: 50, z: 100) when they type "safe".
Which block should you use?
On chat command “safe” → teleport player to (100, 50, 100)
Forever loop → teleport player to (100, 50, 100)
If-Else statement → teleport player when near (100, 50, 100)
Repeat loop → teleport player 10 times
In a game, a player needs to open a door when they step on a pressure plate at (10, 5, 10).
What condition should you check?
If player's x = 10 and y = 5 and z = 10, then open door
If player's y > 10, then open door
If player types “open”, then open door
Use a loop to check if the door is closed
You want your Agent to move forward until it reaches a block of diamond.
Which approach is best?
Use a While loop checking if the block ahead is NOT diamond
Use a Repeat loop (10 times)
Use a Forever loop
Use an If statement
Your Agent needs to collect all gold blocks in a line, but it should stop if it finds a stone block.
Which condition should you use?
If block ahead = gold, move forward and collect
If block ahead = stone, stop moving
While block ahead is NOT stone, move forward and collect
Repeat 100 times: collect block
You need to store the names of 5 players in a game. What should you use?
A variable
An array
A function
A loop
A player types "weather" in chat, and the program should say "It’s sunny" if it’s day and "It’s dark" if it’s night.
What should you use?
If time = day, say "It’s sunny", else say "It’s dark"
Repeat 10 times: say "It’s sunny"
While loop checking if player is inside
Variable time = "sunny"
A function "spawnTree()" places a tree at a given location.
How do you use it to plant 10 trees along a path?
Repeat loop (10 times) → Call spawnTree() each time
If player walks, call spawnTree()
While loop checking if trees exist
Set tree = "10"
You are programming a countdown timer for a game that decreases every second.
What should you use?
A variable and a loop decreasing it by 1 each second
A function returning "countdown"
A teleport command
An If statement
You need to track a player's score, which increases by 5 points every time they jump.
What should you use?
Variable "score" and event "on jump"
Forever loop adding 5 to score
While loop tracking movement
If "jump" then set score = 5
A player must collect 5 different colored wool blocks and store them.
Which data structure is best?
A single variable
An array
A function
A loop
An Agent needs to place 20 blocks in a row, but only every third space.
What loop structure works best?
Repeat loop with step value of 3
While loop checking block position
Forever loop
If statement without a loop
You need to create a function that returns a player's current coordinates.
How do you define it?
Function getPosition() → return (x, y, z)
Function teleport()
If loop checking coordinates
While loop
Which block is best for checking if a player is touching lava and teleporting them away?
If player on block "lava", then teleport
Forever loop checking coordinates
Repeat loop
Variable "lava"
A loop that counts from 1 to 10 and prints each number should use:
A For loop (1 to 10)
An If-Else statement
A Forever loop
A variable
A game should stop when the player reaches a specific checkpoint at coordinate (50, 20, 50).
What should you check?
If x = 50 AND y = 20 AND z = 50, then end game
If player moves, then stop
Repeat loop until player types "end"
While time > 0, stop
You want to create a delay of 2 seconds between each step of a loop.
What should you use?
Pause block inside the loop
Repeat 2 times then wait
A Forever loop
If-Else condition
Which coordinate represents the player's vertical position?
X
Y
Z
W
What is the purpose of a function in MakeCode?
To move the Agent
To store multiple values
To group reusable blocks of code
To change the player's speed
Which of these is an example of an event block in MakeCode?
Repeat (10 times)
On player chat command
If condition
Array index
Which of these statements correctly uses an If condition?
If x = 10, then move player
If loop repeats 10 times
If teleport to (10, 20, 30)
If player sets a variable
What data type does a Boolean variable store?
A number
A list of items
A function
True or False
What happens if you use an If condition without an Else statement?
The program crashes
The code runs only if the condition is true
The code loops forever
The If block runs every time
A player wants to teleport to a safe location if their health drops below 5.
What should you use?
If player health < 5, teleport to (10, 20, 30)
Repeat loop to check player health
Forever loop setting player health to 10
Function returning player health
You are creating a farming system where crops grow faster at night.
How should you check for nighttime?
If world time > 12000, grow crops faster
Repeat loop checking daylight
While loop checking player movement
If player places a torch
A game should end when a player collects 5 diamonds.
What should you use?
If diamonds = 5, then end game
Repeat loop checking player inventory
While loop setting game over
If time > 1000
A command "dig" should make the Agent dig forward until it hits stone.
What condition should you check?
While block ahead ≠ stone, move forward and dig
Repeat 10 times: dig forward
Forever loop breaking blocks
If block ahead = dirt, dig
You want to track the number of times a player jumps.
What should you use?
Variable "jumps" + event "on player jump"
Repeat loop checking air movement
While loop tracking player
If-Else checking altitude
A player wants to create a door that only opens if they are holding a specific key item (gold nugget). What condition should you use?
If player inventory contains "gold nugget", open door
While holding item, repeat "open door"
Forever loop checking player inventory
Repeat loop setting inventory to "gold nugget"
A player needs to build a 10-block high tower.
What is the best way to do this?
Repeat loop (10 times) → Place block → Move up
Forever loop → Place block
If condition checking height → Place block
Set variable "tower" = 10
A function "createWall()" should build a wall only if there is empty space ahead.
What is the best approach?
If block ahead = air, then run createWall()
Repeat loop placing wall
While loop checking space ahead
If player moves, place wall
You are creating a function "spawnAnimals()" that spawns 5 cows and 3 pigs.
How should you implement it?
Use a Repeat loop (5 times) to spawn cows, then another Repeat loop (3 times) to spawn pigs
While loop checking animal count
While loop checking animal count
Forever loop creating animals
A player wants a teleportation pad that activates only when they step on a specific block (emerald block).
What should you use?
If player on block "emerald block", teleport
Repeat loop checking player position
Forever loop setting position
Variable checking teleportation
A game gives players points every time they destroy a tree.
What is the best way to track their score?
Variable "score" + event "on tree destroyed"
Repeat loop adding 1 to score
If-Else statement updating score
Forever loop setting score to 10
An Agent should place blocks in a staircase pattern.
What is the best approach?
Repeat loop → Place block → Move forward → Move up
While loop checking height
If-Else statement inside a loop
Forever loop placing blocks
A game should display "You Win!" when a player reaches level 10.
What should you use?
If player level = 10, then display "You Win!"
Forever loop displaying text
While loop tracking level
Repeat loop setting level
A function "rainbowRoad()" should place colored wool blocks in order (red, orange, yellow, green, blue, purple).
What is the best way to store these colors?
Use an array [red, orange, yellow, green, blue, purple]
Create a separate function for each color
Use a loop without storing colors
Set a variable to "rainbow"
A game should randomly choose a prize for the player.
What data structure should you use?
An array of prizes, selecting a random index
A variable storing the prize
A Repeat loop generating prizes
An If statement assigning prizes
A game should stop if a player runs out of health.
What is the best condition to check?
If player health = 0, then end game
Repeat loop setting health
While loop tracking health
If player jumps, end game
You want to create a timer that decreases every second until it reaches 0.
What is the best way to do this?
Variable "timer" starting at a value → Repeat loop decreasing it by 1 every second
Forever loop setting timer to 0
If-Else statement tracking time
Set Variable “timer” and set a starting value, While loop decreasing timer by 1 every second by checking timer is more than 0
