Discuss Scratch

Hopeijay
Scratcher
90 posts

How is Scratch code executed?

majato wrote:

Hi again.
I'm going to teach teachers to code in Scratch and I want to be properly prepared. I have a month on me, so it's ok if there is a lot to read.

I'm wondering how Scratch executes code when there are several unconnected piles/groups of code in the editor. I often see this with children, but also new beginner adults code like that.

I got some links from our Norwegian group of Teach Kids To Code, but I'm currious if there's more.

Thanks in advance.

I am not completely sure but I believe it executes a little like JavaScript in that it is an interpreted language. This would mean it reads blocks of a script from top to bottom, line by line.

P.S. I think it is amazing that you are teaching your teachers to code, good luck!
SabiB
Scratcher
94 posts

How is Scratch code executed?

Event blocks execute in the order of which they were placed if they are intended to run on the same tick.

This means that if you place 2
when green flag clicked
blocks, then no matter what is attached to them, the first one that you placed will execute before the second.

Powered by DjangoBB