[TIB] Re: TI-83 Basic stumper
[Prev][Next][Index][Thread]
[TIB] Re: TI-83 Basic stumper
Arthur,
Not sure if this is the "quick and speedy" method you are looking for, but I
would just use Output( to shift the numbers/letters over. ex:
If (player wants to pick up gold)
Then
randInt(10,100->G {number of gold pieces}
Output(1,1,"You pick up the
Output(2,1,G
Output(2,5,"gold pieces
I know this is a bit more cumbersome and larger than the orginial, but it
was the easiest way I could think of to basically shift things over. As for
converting interger numbers to a string, I think it can be done (remember
reading about it somwhere), but, alas seem to have misplaced website URL.
Hope this helps...
-Ben
>From: "Arthur J. O'Dwyer" <ajo@andrew.cmu.edu>
>Reply-To: ti-basic@lists.ticalc.org
>To: ti-basic@lists.ticalc.org
>Subject: [TIB] TI-83 Basic stumper
>Date: Sun, 18 Aug 2002 13:50:54 -0400 (EDT)
>
>
>
>Thanks for responding to my first post,
>even though it wasn't very informative
>or questioning.
>
>Here's a question I have been struggling
>with on the TI-83:
> Is there a way in Basic to convert an
>integer number to its string representation
>in a string variable? For example, in
>my current project, "Rogue", I have piles
>of gold pieces which the player can pick
>up as in the following snippet:
>
> If (player wants to pick up gold)
> randInt(10,100->G {number of gold pieces}
> Disp "YOU PICK UP THE",G,"GOLD PIECES."
>
>But that displays as
>
> YOU PICK UP THE
> 85
> GOLD PIECES.
>
>and what I want is more like
>
> YOU PICK UP THE
> 85 GOLD PIECES.
>
>which could be accomplished easily
>if I could get the value of G into
>Str1, for example:
>
> Disp "YOU PICK UP THE",Str1+" GOLD PIECES."
>
>
>To forestall for-dummies answers: *YES*, I
>know you can use a While loop like this:
>
> randint(10,100->G
> "->Str1
> While G
> sub("0123456789",10fPart(.1G)+1,1)+Str1->Str1
> iPart(.1G->G
> End
>
>but I'm looking for a speedy and less involved
>method, something like
>
> randint(10,100->Y1:Eqn>String(Y1,Str1
>
>which of course doesn't work, but it would be
>nice if it did. (Handling 0 and negative numbers
>isn't required, BTW.)
>
>Thanks!
>
>-Arthur
>ajo at andrew dot cmu dot edu
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com