Introduction to SCRATCH Blocks
TYPES OF BLOCKS
There are three main types of blocks in the Blocks Palette:
• Stack Blocks
These blocks have bumps on the bottom and/or notches on the top, such as
You can snap these blocks together into stacks. Some stack blocks have an input area inside them, where you can type a number, such as 10 in this block
or choose an item from a pull-down menu, such as pop in this block
Some stack blocks have a C-shaped 'mouth' where you can insert other stack blocks, such as
These blocks have rounded tops, such as
These blocks are placed at the tops of stacks. They wait for an event to happen, such as a key being pressed, then run the blocks underneath them.
These blocks are designed to fit in the input area of other blocks. Examples are:
Reporters with rounded ends report numbers or strings. Examples are:
These fit in blocks with rounded or rectangular holes such as:
Reporters with pointed ends report boolean values (true or false). An example is:
These fit inside blocks with pointed or rectangular holes such as
Click on any reporter block to see its current value.
Some reporter blocks have a check box next to them, such as
If you click in the check box, a monitor appears on the stage, displaying the current value of the reporter. As the value of the reporter changes, the monitor updates automatically.
A monitor can display the value of the reporter in several different formats:
a small readout with the name of the reporter
a large readout without any name
a slider that allows you to manipulate the value of the reporter (available only for variables)
Double-click or right-click on a monitor to change from one format to another.
The slider format is available only for user-created variables. Right-click on the monitor in slider format to adjust its minimum and maximum values.
You can create and manipulate lists in SCRATCH. Lists can store numbers as well as strings of letters and other characters.
To create a list, go to the Variables blocks category and click
Once you make a list, several list blocks will appear. The list blocks are described in the Block Descriptions section of this guide. When you create a list, a list monitor will appear on the stage. A list monitor shows all the items in a given list. You can type items directly into a list monitor.
At first the list will be empty, with length 0. To add to the list, click the + button on the bottom left of the list monitor. The length will increase by 1. Alternatively, you can add to the list using the list blocks:
You can resize the list monitor from the bottom right-hand corner.
Note: You can right-click (Mac: Ctrl+click) on a list monitor to export a list to a plain .txt file. You can also import any saved plain .txt files with values on separate lines.
Strings are made of letters, words, or other characters (e.g., apple; October 2009; You win!).
Strings can be stored in variables or lists such as:
You can join together strings using:
You can compare strings using the following blocks:
Strings are evaluated as 0 in mathematical operation blocks such as:
and in blocks that expect a number such as:
You can use the following to prompt a user to type in a response on the keyboard.
The response is stored in
The question appears on the screen and the program waits until the Enter key is pressed or the check mark is clicked.
The question appears in a voice balloon when used in a sprite.
The question appears at the bottom of the screen when used in the Stage.
is shared by all sprites (global) and is replaced each time
runs. If you want to save the current
you can store it in a variable or list.
Log in to save your progress and obtain a certificate in Alison’s free Scratch - Teach Computer Programming in Schools online course
Sign up to save your progress and obtain a certificate in Alison’s free Scratch - Teach Computer Programming in Schools online course
Please enter you email address and we will mail you a link to reset your password.