Posted: Wed Mar 06, 2013 8:05 pm Post subject: RE:Need Help with Turing Game
In the same way that you call a a procedure, you can also refer to a variable.
For instance if you have a class with a procedure called show_description, you can do this:
object -> show_description
Lets say you have a variable called description. You can call it the same way:
put object -> description
Sponsor Sponsor
Kyle Biro
Posted: Wed Mar 06, 2013 10:30 pm Post subject: RE:Need Help with Turing Game
Well, I have an idea of how to add things to the inventory. My problem is displaying the array of type ^Item. As Tony said, I'd have to use something like "to_string" which I've never seen before. As far as I can think of, your way would require checking to see if the item is present, and the whole thing I'm stuck on is not wanting 100 if statements to check all of this.
Tony
Posted: Wed Mar 06, 2013 10:48 pm Post subject: Re: RE:Need Help with Turing Game
I don't understand your question. You already have an instance of of ^Item, that's what you are trying to print.
It would be up to the ^Item to contain the code to describe itself, which should be straight-forward.
Kyle Biro @ Wed Mar 06, 2013 10:30 pm wrote:
the whole thing I'm stuck on is not wanting 100 if statements to check all of this.