The blocks are designed in different shapes, each indicating one data type. The blocks can be connected to each other vertically like a jigsaw puzzle. Program (or scripts) in mBlock 5 are compiled by connecting different types of blocks vertically like a jigsaw puzzle. mBlock 5 provides blocks of five shapes, as described in the following:

  • Hat blocks
  • Stack blocks
  • Reporter blocks
  • Boolean blocks
  • Cap blocks

1. Hat blocks

A hat block is used to start a script and is always placed on the top of other blocks. Generally, a hat block looks like the following.
Block Shapes - 图1
Each hat block uses its own way to activate a script, and therefore scripts can be executed separately at different time points.


2. Stack blocks

A stack block is a rectangular block that can fit on or under other blocks, with a notch at the top and a bump on the bottom. Generally, a stack block looks like the following.
Block Shapes - 图2
Stack blocks are used to execute the main commands, and therefore are the majority among all the blocks.


3. Reporter blocks

Each reporter block contains a value that can be a numerical value or character string. Generally, a reporter block looks like the following.
Block Shapes - 图3
A reporter block can be used in any script that requires data but can’t be used independently. A reporter block can be fit into another block as long as the slots fit.


4. Boolean blocks

A boolean block contains a condition, which can be either “true” or “false”. Generally, a boolean block is an elongated hexagon as shown in the following.
Block Shapes - 图4
A boolean block must be put into the hexagonal slot of another block. It can’t be used independently.


5. Cap blocks

A cap block ends a script or project. It can be put only under all blocks. Generally, a reporter block looks like the following.
Block Shapes - 图5