Omnimaga

Calculator Community => TI Calculators => Axe => Topic started by: parserp on January 07, 2012, 02:50:41 pm

Title: Using the nib{ command [solved] :D
Post by: parserp on January 07, 2012, 02:50:41 pm
So, If I have a 176 byte tilemap in L1, (a number from 0-15) and I want to have it stored in an appvar, but in 88 bytes using the nib{ command, how would I do that?
...And then to get the information from the appvar and copy it to L1 again?
Title: Re: Using the nib{ command
Post by: leafy on January 07, 2012, 02:53:03 pm
Alternatively you could just do something like:

GetCalc(Str01)→V
For(A,0,87)
{A*2+L1→B}*16+{B+1}→{A+V}
End
Title: Re: Using the nib{ command
Post by: parserp on January 07, 2012, 02:57:01 pm
Alternatively you could just do something like:

GetCalc(Str01)→V
For(A,0,87)
{A*2+L1→B}*16+{B+1}→{A+V}
End
ah, that makes sense. but how would I decode that?
Title: Re: Using the nib{ command
Post by: leafy on January 07, 2012, 02:59:47 pm
To convert it from nibbles to bytes just do the opposite:

GetCalc(Str01)→V
For(A,0,87)
{A+V}→C/16→{A*2+L1→B}
C^16→{B+1}
End

(Someone correct me if I'm wrong)
Title: Re: Using the nib{ command
Post by: parserp on January 07, 2012, 03:11:07 pm
yay it worked! thanks leafy! :D
Title: Re: Using the nib{ command [solved] :D
Post by: Quigibo on January 07, 2012, 05:57:02 pm
If you want to use the nib{} command to avoid the unoptimized division and multiplications, you could do it like:
Code: [Select]
GetCalc(Str01)→V
For(A,0,175)
{L1+A}→nib{V*2+A}
End
And to decode, its as simple as reversing the store:
Code: [Select]
GetCalc(Str01)→V
For(A,0,175)
nib{V*2+A}→{L1+A}
End