Alice Community  

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

Reply
 
Thread Tools Display Modes
Referring to 3D text objects as variables
Old
mdalis
Junior Member
 
Status: Offline
Posts: 3
Join Date: Jun 2011
Smile Referring to 3D text objects as variables - 06-20-2011, 03:43 PM

Hi! This is my first post in the Alice Community, though I have been constantly referring to it throughout this summer as I have been doing Alice research at Duke University.

I'm writing a program to help kids learn how to multiply matrices. To multiply two 2x2 matrices together, I have 8 3D text objects to fill the matrices that I'm multiplying. I have an 8-item object array of these objects so I can easily refer to them and do the same thing to all of them, rather than doing it 8 times.

One thing I want to do to all of these number objects is change their text (set text to) to a number that the user inputs (or anything, for that matter), and I obviously use what as a string to change the number to a string type. The problem is that when I refer to an item in the array, Alice doesn't know for sure that it is a text object, so it doesn't let me drag objects from the array into set text to lines, or set the values of the arrays to strings. It seems to be that any object that is obviously a 3D text object can use the set text to, but if a variable object could be a 3D text object or could be something else, Alice doesn't let you use the text property. How can I, in a sense, promise Alice that my whole array is 3D text objects so that I can use the set text to method or the what as a string function?

Thank you so so much for all of your help!! Let me know if you need any more clarification! I don't think I want to post the whole program on the Internet (yet, but it will hopefully be available soon as a finished version on a Duke Alice website), but I can definitely write out some code if that would help.
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 06-20-2011, 04:59 PM

Put in a 'print' tile.
Drag 'as a string' onto the 'print' tile.
Drag array onto 'as a string'.
It might then be moveable from there into the appropriate place.
If not, then drag it onto a clipboard at the top right hand corner, then try dragging from the clipboard onto the appropriate place.


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬
   
Reply With Quote
Old
mdalis
Junior Member
 
Status: Offline
Posts: 3
Join Date: Jun 2011
Default 06-21-2011, 09:20 AM

Thank you for your response! That doesn't quite work, though. Although 'item 0 from world.matrixNumbers as a string' is indeed in the form of a string, I can't set its text to anything because now it's just a text string, not an object or variable that has properties or methods. I can set my object left(0,0)'s text to that since it is a string, but I can't set that string's text to anything. Anyone else have any ideas?
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 06-21-2011, 03:26 PM

I misunderstood what you wanted. Sorry, I don't think that can be done without scripting.


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬
   
Reply With Quote
Old
mdalis
Junior Member
 
Status: Offline
Posts: 3
Join Date: Jun 2011
Default 06-21-2011, 04:51 PM

What do you mean by scripting?
   
Reply With Quote
Old
TauTrumpsPi
Senior Member
 
TauTrumpsPi's Avatar
 
Status: Offline
Posts: 399
Join Date: Mar 2011
Location: The diamond layer
Default 06-21-2011, 04:59 PM

Using Java or Jython and editing the Alice software to make it do something beyond what Alice was originally made for.


--------------------------------------------------------------------------------------------------------------------------
I have plenty of common sense. I just choose to ignore it.
-Calvin and Hobbes

Wondering about my Avatar?
http://en.wikipedia.org/wiki/Tardigrade

Wondering about my username?
http://www.youtube.com/watch?v=jG7vhMMXagQ
   
Reply With Quote
Reply


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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.