Discuss Scratch

Slam-
Scratcher
100+ posts

Procedures as data

Is there a way to store procedure as data in Scratch (I know its possible in Snap!), without cascade of if-else?
I want to make OOP methods for clones.
ContourLines
Scratcher
500+ posts

Procedures as data

Slam- wrote:

Is there a way to store procedure as data in Scratch (I know its possible in Snap!), without cascade of if-else?
I want to make OOP methods for clones.
So you mean like a piece of scratch code in a variable? In that case, you'd have to create a system of encoding scratch blocks into a string, which you'd then interpret when needed.
robowiko123
Scratcher
51 posts

Procedures as data

As far as I'm aware that isn't possible – if you want to implement something like that, you will need to cascade if statements

Powered by DjangoBB