Page 19 - Touchcode_C7_Flipbook
P. 19
Coding in Minecraft
To create and initialize a variable
You can create and initialize a variable in minecraft, by using the following blocks:
To find the square of a number
You can find the square of a number in minecraft, by using the following blocks:
Blocks:
Make a variable: To create a variable.
On start: An event that runs when the program starts and all the blocks
are placed inside it.
Say: Posts a message to the game chat.
Multiplication block: To perform the multiplication operation.
Set Num1 to 0: Assign (set) a variable’s value.
Change a to 10: Change a variable’s value.
Coding in Minecraft 17

