Lesson · with Voxel · Builder rank
Loop Awakening
Stop repeating yourself. Put the place-and-move blocks inside a repeat loop and build ten blocks with one command.
You need
- Minecraft Education
- A new flat creative world
- The printable mission sheet (optional)
Steps
Grab a loop
From Loops drag 'repeat 4 times' into your build command and change 4 to 10.
Move the blocks inside
Put 'agent place forward' and 'agent move forward by 1' inside the loop. Order matters: place first, then move.
Run and count
Type build. Count the blocks. Ten blocks from one command is the whole point of a loop.
Go square
Wrap your repeat 10 loop in a 'repeat 4 times' loop and add 'agent turn left' after the inner loop. You just built the outline of a room.
Build task
Cave Cleanup Crisis
Program the Agent to build the four walls of a 10 by 10 room using nested loops.
Finish line: A closed 10 × 10 outline built by one command.