Course review

Here is a short review of the topics and concepts we have covered so far in the course:

Lessons

1 - Events

Code is triggered by events that happen as a result of player actions. An Event Handler listens for different things to happen in the game, and then runs the code associated with it. The code you write for Minecraft is triggered by events such as ‘on player walk’, or chat commands to call functions that you’ve created.

2 - Coordinates

Your position in the Minecraft world is indicated by three coordinates corresponding to your position in three-dimensional space. Coordinate positions can be specified as absolute (independent of your position) or relative (in relation to your current position). Many MakeCode blocks use coordinates to specify a location in Minecraft.

3 - Variables

A variable is used to store information in memory. Variables can be different data types: numbers, text, booleans, or positions. You can change the value of a variable or cause other events to occur based on a variable’s value. You can also pass a variable in as a parameter to a chat command.

4 - Iteration

Iteration, or loops tell MakeCode to repeat instructions a certain number of times, or while a certain condition is true. You can nest one loop inside of another loop, to create more complex repetitions. The Agent is your friend who can carry out instructions for you in Minecraft.

5 - Conditionals

A conditional statement only runs if a certain condition or conditions are true. Using ‘if… then… else’ blocks allow you to check whether a given condition is true, and if so, execute some code, otherwise execute a different set of instructions. You can also check for the opposite of a given condition using the Logical ‘Not’ block.

6 - Functions

Functions are groups of instructions that accomplish something specific. Once you have defined a function you can refer to that group of instructions simply by its name, and those instructions will run. Just reading the function names makes it easier to see the big picture in a complex program. Hiding the individual instructions in favor of a more general name that describes what they do is an example of abstraction.

7 - Arrays

An array is a convenient way to keep track of objects. You can store things in an array, and retrieve them as needed, in any order. You can store numbers, text, positions, even animals and different Minecraft blocks in an array. When you don’t know ahead of time how many instances of objects you will need to store, arrays are helpful because you can keep adding new objects to the end.

8 - Artificial Intelligence

The field of artificial intelligence, or AI, is growing rapidly and offers lots of opportunities for problem solving. AI can help your Agent adapt to different situations in the Minecraft world, and can allow you to write code for many different possible scenarios. AI can be used to create complex structures, or to navigate existing ones. AI is one very popular way that coding and programming are being used in the world today.