This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-09-28 21:00:13

dmr89xo
New Scratcher
Registered: 2012-09-28
Posts: 6

Saying a list at once

Does anyone know how to get the sprite to say a list all at once, for example to say a list of names at once instead of individually. I am confused.

Offline

 

#2 2012-09-28 21:01:55

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Saying a list at once

You can use the variable for the list. It separates each entry with a space if you do that.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#3 2012-09-28 21:05:18

dmr89xo
New Scratcher
Registered: 2012-09-28
Posts: 6

Re: Saying a list at once

Okay still confused ha. I'm new to this program.

Offline

 

#4 2012-09-29 04:31:06

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Saying a list at once

set [temp_var v] to [] //Empty
set [i v] to [1]
repeat (length of [list v])
    set [temp_var v] to (join (temp_var) | (item (i) of [list v]))
    change [i v] by [1]
end
say (temp_var)
I always forget how to do the join block but oh well

That should work

Last edited by RedRocker227 (2012-09-29 04:32:47)


Why

Offline

 

#5 2012-09-29 12:15:09

BoltBait
Scratcher
Registered: 2009-03-09
Posts: 1000+

Re: Saying a list at once

say (listvar)
...will combine your entire list together and say it all at once.

For example:

ask and wait [What is your name?]
delete [all v] of [mylist v]
add [Hello,] to [mylist v]
add (answer) to [mylist v]
add [Thanks for playing my game.] to [mylist v]
say (mylist)

Last edited by BoltBait (2012-09-29 12:19:34)


Animated sigs must be banned!
http://boltbait.com/j.pnghttp://boltbait.com/s.pnghttp://boltbait.com/d.pnghttp://boltbait.com/a.pnghttp://boltbait.com/p.png

Offline

 

Board footer