Discuss Scratch

EthanWatts2009
Scratcher
8 posts

What is the join block?

I have been wondering what the
(join [] [world]) block does. Can anyone help me
benk_b4b
Scratcher
100+ posts

What is the join block?

It joins two blocks of text. You can input things like variables, text you try in, lists and boolean blocks. Here's an example:

say (join [Hello ] (join (username) [!])) for [2] secs

For me, it would output “Hello benk_b4b!”
EthanWatts2009
Scratcher
8 posts

What is the join block?

yup thanks.
Can you also help me with making a variable to text?
phuongph_12
Scratcher
29 posts

What is the join block?

EthanWatts2009 wrote:

yup thanks.
Can you also help me with making a variable to text?
This script maybe?
set [Word v] to [blah blah blah]
then:
say (Word) for (2) secs
T0RRENT_
Scratcher
100+ posts

What is the join block?

It joins two values together. For instance, if you have a variable that has the value “2,” and another with the value “1”, you can join them together (not add them).
(join (var1) (var2))
This will result in “21.”
The same can be done for any kind of thing you can put in there.
goodpersonsowow
Scratcher
100+ posts

What is the join block?

It joins the 2 values together. For example:
(join [hello ] [world])
results in “hello world”.
You can also use it to join reporters.
For example, to ask your name and say hello, the block will be needed:
ask [What is your name?] and wait
say (join [Hello, ] (answer)) for (2) secs
You can also join predicates. For example: If you want the sprite to say if the mouse is down in a sentence, you can do this:
say (join <mouse down?> [is what mouse down is.])
You can also use multiple join () () blocks. For example, we can do the script above but add an exclamation point (!) at the end:
ask [What is your name?] and wait
say (join [Hello, ] (join (answer) [!])) for (2) secs
They do not add numbers:
(join [6] [6])
= 66. Addition does this:
((6) + (6))
= 12.

There is more information here.

Last edited by goodpersonsowow (Jan. 18, 2022 15:51:28)

Powered by DjangoBB