SandCastleIcon.png This article has links to websites or programs outside of Scratch and Wikipedia. Remember to stay safe while using the internet, as we cannot guarantee the safety of other websites.
Archive.png This article or section documents something not included in the current version of Scratch (3.0). It is only useful from a historical perspective.
This article or section documents an outdated version of Scratch (version 2.0). For this article in the current version (version 3.0), see Blocks (3.0). For this article in Scratch 1.4, see Blocks (1.4).
when gf clicked
move (10) steps
say [Hello!] for (2) secs
forever
    if <<(score:: variables) > [50]> and <touching [mouse-pointer v]?>> then
        dance for (2) seconds:: custom
        broadcast [Win v]
        play sound [Cheer v] until done
        repeat (100)
            turn [motor v] on for (2) secs:: extension
            change [pitch v] by (1)
        end
    end
end
An example of a script in Scratch 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 which prevent syntax errors. Series of connected blocks are called scripts.

In Scratch 2.0, there were twelve categories of blocks: motion, looks, sound, pen, variables, list, events, control, sensing, operators, more blocks, PicoBoard, and LEGO Education WeDo 2.0 (although there were some other categories and blocks in some Scratch modifications). Only ten of these were shown in the Block Palette.

In total, there were eleven Hat Blocks, five C Blocks, thirty-seven Reporter Blocks, thirteen Boolean Blocks, two Cap Blocks and seventy-seven Stack Blocks.

Block Shapes

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

Hat blocks

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

Hat blocks were the blocks that started every script. They were shaped with a rounded top and a bump at the bottom — this was so blocks could only be placed below them. There were 11 Hat blocks in the Scratch editor, six of which were in the Events category, one in the control category, and one in the category more blocks (if any custom blocks had been created).

Stack blocks

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

Stack blocks were the blocks that performed the main commands. They were shaped with a notch at the top and a bump on the bottom — this was so blocks could be placed above and below them. There were 77 Stack blocks, making it the most common block shape.

Boolean blocks

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

Boolean blocks were the conditions — they were either true or false. With a hexagonal shape, there were 13 of these blocks.

Reporter blocks

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

Reporter blocks were the values. Reporter blocks could hold numbers and strings. Shaped with rounded edges, there were 37 of these blocks — not counting the theoretically infinite amount of Reporter blocks that can be made for each variable and list.

C blocks

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

C blocks were blocks that take the shape of a "C". Also known as "Wrap blocks",[1] these blocks looped the blocks within the Cs or checked if a condition is true. There were five C blocks, and they could be found in the Control category. C blocks could be bumped at the bottom, or capped.

Cap blocks

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

Cap blocks were the blocks that ended scripts. They were shaped with a notch at the top and a flat bottom — this was so no blocks could be placed below them. There were two Cap blocks which can both be found in the Control category.

List of Blocks

There were 145 blocks in Scratch 2.0.

Motion blocks

Main article: Motion Blocks

Motion blocks were the blocks that controlled a Sprite's movement. There were 17 motion blocks in Scratch 2.0.

Scratch 2.0 had the following fourteen motion stack blocks:

Scratch 2.0 had the following three motion reporter blocks:

Looks blocks

Main article: Looks Blocks

Looks blocks were the blocks that control a sprite's look. There were 23 looks blocks in Scratch 2.0. Three of the 19 sprite looks blocks have a counterpart for the stage.

Scratch 2.0 had the following sixteen looks stack blocks:

Scratch 2.0 had the following three Looks Reporter blocks:

  • costume # / backdrop # — The number of the sprite/stage's current costume/backdrop in the list.
  • backdrop name — Reported the name of the current backdrop.
  • size — The sprite's size.

Sound blocks

Main article: Sound Blocks

Sound blocks were the blocks that controlled sound and MIDI functions. There were 13 sound blocks in Scratch 2.0.

Scratch 2.0 had the following eleven sound stack blocks:

Scratch 2.0 had the following two sound reporter blocks:

Pen blocks

Main article: Pen Blocks

Pen blocks were the blocks that controlled the pen. There were 11 pen blocks in Scratch 2.0.

Scratch 2.0 had the following eleven pen stack blocks:

Data blocks

Variables blocks

Main article: Variables Blocks

Variables blocks were the blocks that held values and strings. There were 5 variables blocks in Scratch 2.0.

Scratch 2.0 had the following four variables stack blocks:

Scratch 2.0 had the following variables reporter block:

List blocks

Main article: List Blocks

List blocks were the blocks that managed lists. They were stored in the Data category. There were 10 List blocks in Scratch 2.0.

Scratch 2.0 had the following six list stack blocks:

Scratch 2.0 had the following 3 list reporter blocks:

Scratch 2.0 had the following list boolean block:

  • <[ v] contains ()> — The condition for checking if an item's content was the specified text.

Events blocks

Main article: Events Blocks

Events blocks were blocks that controlled events and the triggering of scripts. There were 8 events blocks in Scratch 2.0.

Scratch 2.0 had the following six events hat Blocks:

Scratch 2.0 had the following two events stack blocks:

  • broadcast [ v] — Sent a broadcast throughout the Scratch program, activating when I receive () blocks that were set to that broadcast.
  • broadcast [ v] and wait — Like the Broadcast () block, but paused the script until all scripts activated by the broadcast were completed.

Control blocks

Main article: Control Blocks

Control blocks were the blocks that controlled scripts. There are 11 control blocks in Scratch 2.0.

Scratch 2.0 had the following one control hat block:

  • when I start as a clone (sprites only) — This hat block was triggered whenever a clone is created, and would only be run by that clone.

Scratch 2.0 had the following three control stack blocks:

