Uhm...

A+1->A?
Zerocode wrote:
How would you make a variable restore the variable as a biger number then use another variable. For intense in this quote how would you make A bigger with out using a different variable


Code:
:4->dim(LMINE
:If LMINE(1) = 1
:Then
:LMINE(2)->A
:LMINE(3)->B
:LMINE(4)->C
:End
Do you mean like A+1->A? Or something like LMINE(2)+1->LMINE(2 ?
*Upon posting this I see that there is a second page*

If Rusty TI-BASIC Memory Serves:

Code:
LMINE(2)->A
A+N->A
A->LMINE(2)


Which could actually be truncated to:

Code:
LMINE(2)+N->LMINE(2)

Of course, the A+N part would be the formula used to increase the value of A. Now, if you have a crazy formula where "A" is used several times, it'd make more sense to use a letter variable. But if you're multiplying, subtracting, dividing or adding a number for a list element, it wouldn't be a terrible idea to follow the above.

I believe one of my programs doesn't use a single system variable, but since I haven't looked at a majority of my programs in over two years, I can't be sure. It could be another program I was working on or updating at the time and have since lost. Everything not on TI-Calc or Cemetech has pretty much been deleted Rolling Eyes

KermMartian wrote:
Zerocode wrote:
No, not strings. I am not sure what is really called, but an example would be some thing along the lines of, your half way thought a game lvl and to you want to save before you go into a boss battle.

Also, how you do mult. saves?
Good, so you'd want to save things like health, location, armor, weapons, and all that, which can all be easily represented by numbers. There's two ways you can do saves. The first, less-desirable way, is to have a separate list for each save. LMINE1, LMINE2, LYOURS, or whatever. The second and better way to do it is to put all of the states into the same list. Say your data is 5 numbers. Then, you could have LMINE1 be 5 elements long for one save, or 25 elements long for 5 saves. To get out the 5 elements for save N, where N is 1, 2, 3, 4, or 5, you could just get:

LMINE1(5N-4
LMINE1(5N-3
LMINE1(5N-2
LMINE1(5N-1
LMINE1(5N
That's a very clever way for multiple saves.

Zerocode wrote:

Code:
:4->dim(LMINE
:If LMINE(1) = 1
:Then
:LMINE(2)->A
:LMINE(3)->B
:LMINE(4)->C
:End


Taking into account Kerm's clever multi-save idea, you could even do something like this if you needed to adjust an entire save. Things to take into account, the first element tells the program how many save files you have and that A-E are variables for the save and N is the save game number. So if LMINE(1)=5, we'd have five saved games, and A=Level, B=Health, etc then A=First Save Element, etc and N=4


Code:
:For(X,LMINE(1,LMINE(1)
::LMINE(XN-4)+A->LMINE(XN-4)
::LMINE(XN-3)+B>LMINE(XN-3)
::LMINE(XN-2)+C->LMINE(XN-2)
::LMINE(XN-1)+D>LMINE(XN-1)
::LMINE(XN)+E>LMINE(XN)
:End
If you need to subtract a value from the list, don't worry about. As long as A,B,C or D is negative, the negative number will be added to the list. And a Positive plus a Negative is always equal to subtraction of a positive and a positive.
Awesome comicIDIOT, good stuff. Smile May I just correct your last chunk of code for some negative signs that seem to have run away and some parentheses that should have run away?


Code:
:For(X,LMINE(1,LMINE(1
::LMINE(XN-4)+A->LMINE(XN-4
::LMINE(XN-3)+B->LMINE(XN-3
::LMINE(XN-2)+C->LMINE(XN-2
::LMINE(XN-1)+D->LMINE(XN-1
::LMINE(XN)+E->LMINE(XN
:End
Favoring a technique is a nice crutch, but try to aim a little higher. While humans may choose, logic has already implied a minimal path. Converging those two is an art form. (You towards it, that is.)
Weregoose wrote:
Favoring a technique is a nice crutch, but try to aim a little higher. While humans may choose, logic has already implied a minimal path. Converging those two is an art form. (You towards it, that is.)
Shock Sounds very existential and deep and all that, but I'm not sure precisely to what you're referring.
thanks for all your help, after messing around earlier I figure out more for my self. like they say Practice makes perfect (as well as teaching you).
KermMartian wrote:
Weregoose wrote:
Favoring a technique is a nice crutch, but try to aim a little higher. While humans may choose, logic has already implied a minimal path. Converging those two is an art form. (You towards it, that is.)
Shock Sounds very existential and deep and all that, but I'm not sure precisely to what you're referring.

If I read that correctly, he means humans, by nature, don't always see the shortest, most efficient path to an answer. Therefore the "implied" minimal path is the shortest, most efficient path to that answer.
Correct me if I am wrong Weregoose.
Zerocode wrote:
thanks for all your help, after messing around earlier I figure out more for my self. like they say Practice makes perfect (as well as teaching you).
Indeed, they do say that. Laughing What else did you figure out on your own?
I'm saying that it's not up to human opinion as to what is the best approach, size-wise or speed-wise.

Sorry.
Weregoose wrote:
I'm saying that it's not up to human opinion as to what is the best approach, size-wise or speed-wise.

Sorry.
Ah, that makes more sense, thanks for the clarification.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement