Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Keoni29 on June 19, 2011, 12:31:18 pm
-
Can I optimize this?
Lbl LV
If r1=1
prgrmSTAGE1
End
If r1=2
prgrmSTAGE2
End
etc.
-
I'm assuming this is axe:
Lbl LV
!If r1-1
prgmSTAGE1
Else!If -1
prgmSTAGE2
Else!If -1
prgmSTAGE3
etc.
End
Return
-
Here it looks like a look up table would be the best option depending on the number of options, but I'm no Axe expert and don't know how to do that. My suggestion though would be maybe if you could have a list of pointers to the other source files then have the r1 index jump to what it's offset points to.
-
I'd go with the lookup table idea. It's certainly possible in Axe if you have pointers to those files. Otherwise, since the level names are all the same size, you could store those mashed together in a big string and use r1*7 to index the file names in the string. An even more optimized way to do that would be to store a null value after each string like "prgmSTAGE1"[00]"prgmSTAGE2"[00]->Str1 and use r1*2*2*2 to index the string.