From Test-Scratch-Wiki

Translate: - English - Türkçe 
This article or section documents an outdated version of Scratch (version 1.4). For this article in Scratch 2.0, see Eng:Blocks (2.0).

Blocks are puzzle-piece shapes that are used to create code in Scratch. The blocks connect to each other like a jigsaw puzzle, where each data type (event, command, reported value, reported boolean, or script end) has its own shape and a specially shaped slot for it to be inserted into — this prevents syntax errors. Series of connected blocks are called scripts.

There are ten categories of blocks: Control, Motion, Looks, Sound, Pen, Sensing, Operators, Variables, List and Motor (although there are some other categories and blocks in some Scratch modifications). Only eight are shown at the top.

In total, there are four hat blocks, six C blocks, twenty-six reporter blocks, thirteen Boolean blocks, two cap blocks and seventy-five stack blocks.

Block Shapes

There are six different block shapes: Hat, Stack, Boolean, Reporter, C and Cap.

Hat blocks

Main article: Hat Block
The shape of a Hat block.

Hat blocks are the blocks that start every script. They are shaped with a rounded top and a bump at the bottom — this is so you can only place blocks below them. There are four Hat blocks, and they can be found in the Control category.

Stack blocks

Main article: Stack Block
The shape of a Stack block.

Stack blocks are the blocks that perform the main commands. They are shaped with a notch at the top and a bump on the bottom — this is so blocks can be placed above and below them. There are 75 Stack blocks — the most common block shape.

Boolean blocks

Main article: Boolean Block
The shape of a Boolean block.

Boolean blocks are the conditions — they are either true or false. It is like asking your friend: "Does 2 + 2 = 4?", and they would either tell you "Yes" or "No". With a hexagonal shape, there are 13 of these blocks.

Reporter blocks

Main article: Reporter Block
The shape of a Reporter block.

Reporter blocks are the values. Reporter blocks can hold numbers and strings. It is like asking a friend, for example, "What is 2 + 2?", and they would answer "4". It isn't just equations however, it can report a variable, for example, "What is your age?". They may answer: "15". Shaped with rounded edges, there are 26 of these blocks — not counting the theoretically infinite amount of Reporter blocks that can be made for each variable and list.

C blocks

Main article: C Block
The shape of one of the C blocks.

C blocks are blocks that are made up of "C's". Also known as "Wrap blocks", these blocks loop the blocks within the Cs or check if a condition is true. There are six C blocks, and they can be found in the Control category. C blocks can be bumped at the bottom, or capped.

Cap blocks

Main article: Cap Block
The shape of a Cap block.

Cap blocks are the blocks that stop scripts. They are shaped with a notch at the top and a flat bottom — this is so you cannot place any blocks below them. There are two Cap blocks, and they can both be found in the Control category.

List of Blocks

There are 128 blocks in Scratch 1.4.

Control blocks

Main article: Control Blocks


Control blocks are the blocks that control scripts. There are 16 Control blocks in Scratch 1.4.

Scratch 1.4 has the following four Control Hat blocks:

Scratch 1.4 has the following four Control Stack blocks:

Scratch 1.4 has the following six Control C blocks:

  • Forever — A loop that will never end.
  • Repeat () — A loop that repeats the specified amount of times.
  • Forever If () — A loop that will always check the condition, like putting an If () block inside a Forever block.
  • If () — Checks the condition so that if the condition is true, the blocks inside it will activate.
  • If (), Else — Checks the condition so that if the condition is true, the blocks inside the first C will activate and if the condition is false, the blocks inside the second C will activate.
  • Repeat Until () — A loop that will stop once the condition is true.

Scratch 1.4 has the following two Control Cap blocks:

  • Stop Script — Stops the script.
  • Stop All — Stops all scripts throughout the Scratch program.

Trigger blocks

In the Experimental Viewer, all of the Hat Blocks and Broadcast blocks are in this section.

Motion blocks

Main article: Motion Blocks


Motion blocks are the blocks that control a sprite's movement. There are 16 Motion blocks in Scratch 1.4.

Scratch 1.4 has the following thirteen Motion Stack blocks:

Scratch 1.4 has the following three Motion Reporter blocks:

Motor blocks

Main article: Motor Blocks


Motor blocks are extra Motion blocks that are used with the LEGO Education WeDo Robotics Kit. There are five of these blocks, and they are only available in Scratch 1.4.

Scratch 1.4 has the following five Motor Stack blocks:

Looks blocks

Main article: Looks Blocks


Looks blocks are the blocks that control a sprite's look. There are 20 Looks blocks in Scratch 1.4. Three of the 17 sprite Looks blocks have their stage analog.

Scratch 1.4 has the following seventeen Looks Stack blocks:

Scratch 1.4 has the following three Looks Reporter blocks:

Sound blocks

Main article: Sound Blocks


Sound blocks are the blocks that control sound and MIDI functions. There are 13 Sound blocks in Scratch 1.4.

Scratch 1.4 has the following eleven Sound Stack blocks:

