Beginner Coding with Blocks
Chapter
>
Level

Variables and Data
Number Variables

Objective

Collect planks and bricks and store into variables in order to complete level.

The storehouse is a mess, help pick up all these bricks and planks scattered about.

To store materials easier you need to use variables, a variable is a name you can assign a value which you can use to more easily address it later on.

After collecting all materials, create a variable named planks using the set variable block and set it to the number of planks you've gathered (7). Do the same thing for bricks, create a variable named bricks and set it to the number of bricks you've gathered (6).

Use the set variable block to create and assign values to variables. Connect a number block to set the value.

Remember, the number you assign is the number of each you've picked up, this is done after you've picked up all planks and bricks.

Code book