Scratch Coding Blocks
Scratch Coding Blocks
Blocks are puzzle-piece shapes that are used to create code in Scratch. The blocks connect
to each other vertically like a jigsaw puzzle, where each block type has its own shape and its
own slot shape for it to be inserted into, which prevents syntax errors. Series of connected
blocks are called scripts.
Types of Blocks in Scratch
TYPE IMAGE FUNCTION
Command blocks have notches at the top and
Command bumps on the bottom.
Blocks They are also known as Stack blocks.
There are 62 Stack blocks.
These blocks are called “hats” blocks. Hat
blocks are the blocks that start every script.
They are shaped with a rounded top and a
Blocks which bump at the bottom so you can only place
link events with blocks below them.
the running of There are eight Hat blocks in the Scratch
the program editor, six of which are in the Events category,
one in the Control category, and one in the
category My Blocks (if one has created one
custom block).
These sets of blocks are known as C blocks. They
are blocks that take the shape of "C's". Also
Blocks which
known as "Wrap blocks", these blocks loop the
control the
blocks within the Cs or check if a condition is
running of the
true. There are five C blocks, and they can be
program
found in the Control category. C blocks can be
bumped at the bottom, or capped.
Boolean blocks are conditions — they are either
true or false. Think of them as "yes-no"
questions. For example, if you asked a computer
"does 2 + 2 = 4?", it would either tell you "True"
or "False". With a hexagonal shape, there are 14
of these blocks.
Blocks which
Reporter blocks are the values. Reporter blocks
report a certain
can hold numbers and strings. It is like asking a
value (function
friend, for example, "What is 2 + 2?", and they
blocks)
would answer "4". It can also report a variable.
For example, "What is your age?" and they may
answer: "15". Shaped with rounded edges, there
are 34 of these blocks — not counting the
theoretically infinite amount of Reporter blocks
that can be made for each variable and list.
BLOCK CATEGORIES
MOTION BLOCKS - Code blocks that control sprite placement, direction, rotation, and
movement.
A command block that tells a sprite or character to
move forward 10 steps in the direction it's facing.
The number inside the parentheses can be changed to
control the distance the sprite moves.
A positive number makes it move forward, while a
negative number makes it move backward.
This block is used to control the rotation of sprites. It's a
command that tells a sprite to rotate clockwise by 15
degrees.
This block rotates the sprite based on its current
direction. When this block is executed, it instructs the
sprite to rotate counterclockwise by 15 degrees
This block moves the sprite to a randomly selected
position on the stage. When this block is executed, the
sprite's position is instantly changed to a new location
chosen randomly within the boundaries of the stage.
A motion block that moves the sprite to a specific
position on the stage with coordinates (0, 0).
A block that smoothly moves the sprite to a randomly
selected position on the stage over a specified duration
of time, which in this case is 1 second.
A motion block that smoothly moves the sprite to a
specific position on the stage with coordinates (0, 0) over
a duration of 1 second.
This block sets the direction the sprite is facing to an
exact angle. For example, "Point in direction (90)" would
make the sprite face to the right.