Scratch 1.4 has the following two Sound Reporter blocks:

Pen blocks

Main article: Pen Blocks


Pen blocks are the blocks that control the pen. There are 11 Pen blocks in Scratch 1.4. Scratch 2.0 will probably have 12 or 16 of these blocks.

Scratch 1.4 has the following eleven Pen Stack blocks:

Scratch Day pre-alpha of Scratch 2.0 has following one new Pen Stack block:

  • Stamp Transparent () Pens the sprite's image on the screen at the transparency of the amount in the block. Can be removed using clear.

Sensing blocks

Main article: Sensing Blocks


Sensing blocks are the blocks that detect things. There are 17 Sensing blocks in Scratch 1.4.

Scratch 1.4 has the following two Sensing Stack blocks:

Scratch 1.4 has the following seven Sensing Boolean blocks:

  • Touching ()? — The condition for checking if the sprite is touching the mouse-pointer or another sprite.
  • Touching Color ()? — The condition for checking if the sprite is touching a specific color.
  • Color () is Touching ()? — The condition for checking if a color on the sprite is touching a specific color.
  • Mouse Down? — The condition for checking if the mouse is down.
  • Key () Pressed? — The condition for checking if the specified key is being pressed.
  • Loud? — The condition for checking if the microphone input is loud.
  • Sensor () — The condition for checking various input on a Sensor Board.

Scratch 1.4 has the following eight Sensing Reporter blocks:

  • Answer — The most recent input with the Ask () And Wait block.
  • Mouse X — The mouse-pointer's X position.
  • Mouse Y — The mouse-pointer's Y position.
  • Distance to () — The distance from the sprite to the mouse-pointer or another sprite.
  • Timer — How much time has passed since the Scratch program was opened or the timer reset.
  • () of () — The X position, Y position, direction, costume, size or volume of the Stage or a sprite.
  • Loudness — How loud the noise is that the microphone is sensing.
  • () Sensor Value — Various values for things with a Sensor Board — and other Scratch programs' variables with Mesh.

Operators blocks

Main article: Operators Blocks


Operators blocks are the blocks that perform math functions and string handling. There are 17 Operators blocks in Scratch 1.4.

Scratch 1.4 has the following six Operators Boolean blocks:

  • () < () — The condition for checking if a value is less than the other.
  • () = () — The condition for checking if two values are equal.
  • () > () — The condition for checking if a value is greater than the other.
  • () and () — Joins two conditions.
  • () or () — Joins two conditions, but they function separately.
  • Not () — Makes the condition checked if it is false, not true.

Scratch 1.4 has the following eleven Operators Reporter blocks:

  • () + () — The value of the addition.
  • () — () — The value of the subtraction.
  • () * () — The value of the multiplication.
  • () / () — The value of the division.
  • Pick Random () to () — Picks a random number between the two limits.
  • Join ()() — The two values put right next to each other.
  • Letter () of () — The specified character of the value.
  • Length of () — The length of the value.
  • () Mod () — The remainder of the division.
  • Round () — Rounds the value to the nearest whole number.
  • () of () — The absolute value (abs), square root (sqrt), sine (sin), cosine (cos), tangent (tan), asine (asin), acosine (acos), atangent (atan), natural logarithm (ln), logarithm (log), exponential function (e^), or base 10 exponential function (10^) of a specified value.

Right clicking some of the blocks will yield more choices of its type.

Variables blocks

Main article: Variables Blocks


Variables blocks are the blocks that hold values and strings. There are 5 Variables blocks in Scratch 1.4.

Scratch 1.4 has the following four Variables Stack blocks:

Scratch 1.4 has the following Variables Reporter block:

  • () — The variable's value.

List Blocks

Main article: List Blocks


List blocks are the blocks that manage lists. They are stored in the Variables category. There are eight List blocks in Scratch 1.4.

Scratch 1.4 has the following four List Stack blocks:

  • Add () to () — Adds an item to the list (the item goes at the bottom of the list of items) with the specified content in it.
  • Delete () of () — Deletes the item of the list.
  • Insert () at () of () — Adds an item to the list (the item goes where you specify in the list of items) with the specified content in it.
  • Replace Item () of () With () — Replaces the item's content with the specified content.

Scratch 1.4 has the following 3 List Reporter blocks:

Scratch 1.4 has the following List Boolean block:

  • () Contains () — The condition for checking if an item's content is the specified text.

Scratch Block Plugin

Main article: Block Plugin


The Scratch Block Plugin allows blocks and scripts to be used in the Scratch Forums and Scratch Wiki, as well as other sites with the included Javascript. They look like this:

when flag clicked
go to x: (0) y: (0) // center the sprite for the first stamp
stamp
forever
go to x: (pick random (-240) to (240)) y: (0)
stamp
wait (0.2) secs
change [color v] effect by (pick random (5) to (14))

These blocks were put in place on 27 January 2012 by JSO, a Community Moderator on the Scratch Forums. They were made to replace the "ancient" forum blocks, which have not been updated since the release of Scratch 1.2.