How to Use Functions in Blocks (Difficulty: 4/10) Need to know about functions

So its the vector version slope

I guess.

Bump. I hope people understand this time. I’ll include one last explanation.

So we have 2 sections of content de we want to run: the one before the function, and the one after the function. The one before the function runs when the property for the number of functions that have run is 0. It then increases the number of functions run by one and calls the next function by changing the property.

After this, the main block of blocks is called again, but since this time the number of functions run is 1, it now runs the code after the function.

Okay, but when you say “function”, what do you mean?

A function is a piece of code that takes in inputs and does stuff, whenever you use it. Do you know any coding not from GKC?

I can make a sprite move left and right in scratch…

1 Like

Functions are like REALLY vague. They can do whatever you tell them to. Its like a normal piece of code, but you can tell it to do what you want it to do in a main section of the code.

Like the “my block” block in Scratch?

I haven’t done scratch in 2 years or so, so I can’t remember. A function has a name and inputs. It does stuff according to what the inputs are. So I could have a function with an input of a name, and it would print my name out. That’s really simple, and no one would make a function for that, but that is the simplest example I can think of.

Isn’t a function just a block to run a specific set of actions pre made by the player so they do not have to loop* it over and over again?
*make

1 Like

YES!! I forgot about that definition!

The one thing I would change is instead of loop it over and over again is either type it over and over again, or make it over and over again.

2 Likes

I finally understand this…

Also BUMP

1 Like

I just ran over a squirrel. BUMPBUMP

2 Likes

test:
the y-intercept of f(x)-2(x+3)^2+2 is…
ugh…

BUMP

-16?

4 Likes

Great guide so I’m going to Bump it

Bump

1 Like

.

B̶̢̘͇̜̠͈̘̻͓͉̥͕̟͔̯͚̤̥̜̪̻̺̩͇͖̯̙̠͈͐̎̈͋͋̒͜͜͜ų̶̢̨̛͚̱̻̩͈͙̺̝͙̙͇͉̦̹͍̘͓͚͙̈͌̍͗͊̌́͝͝m̵̨̧̢̡̧̪̳̲̟̣̥̝̜̞͈͇̜͙̞͔̣̫̝͚̩͓͇͉̙͉͈̥͉̏́̒͑͌̽̚͜ͅp̷̡̡̡̛͎͙͕̻̲͈̤͙̹̰̟̮̳̯̺̖͉̙̯̐̇̂̎̓̃̓̍͑̐̊͂̋̒͋̑͌̎͊͊̆̓͌̃̋̈́͘͜͝͠͝

.