Help with a TI-83 program
I can't for the life of me figure out why this isn't working. This is a proof-of-concept program that will later be adapted to the whole alphabet, and some symbols. Its meant to take a 32 digit long number and convert it into 16 characters.
Code is as follows:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
16->B
0->X
Input A
Goto A
Stop
Lbl A
If B=0
Then
Stop
Else
B-1->B
X+1->X
int(A/(100^B))->A
If A=10
Then
Output(7,X,"A"
Goto A
Else
Output(7,X,"B"
Goto A
Stop
<!--c2--></div><!--ec2-->
Code is as follows:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
16->B
0->X
Input A
Goto A
Stop
Lbl A
If B=0
Then
Stop
Else
B-1->B
X+1->X
int(A/(100^B))->A
If A=10
Then
Output(7,X,"A"
Goto A
Else
Output(7,X,"B"
Goto A
Stop
<!--c2--></div><!--ec2-->
Comments
Also, by "not working" what exactly doesn't it do? Does it just give the good 'ol syntax error or something else?
Anyway, what it does it, if the 32 digit number starts with 10, it'll output A, and then nothing but Bs. And when it leads with something other than 10, it outputs only Bs. Thats how it should work, sort of.
To clarify:
Input: 10555555555555555555555555555555
Output: ABBBBBBBBBBBBBBB
Now, when I input 10105555555555555555555555555555
I should get AABBBBBBBBBBBBBB
Or, when I input 10555555555555555555555555555510
I should get ABBBBBBBBBBBBBBA
But I don't. It decodes the
Holy crap I just figured it out.
Revised code:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
15->B
0->X
Input A
Goto A
Stop
Lbl A
If B=-1
Then
Stop
Else
B-1->B
X+1->X
int(A/(100^B))->N
A-(N*100^B)->A
If N=10
Then
Output(7,X,"A"
Goto A
Else
Output(7,X,"B"
Goto A
Stop
<!--c2--></div><!--ec2-->
Now, its doing what its supposed to, for a bit. It seems that after its decoded 7 characters, it stops.
Thus,
Input: 10101010101010555555555555555555
Output: AAAAAAABBBBBBBBB
But also
Input: 10101010101010555555510555555555
Output: AAAAAAABBBBBBBBB
Or even
Input: 10101010101010101010101010101010
Output: AAAAAAABBBBBBBBB
And I spent the time typing all that into my ti-83, too.
<img src="http://www.hosting.nsagames.com/drfuzzy/pic/peniscalculator.gif" border="0" alt="IPB Image" />
bwahaha
silly ######.