Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How can a character Say all numbers in array in the same bubble?
Old
man007
Guest
 
Status:
Posts: n/a
Default How can a character Say all numbers in array in the same bubble? - 03-27-2010, 10:34 PM

I am doing a program to sort an array of numbers. I have the logic working but i wanted to make a character say all the numbers before they are sorted and after they are sorted. I can do that one by one but i was wondering if i can do it at the same time. For example Say "100,200,300" in the same bubble. I can also use Print to output on the bottom of screen but that is kinda of annoying too because it looks like "the value world.mylogic.Unnamed1_Unnamed2_Unnamed 3 is 100" and so on. Any suggestions?

Thanks a bunch.
   
Reply With Quote
Old
rankhornjp
Guest
 
Status:
Posts: n/a
Default 03-28-2010, 11:41 AM

create a method:

"object" say "hello"

click "world" in the object tree, then Functions tab
replace "hello" with "[a] joined with [b]"
replace [a] with "[what] as a string" and select "expressions" then the variable.
do the same with [b].

you can also do: "[a] joined with {[a] joined with [b]}" to give you 3 variables or strings joined together. You can do this with as many "[a] joined with [b]s" as necessary to get the number of phrases you want.

Last edited by rankhornjp; 03-28-2010 at 12:06 PM. Reason: clarity
   
Reply With Quote
Old
WolfHawk
Guest
 
Status:
Posts: n/a
Default 03-28-2010, 05:28 PM

I don't know who you are or what you do, but I LOVE YOU!!!!! Your answer to the above question turned a key in my head for a project I'm working on!!!!! I GET IT NOW!!!!!!!!!!

Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!

   
Reply With Quote
Old
man007
Guest
 
Status:
Posts: n/a
Default 03-28-2010, 08:06 PM

Quote:
Originally Posted by rankhornjp View Post
create a method:

"object" say "hello"

click "world" in the object tree, then Functions tab
replace "hello" with "[a] joined with [b]"
replace [a] with "[what] as a string" and select "expressions" then the variable.
do the same with [b].

you can also do: "[a] joined with {[a] joined with [b]}" to give you 3 variables or strings joined together. You can do this with as many "[a] joined with [b]s" as necessary to get the number of phrases you want.
Thank you but i am aware of that way and it does work. I can make the character "say item0 from array", "item1 from array and so on" with using "a joined with b". I wanted to have a loop of outputting multiple values from an array using the index and display them in the same bubble though. I'm not sure if that's even possible . Thanks again.
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 578
Join Date: Nov 2008
Location: In the interwebs
Default 03-28-2010, 09:47 PM

I show best by example, so look over this code!
Attached Files
File Type: a2w Array to string.a2w (176.2 KB, 28 views)


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Old
man007
Guest
 
Status:
Posts: n/a
Default 03-29-2010, 11:11 AM

Quote:
Originally Posted by zonedabone View Post
I show best by example, so look over this code!
I love your style Show best by example.

OK, i got it to work!!! Yay!!! My string variable was the issue. Thanks for your help, this works great and it's exactly what i needed.
Attached Files
File Type: a2w assignment7.a2w (575.5 KB, 18 views)

Last edited by man007; 03-29-2010 at 12:49 PM.
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.