TIB: Re:


[Prev][Next][Index][Thread]

TIB: Re:




Tavis Segura wrote:
> 
> I agree with Chris; but I would prefer to use the following commands
> 
> :If U<5
> :Then
> :(whatever you do if you don't have enough money)
> :Else
> :(Do your subtraction  U-5->U and buy the item)
> :End                      /
>              (NOTE: store symbol)
> 
> instead of the test he made.  The test function is slightly smaller, and
> it doesn't have to do any arithmetic on the left side of the test.
> You could expand this idea further by using another variable instead of
> the number 5.  This way you can buy items at varying costs in your
> program without rewriting the same code often.  I'm sure everyone has
> thought of that already, but I felt it should be said anyway.
> 
> Tavis
> 
> >Attn.: Frank
> >I have been programming TI's for quite some time. I would suggest the
> >following code for what I believe you want your game to check.
> >
> >:If U-5>=0
> >:Then
> >:U-5->U
> >:(continue code, object is bought, and user gets output)
> >:Else
> >:(they don't have the cash do this, object is not bought, and user
> >gets output)
> >:End
> >
> >If you have any other questions I'll be more than glad to answer >them.
> You may also take a look at some of my games for the 82 & 85 at
> >http://pcrm.dorm.utexas.edu/ and entering the TI section.
> >(this server is not very reliable so please be patient and check back
> >if it's down.)
> >
> >Best of luck,
> >Christopher Robin MacDougald
> >crmacd@mail.utexas.edu
> 
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com


Of course you could always go with something like this, if you're 
tight for space:
U-C(U>=0)->U

hehehe isn't this fun!!

BTW, I know you're SUPPOSED to use /->/, but all the extra slashes 
tend to confuse me. It's easier to just show what you would see on the 
screen, if it's possible.

Jody Snider
jody1@alaska.net


References: