$$ \newcommand{\floor}[1]{\left\lfloor{#1}\right\rfloor} \newcommand{\ceil}[1]{\left\lceil{#1}\right\rceil} \renewcommand{\mod}{\,\mathrm{mod}\,} \renewcommand{\div}{\,\mathrm{div}\,} \newcommand{\metar}{\,\mathrm{m}} \newcommand{\cm}{\,\mathrm{cm}} \newcommand{\dm}{\,\mathrm{dm}} \newcommand{\litar}{\,\mathrm{l}} \newcommand{\km}{\,\mathrm{km}} \newcommand{\s}{\,\mathrm{s}} \newcommand{\h}{\,\mathrm{h}} \newcommand{\minut}{\,\mathrm{min}} \newcommand{\kmh}{\,\mathrm{\frac{km}{h}}} \newcommand{\ms}{\,\mathrm{\frac{m}{s}}} \newcommand{\mss}{\,\mathrm{\frac{m}{s^2}}} \newcommand{\mmin}{\,\mathrm{\frac{m}{min}}} \newcommand{\smin}{\,\mathrm{\frac{s}{min}}} $$

Prijavi problem

Obeleži sve kategorije koje odgovaraju problemu

Još detalja - opišite nam problem

Uspešno ste prijavili problem!
Status problema i sve dodatne informacije možete pratiti klikom na link.
Nažalost nismo trenutno u mogućnosti da obradimo vaš zahtev.
Molimo vas da pokušate kasnije.


We don’t have to create the program as a whole.

It is far more clear if we divide pieces of code into smaller, separate parts - procedures. Defining procedures makes writing programs and finding mistakes easier. That is why it is good to keep the procedures in your “backpack”. That way, you will be able to use them in other programs you create, and not waste time on making them again.


Programs made in Scratch usually have multiple sprites that interact with each other. We can define the interaction ourselves, and we can also use the built-in procedure That allows the sprites to broadcast messages and affect the running of the program. Using the broadcasting procedure will significantly decrease the number of blocks in the program, and it will make it easier for us to read the code.

_images/ProcZ1a.png _images/ProcZ1b.png

    Q-7: There are two programs - A and B, presented in the figures above. Both programs contain 3 sprites, girls speaking English, German and French. Below each girl are blocks that belong to them (the blocks allow them to say hello to the other two in their own language). Create programs you see in the figures above. Analyze what happens when they run. Which program represents a simulation of a normal (regular) conversation between three strangers?

  • Program A
  • When we run the program, we can see that all three girls are saying hello in their own language at the same time. This would not be the case in real life, during a normal conversation. We usually listen to the person we are talking to, and then we speak.
  • Program B
  • You are right! When we broadcast the messages, we allow everyone participating in the conversation to be polite - and not interrupt one another.

Watch the process of creating the program, which allows the girls to speak without interrupting one another:

System Message: ERROR/3 (D:\work\BlockBasedProgScratch\_sources\Procedures.rst, line 36)

Duplicate ID – see Motion, line 187

.. youtube:: QgCCzBw6DKU
   :width: 735
   :height: 415
   :align: center

Defining a new procedure

In Scratch, we can create a new procedure that would correspond to our needs.

Imagine that we want to create a program, which draws a flower on the stage. A flower is made of petals. Therefore, we need two procedures:

  • Petal, within which we will define the drawing of one petal, and

  • Flower, within which we will define the drawing of five petals.

In other words, the procedure Flower will call the procedure Petal, and the main program will call the procedure Flower.

We create a procedure by clicking on the category My Blocks, where we should click on the button Make a Block. A window will open, which will allow us to name our procedure.


If you want your flower to have the same petals like the one in the figure below, create the procedure Petal we presented:


Uradi We will let you make a procedure, which draws 5 petals. Little help: After drawing one petal, you need to turn the sprite 72 degrees to the right.

Possible solution


Vazno So, by using procedures, we make writing programs and finding mistakes easier.