I don't have the cable to upload a program to mi TI-83 so i decided to hand code this program and when I run it, it gives me undefined and when i go to the part in the code i have no idea what is wrong.


Code:

:ClrHome
:ClrDraw
:FnOff
:AxesOff
:PlotsOff
:
:Input "DEGREE:",X
:X+1→X
:0→dim(L1)
:Disp "COEF. OF    :"
:
:For(A,1,X)
:If X-A=1
:Output(2,10,"X    ")
:If X-A=0
:Output(2,10,"CONST")
:If X-A>1
:Then
:Output(2,10,"X^   ")
:Output(2,12,X-A)
:End
:Input Y
:Y→L1(A)
:End
:
:Text(1,1,A)
:1→C
:1→R
:
:If L1(1)<0
:Then
:Text(R,C,"‾")
:C+4→C
:‾1*L1→L1
:End
:
:
:
:L1(1)→I
:Lbl XX
:If I≤1
:Goto ZZ
:If sum(abs(fPart(L1/I)))=0
:Then
:L1/I→L1
:Text(R,C,I)
:While I>0
:iPart(I/10)→I
:C+4→C
:End
:Goto ZZ
:End
:I-1→I
:Goto XX
:
:Lbl ZZ
:
:0→Z
:While L1(X)=0
:Z+1→Z
:dim(L1)-1→dim(L1)
:X-1→X
:End
:
:If Z>0
:Then
:Text(R,C,"X")
:C+4→C
:If Z=2
:Then
:Text(R,C,"2")
:C+4→C
:End
:If Z>2
:Then
:Text(R,C,"^")
:Text(R,C+4,Z)
:C+8→C
:End
:End
:
:
:
:Lbl TP
:L1(1)→P
:L1(X)→Q
:abs(P)→P
:abs(Q)→Q
:
:For(I,1,P)
:For(J,1,Q)
:If fPart(Q/J)=0 and fPart(P/I)=0
:Then
:J/I→F
:Lbl MD
:0→dim(L2)
:L1(1)→L2(1)
:For(Z,1,X-1)
:L2(Z)*F+L1(Z+1)→L2(Z+1)
:End
:If L2(X)=0
:Then
:Goto PR
:Lbl FD
:L2→L1
:X-1→X
:
:If X≤1
:Then
:Text(50,1,"FINISHED."
:Text(57,1,"PRESS ENTER TO CONTINUE")
:Pause
:FnOn
:AxesOn
:ClrHome
:Stop
:End
:
:X→dim(L1)
:Goto TP
:End
:If F>0
:Then
:‾F→F
:Goto MD
:End
:End
:End
:End
:End
:
:Text(R,C,"(")
:C+3→C
:
:Lbl PP
:If C>74
:Then
:0→C
:R+7→R
:End
:
:If dim(L1)>0
:Then
:L1(1)→N
:
:If N≠1 or dim(L1)=1
:Then
:Text(R,C,N)
:abs(N)→N
:While N>0
:iPart(N/10)→N
:C+4→C
:End
:End
:End
:
:If dim(L1)≤1
:Then
:Text(R,C,")")
:Text(50,1,"FINISHED."
:Text(57,1,"PRESS ENTER TO CONTINUE")
:Pause
:FnOn
:AxesOn
:ClrHome
:Stop
:End
:
:Text(R,C,"X")
:C+4→C
:
:If dim(L1)=3
:Then
:Text(R,C,"2")
:C+4→C
:End
:
:If dim(L1)>3
:Then
:Text(R,C,"^")
:Text(R,C+4,dim(L1)-1)
:C+8→C
:End
:
:For(A,1,dim(L1)-1)
:L1(A+1)→L1(A)
:End
:dim(L1)-1→dim(L1)
:
:
:While dim(L1)>0 and L1(1)=0
:If dim(L1)>0
:Then
:For(A,1,dim(L1)-1)
:L1(A+1)→L1(A)
:End
:dim(L1)-1→dim(L1)
:End
:End
:
:
:
:Text(R,C,"+")
:If L1(1)<0
:Text(R,C,"-")
:C+4→C
:abs(L1(1))→L1(1)
:Goto PP
:
:Lbl PR
:If C>60
:Then
:0→C
:R+7→R
:End
:Text(R,C,"(")
:C+3→C
:If I≠1
:Then
:Text(R,C,I)
:While I>0
:iPart(I/10)→I
:C+4→C
:End
:End
:Text(R,C,"X+")
:If F>0
:Text(R,C+4,"-")
:C+8→C
:Text(R,C,J)
:While J>0
:iPart(J/10)→J
:C+4→C
:End
:Text(R,C,")")
:C+3→C
:
:Goto FD
:


its this part that is giving me the problems:

Code:

:If L1(1)<0
:Then
:Text(R,C,"‾")
:C+4→C
:‾1*L1→L1
:End


I couldn't find the overline in the menu, the only thing I could find is the x with the overline over it. Any suggestions?
By a quick look of the code, you can't have a list dimension of 0 and look for the first slot, that will error out the code in a heart beat..

Sadly, the code also asks if the dim( of L1 is less than 1, and that will make it so the code doesn't work either. :/
For L1, are you typing the L₁ token using [2nd][1], or are you typing the literal string "L1"?
this isn't my code, this is something that someone else made. Im just copying the code on to my Ti 83 because i don't have the cable to put it on it. For the L1 I'm doing [2nd][1]. Idk how it's not working for me and working on my emulator. at a quick glance the only thing that I and not getting exatly right is the {-}(over line), im putting in [xhat] in its place. Do you know where the over line is?
Oh, that's your problem. The over-line is the negative symbol (different from the subtraction symbol). It's the [(-)] key.
  
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 1 of 1
» 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