I have a code specific problem now. This is a slightly modified code to loop a string that can be edited as it loops. When the 23 key is pressed (del), only the last letter from line four is deleted, not the last letter from all lines. Can you see the error?
Program:LOOPER
Code:
:" →Str2
:1→W
:1→Q
:ClrHome
:While W=1
:ClrHome
:getKey→K
:Output(1,1,Str2
:Output(2,1,Str2
:Output(3,1,Str2
:Output(4,1,Str2
:Output(5,1,Str2
:Output(6,1,Str2
:Output(7,1,Str2
:Output(8,1,Str2
:If K=23 and 1-length(Str2
:Then
:Output(1,Q,"
:Output(2,Q,"
:Output(3,Q,"
:Output(4,Q,"
:Output(5,Q,"
:Output(6,Q,"
:Output(7,Q,"
:Output(8,Q,"
:Q-1→Q
:sub(Str2,1,length(Str2)-1→Str2
:End
:If ((K>40 and K<44) or (K>50 and K<56) or (K>60 and K<66) or (K>70 and K<76) or (K>80 and K<86) or (K>90 and K<95)) and length(Str2)<16
:Then
:Str2+sub("ABC DEFGH IJKLM NOPQR STUVW XYZθ",K-40,1)→Str2
:Q+1→Q
:End
:If ((K>10 and K<16) or (K>20 and K<23) or (K>23 and K<27) or (K>30 and K<35) or (K>93 and K<96) or (K>101 and K<105))
:Stop
:If K=105:Then
:If length(Str2)>1
:sub(Str2,2,length(Str2)-1)→Str2
:If length(Str2)=1
:Return
:End
:End
Here is the second program I was working on, some very simple algebra programs. I can seem to get the text commands to work. How tall are the letters in pixels? My text commands have each text command based on 10 (e.g. 10,20,30...). How can I shorten that so that they don't overlap?
Program:Basic
Code: :ClrHome
:CoordOff
:GridOff
:AxesOff
:LabelOff
:ExprOff
:Output(1,1,"Program made by:"
:Output(2,1,"Josh Pham"
:Output(6,1,"Contact"
:Output(7,1,"JPfowl@gmail.com"
:Output(8,1,"For help"
:Pause
:Lbl TT
:ClrHome
:Fix 2
:Menu("Sub Program?","Pyth. Solver",PS,"2-Pt. Solver",TS,"Quad. Solver",QS,"FOIL",FF,"Exit",EE)
:Lbl PS
:ClrHome
:Menu("A{^2}+B{^2}=C{^2} Solve4?","A",PA,"B",PB,"C",PC,"Menu",TT
:Lbl PA
:ClrHome
:Output(8,1,"A{^2}+B{^2}=C{^2}"
:Prompt B
:Output(8,1,"A{^2}+B{^2}=C{^2}"
:Prompt C
:ClrHome
:sqrt(C{^2}-B{^2})→A
:Text(80,1,"A{^2}+B{^2}=C{^2}"
:Text(10,1,"A=",A
:Pause
:Goto PS
:Lbl PB
:ClrHome
:Output(8,1,"A{^2}+B{^2}=C{^2}"
:Prompt A
:Output(8,1,"A{^2}+B{^2}=C{^2}"
:Prompt C
:ClrHome
:sqrt(C{^2}-A{^2})→B
:Text(80,1,"A{^2}+B{^2}=C{^2}"
:Text(10,1,"B=",B
:Pause
:Goto PS
:Lbl PC
:ClrHome
:Output(8,1,"A{^2}+B{^2}=C{^2}"
:Prompt A
:Output(8,1,"A{^2}+B{^2}=C{^2}"
:Prompt B
:ClrHome
:sqrt(A{^2}+B{^2})→C
:Text(80,1,"A{^2}+B{^2}=C{^2}"
:Text(10,1,"C=",C
:Pause
:Goto PS
:Lbl QS
:ClrHome
:Output(8,1,"Ax{^2}+Bx+C"
:Prompt A
:Output(8,1,"Ax{^2}+Bx+C"
:Prompt B
:Output(8,1,"Ax{^2}+Bx+C"
:Prompt C
:ClrHome
:Text(80,1,"Ax{^2}+Bx+C"
:Text(10,1,"x=",X
:Text(20,1,"x=",Y
:(({-}B+sqrt(B{^2}-4AC))/(2A))→X
:(({-}B-sqrt(B{^2}-4AC))/(2A))→Y
:Pause
:Goto TT
:Lbl TS
:ClrHome
:Output(8,1,"(X,Y);(A,B)"
:Prompt A
:Output(8,1,"(X,Y);(A,B)"
:Prompt B
:Output(8,1,"(X,Y);(A,B)"
:Prompt X
:Output(8,1,"(X,Y);(A,B)"
:Prompt Y
:((Y-B)/(X-A))→S
:(Y-SX)→B
:((A+X)/2)→C
:((B+Y)/2)→D
:sqrt(((A+X){^2}+(B+Y){^2}))→M
:ClrHome
:Text(10,1,"(A,B);C,D)"
:Text(20,1,"Equ. of a Line:"
:Text(30,1,"y=",S,"x+",B
:Text(40,1,"Mid Pt.:"
:Text(50,1,"(,C,",",D,")"
:Text(60,1,"Distance:",M
:Pause
:Goto TT
:Lbl FF
:ClrHome
:Output(8,1,"(Ax+B)(Cx+D)"
:Prompt A
:Output(8,1,"(Ax+B)(Cx+D)"
:Prompt B
:Output(8,1,"(Ax+B)(Cx+D)"
:Prompt C
:Output(8,1,"(Ax+B)(Cx+D)"
:Prompt D
:ClrHome
:(AB)→M
:(BC+AD)→N
:(BD)→O
:ClrHome
:Text(10,1,"(Ax+B)(Cx+D)"
:Text(20,1,M,"x{^2}"+,N,"x+",O
:Pause
:Goto TT
:Lbl EE
:Float
:CoordOn
:GridOff
:AxesOn
:LabelOn
:ExprOn
:Stop