Scratch 2.0 had the following five Control C blocks:

  • repeat () — A loop that repeated the specified amount of times.
  • forever — A loop that would never end.
  • if <> then — Checked the condition so that if the condition is true, the blocks inside it would activate.
  • if <> then
    else
    — Checked the condition so that if the condition is true, the blocks inside the first C would activate and if the condition is false, the blocks inside the second C would activate.
  • repeat until <> — A loop that would stop once the condition is true.

Scratch 2.0 had the following two control cap blocks:

  • stop [ v] — Stopped the scripts chosen through the drop-down menu. Could also be a stack block when "other scripts in this sprite" is chosen.
  • delete this clone (sprites only) — Deleted a clone.

Sensing blocks

Main article: Sensing Blocks

Sensing blocks were the blocks that detected things. There were 20 sensing blocks in Scratch 2.0.

Scratch 2.0 had the following four sensing stack blocks:

Scratch 2.0 had the following five sensing boolean blocks:

  • touching [ v]? — The condition for checking if the sprite was touching the mouse-pointer or another sprite.
  • touching color ()? — The condition for checking if the sprite was touching a specific color.
  • color () is touching ()? — The condition for checking if a color on the sprite was touching a specific color.
  • key [ v] pressed? — The condition for checking if the specified key was being pressed.
  • mouse down? — The condition for checking if the mouse was down.

Scratch 2.0 had the following eleven Sensing Reporter blocks:

  • distance to [ v] — The distance from the sprite to the mouse-pointer or another sprite.
  • 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.
  • loudness — How loud the noise was that the microphone was sensing.
  • timer — How much time had passed since the Scratch program was opened or the timer reset.
  • video [ v] on [ v] — The video motion or direction of video motion on an object.
  • [ v] of [ v] — The X position, Y position, direction, costume, size or volume of the stage or a sprite.
  • current [ v] — The specified time unit selected.
  • days since 2000 — The number of days since the year 2000.
  • username — The username of a user.

Operators blocks

Main article: Operators Blocks

Operators blocks were the blocks that performed math functions and string handling. There are 17 operators blocks in Scratch 2.0.

Scratch 2.0 had the following six operators boolean blocks:

  • [] \< [] — The condition for checking if a value was less than the other.
  • [] = [] — The condition for checking if two values were equal.
  • [] > [] — The condition for checking if a value was greater than the other.
  • () and () — Joined two conditions.
  • () or () — Joined two conditions, but they functioned separately.
  • not () — Made the condition checked if it is false, not true.

Scratch 2.0 had 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 () — Chose a random number between the two limits.
  • join [] [] — The two values concatenated with each other.
  • letter () of [] — The specified character of the value.
  • length of [] — The length of the value.
  • () mod () — The remainder of the division.
  • round () — Rounded the value to the nearest whole number.
  • [ v] of ()::operators — 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 would yield more choices of its type.

More blocks

Main article: More Blocks

More blocks were user-made custom blocks. There were 2 unique kinds of more blocks in Scratch 2.0. They are known as my blocks in Scratch 3.0.

Scratch 2.0 had the following More Modified Hat block:

  • define — Defined a custom block.

Scratch 2.0 had the following More Stack block:

PicoBoard blocks

Main article: PicoBoard Blocks

PicoBoard blocks were used to control and sense data from the PicoBoard.

Scratch 2.0 had the 2 following PicoBoard hat blocks:

Scratch 2.0 had the following PicoBoard boolean block:

Scratch 2.0 had the following PicoBoard reporter block:

LEGO WeDo 1.0 blocks

Main article: LEGO WeDo 1.0 Extension

LEGO WeDo 1.0 blocks were used to connect the LEGO WeDo Construction Set 1.0 to Scratch. They are accessed via the Add an Extension button.

Scratch 2.0 had the following five LEGO WeDo 1.0 Stack blocks:

Scratch 2.0 had the following two LEGO WeDo 1.0 Hat blocks:

Scratch 2.0 had the following two LEGO WeDo 1.0 Reporter blocks:

LEGO WeDo 2.0 blocks

Main article: LEGO Education WeDo 2.0 Extension

LEGO WeDo 2.0 blocks were used to connect the LEGO WeDo Construction Set 2.0 to Scratch. They are accessed via the Add an Extension button.

Scratch 2.0 had the following seven LEGO WeDo 2.0 Stack blocks:

Scratch 2.0 had the following two LEGO WeDo 2.0 Hat blocks:

Scratch 2.0 had the following LEGO WeDo 2.0 boolean block:

Scratch 2.0 had the following two LEGO WeDo 2.0 reporter blocks:

Scratch Block Plugin

Main article: Block Plugin


The Scratch Block Plugin allowed blocks and scripts to be used in the Scratch Discussion Forums and Scratch Wiki, as well as other sites with the included JavaScript. They looked like this:

when green 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))

The version that includes all blocks from Scratch 2.0 was made by blob8108.

Editing the Block Colors

Editing the block colors.
Main article: Edit Block Colors

In the online Scratch 2.0 editor, by shift-clicking the Edit menu an option called "Edit block colors" appeared. By selecting this, a menu would appear with 3 HSL sliders and tools for modifying the block colors of a specific block category.

In Other Programming Languages

Scratch modifications contained many new blocks that were not present in Scratch. MIT, where Scratch is made, had also created other languages using blocks such as the MIT App Inventor. Stencyl is a highly-professional language that features an entire block interface for programming real-time apps and online games. Scratch Jr also has blocks which are even more friendly for younger children to understand.

See Also

References

  1. TimothyLawyer. (2013-11-26). "C (wrap)" post:193855
Cookies help us deliver our services. By using our services, you agree to our use of cookies.