Professional Documents
Culture Documents
Chapter 7
Scratch
• Interactive graphic based programming language.
• A Scratch project is primarily a program file that contains blocks
known as Scripts.
• These projects are saved with the extension *.sb2
Types of Blocks
Based on the uses, there are 6 types of Scratch blocks.
• Hat blocks
• Cap blocks
• Stack blocks
• Reporter blocks
• Conditional blocks
• Looping blocks
Hat block
• The block that shows the beginning of the script.
• They are shaped like a hat.
• Therefore, no block can be placed on top of it.
• All the Hat blocks are present either in Control blocks, Events blocks
or More blocks.
Cap Blocks
• Blocks that are used to stop the execution of a script or a project.
• No block can be added beneath them.
Stack Blocks
• Blocks comes with a notch on the top and the bottom.
• Therefore, can be kept one over another.
Reporter Blocks
• Reports value.
• Used whenever a script needs a certain value.
• The value can be a number or a string.
• It can also in the form of numbers or values from the drop-downs.
Conditional Blocks
• This block used whenever the flow of execution needs to be changed
based on a condition.
• Any label that says ‘if’ , ‘when’ or ‘until’, it’s a conditional block.
Looping Blocks
• Blocks that can be used to repeat a set of blocks N number of times
based on a condition.
• Any label that begins with ‘forever’ or ‘repeat’ is a looping block.
Repeat block
• Used to repeat the blocks within the loop specified number of times.
Forever block
• Used to repeat the blocks within it repeatedly.
• Primarily used in creating games.
Block Categories.
Blocks can be categorised into various types.
• Control blocks
• Sensing blocks
• Variable blocks
Control blocks
• Used to control the execution of the script.
• Golden in colour.
• There are 11 control blocks.
Hat Block Control Block
Variable blocks
• This block is available under Data block.
• Comes under two categories. Variables and lists.
Blocks related to Variables Blocks related to Lists
It works for the variable Num. The above work for the list students.