i'm actually good at programming programs for the ti calculators but some reason i'm having trouble with my current program and i don't see why i'm having this error that's occurring i will post the details as well with a picture of whats going on.
- KermMartian
- Site Admin (Posts: 64222)
- Re: I need Help With my program that i'm making
- 05 Jun 2014 09:20:20 am
john1234brown wrote:
i'm actually good at programming programs for the ti calculators but some reason i'm having trouble with my current program and i don't see why i'm having this error that's occurring i will post the details as well with a picture of whats going on.
Okay, do so. Edit your post with the source code and/or screenshots as possible. If you need the source code from your TI-BASIC programs, try using SourceCoder 3. Upload your .8xp file, then choose the BBCode button and copy the text you get into your post.
alright so here is the code that i have before the actions also please don't steal my codes of my program here it is
Code:
alright so the code works perfectly until it gets to any part that involves the code Output(|LBB(1),L1(Y),"$" because some how the letter Y doesn't get a randInt Value between 1 and 16 and i have the code to give it a value here is that code randInt(1,16)->Y but for some reason after i run the program and it goes to that code for some reason it still has the value of 0 so i tried to do this code hoping it would work G->Y but that didn't work and i can't think of any other way to fix this does anyone have a solution to my problem and since the value of Y is 0 it will not work in the code Output(|LBB(1),L1(Y),"$" Because there is no L1(0) there is only L1(1) to L1(16).
Thanks in advanced for your time really thank you i'm only 14 actually just turned 14 its my birthday and i've always been into computers and codes so i got into this i fully understand it but every now and then i have errors like this any was thank you for your help!.
Code:
SetUpEditor L1,L2,L3,L4,L5,L6,|LA,|LAA,|LAAA,|LAAAA,|LBB
randIntNoRep(1,8)->|LBB
1->|LBB(1)
2->|LBB(2)
3->|LBB(3)
4->|LBB(4)
5->|LBB(5)
6->|LBB(6)
7->|LBB(7)
8->|LBB(8)
randInt(1,16)->A
randInt(1,16)->B
randInt(1,16)->C
randInt(1,16)->D
randInt(1,16)->E
randInt(1,16)->F
randInt(1,16)->G
randInt(1,16)->H
randInt(1,16)->I
randInt(1,16)->J
randInt(1,16)->K
randInt(1,16)->M
randInt(1,16)->N
randInt(1,16)->O
randInt(1,16)->P
randInt(1,16)->Q
randInt(1,16)->R
randInt(1,16)->S
randInt(1,16)->T
randInt(1,16)->U
randInt(1,16)->V
randInt(1,16)->W
randInt(1,16)->X
randInt(1,16)->Y
randInt(1,16)->Z
randInt(1,16)->theta
randIntNoRep(1,16)->L1
randIntNoRep(1,16)->L2
randIntNoRep(1,16)->L3
randIntNoRep(1,16)->L4
randIntNoRep(1,16)->L5
randIntNoRep(1,16)->L6
randIntNoRep(1,16)->|LA
randIntNoRep(1,16)->|LAA
randIntNoRep(1,8)->|LAAA
randInt(1,4)->|LAAA(1)
randInt(1,4)->|LAAA(2)
randInt(1,4)->|LAAA(3)
randInt(1,4)->|LAAA(4)
randInt(1,4)->|LAAA(5)
randInt(1,4)->|LAAA(6)
randInt(1,4)->|LAAA(7)
randInt(1,4)->|LAAA(8)
ClrHome
Goto 1A
Lbl 1A
AxesOff
CoordOff
ClrHome
randInt(1,16)->Y
randInt(1,16)->theta
Text(0,0,"=$$$$Instructions$$$$="
Text(6,0,"To stop at any time press"
Text(12,0,"clear button and it will"
Text(18,0,"ExtraIfI add wind control"
Text(24,0,"in u will press the left"
Text(30,0,"button to make the money"
Text(36,0,"go to the left and down"
Text(42,0,"same with right button"
Text(48,0,"the down button resets it"
Text(54,0,"<>-[]=Press^^'{}^^`Enter=[]-<>"
G->Y
Pause
AxesOff
CoordOn
ClrDraw
ClrHome
Goto A1
and the code of the action
Lbl A1
0->L
Repeat L=45
getKey->L
If |LBB(1)=9
1->|LBB(1)
If |LBB(2)=9
1->|LBB(2)
If |LBB(3)=9
1->|LBB(3)
If |LBB(4)=9
1->|LBB(4)
If |LBB(5)=9
1->|LBB(5)
If |LBB(6)=9
1->|LBB(6)
If |LBB(7)=9
1->|LBB(7)
If |LBB(8)=9
1->|LBB(8)
If |LAAA(1)=1
Output(|LBB(1),L1(B),"$"
Output(|LBB(1),L1(J),"$"
Output(|LBB(1),L1(K),"$"
Output(|LBB(1),L1(M),"$"
Output(|LBB(1),L1(N),"$"
Output(|LBB(1),L1(S),"$"
Output(|LBB(1),L1(Q),"$"
If |LAAA(1)=2
Output(|LBB(1),L1(theta),"$"
Output(|LBB(1),L1(Z),"$"
Output(|LBB(1),L1(Y),"$"
Output(|LBB(1),L1(X),"$"
Output(|LBB(1),L1(W),"$"
If |LAAA(1)=3
Output(|LBB(1),L1(P),"$"
Output(|LBB(1),L1(W),"$"
Output(|LBB(1),L1(O),"$"
Output(|LBB(1),L1(U),"$"
Output(|LBB(1),L1(F),"$"
Output(|LBB(1),L1(R),"$"
Output(|LBB(1),L1(T),"$"
Output(|LBB(1),L1(I),"$"
Output(|LBB(1),L1(E),"$"
Output(|LBB(1),L1(H),"$"
Output(|LBB(1),L1(D),"$"
Output(|LBB(1),L1(A),"$"
If |LAAA(1)=4
Output(|LBB(1),L1(C),"$"
Output(|LBB(1),L1(U),"$"
Output(|LBB(1),L1(Y),"$"
Output(|LBB(1),L1(X),"$"
Output(|LBB(1),L1(Z),"$"
Output(|LBB(1),L1(D),"$"
Output(|LBB(1),L1(F),"$"
Output(|LBB(1),L1(P),"$"
Output(|LBB(1),L1(S),"$"
Output(|LBB(1),L1(theta),"$"
If |LAAA(2)=1
Output(|LBB(2),L2(B),"$"
Output(|LBB(2),L2(J),"$"
Output(|LBB(2),L2(K),"$"
Output(|LBB(2),L2(M),"$"
Output(|LBB(2),L2(N),"$"
Output(|LBB(2),L2(S),"$"
Output(|LBB(2),L2(Q),"$"
If |LAAA(2)=2
Output(|LBB(2),L2(theta),"$"
Output(|LBB(2),L2(Z),"$"
Output(|LBB(2),L2(Y),"$"
Output(|LBB(2),L2(X),"$"
Output(|LBB(2),L2(W),"$"
If |LAAA(2)=3
Output(|LBB(2),L2(P),"$"
Output(|LBB(2),L2(W),"$"
Output(|LBB(2),L2(O),"$"
Output(|LBB(2),L2(U),"$"
Output(|LBB(2),L2(F),"$"
Output(|LBB(2),L2(R),"$"
Output(|LBB(2),L2(T),"$"
Output(|LBB(2),L2(I),"$"
Output(|LBB(2),L2(E),"$"
Output(|LBB(2),L2(H),"$"
Output(|LBB(2),L2(D),"$"
Output(|LBB(2),L2(A),"$"
If |LAAA(2)=4
Output(|LBB(2),L2(C),"$"
Output(|LBB(2),L2(U),"$"
Output(|LBB(2),L2(Y),"$"
Output(|LBB(2),L2(X),"$"
Output(|LBB(2),L2(Z),"$"
Output(|LBB(2),L2(D),"$"
Output(|LBB(2),L2(F),"$"
Output(|LBB(2),L2(P),"$"
Output(|LBB(2),L2(S),"$"
Output(|LBB(2),L2(theta),"$"
If |LAAA(3)=1
Output(|LBB(3),L3(B),"$"
Output(|LBB(3),L3(J),"$"
Output(|LBB(3),L3(K),"$"
Output(|LBB(3),L3(M),"$"
Output(|LBB(3),L3(N),"$"
Output(|LBB(3),L3(S),"$"
Output(|LBB(3),L3(Q),"$"
If |LAAA(3)=2
Output(|LBB(3),L3(theta),"$"
Output(|LBB(3),L3(Z),"$"
Output(|LBB(3),L3(Y),"$"
Output(|LBB(3),L3(X),"$"
Output(|LBB(3),L3(W),"$"
If |LAAA(3)=3
Output(|LBB(3),L3(P),"$"
Output(|LBB(3),L3(W),"$"
Output(|LBB(3),L3(O),"$"
Output(|LBB(3),L3(U),"$"
Output(|LBB(3),L3(F),"$"
Output(|LBB(3),L3(R),"$"
Output(|LBB(3),L3(T),"$"
Output(|LBB(3),L3(I),"$"
Output(|LBB(3),L3(E),"$"
Output(|LBB(3),L3(H),"$"
Output(|LBB(3),L3(D),"$"
Output(|LBB(3),L3(A),"$"
If |LAAA(3)=4
Output(|LBB(3),L3(C),"$"
Output(|LBB(3),L3(U),"$"
Output(|LBB(3),L3(Y),"$"
Output(|LBB(3),L3(X),"$"
Output(|LBB(3),L3(Z),"$"
Output(|LBB(3),L3(D),"$"
Output(|LBB(3),L3(F),"$"
Output(|LBB(3),L3(P),"$"
Output(|LBB(3),L3(S),"$"
Output(|LBB(3),L3(theta),"$"
If |LAAA(4)=1
Output(|LBB(4),L4(B),"$"
Output(|LBB(4),L4(J),"$"
Output(|LBB(4),L4(K),"$"
Output(|LBB(4),L4(M),"$"
Output(|LBB(4),L4(N),"$"
Output(|LBB(4),L4(S),"$"
Output(|LBB(4),L4(Q),"$"
If |LAAA(4)=2
Output(|LBB(4),L4(theta),"$"
Output(|LBB(4),L4(Z),"$"
Output(|LBB(4),L4(Y),"$"
Output(|LBB(4),L4(X),"$"
Output(|LBB(4),L4(W),"$"
If |LAAA(4)=3
Output(|LBB(4),L4(P),"$"
Output(|LBB(4),L4(W),"$"
Output(|LBB(4),L4(O),"$"
Output(|LBB(4),L4(U),"$"
Output(|LBB(4),L4(F),"$"
Output(|LBB(4),L4(R),"$"
Output(|LBB(4),L4(T),"$"
Output(|LBB(4),L4(I),"$"
Output(|LBB(4),L4(E),"$"
Output(|LBB(4),L4(H),"$"
Output(|LBB(4),L4(D),"$"
Output(|LBB(4),L4(A),"$"
If |LAAA(4)=4
Output(|LBB(4),L4(C),"$"
Output(|LBB(4),L4(U),"$"
Output(|LBB(4),L4(Y),"$"
Output(|LBB(4),L4(X),"$"
Output(|LBB(4),L4(Z),"$"
Output(|LBB(4),L4(D),"$"
Output(|LBB(4),L4(F),"$"
Output(|LBB(4),L4(P),"$"
Output(|LBB(4),L4(S),"$"
Output(|LBB(4),L4(theta),"$"
If |LAAA(5)=1
Output(|LBB(5),L5(B),"$"
Output(|LBB(5),L5(J),"$"
Output(|LBB(5),L5(K),"$"
Output(|LBB(5),L5(M),"$"
Output(|LBB(5),L5(N),"$"
Output(|LBB(5),L5(S),"$"
Output(|LBB(5),L5(Q),"$"
If |LAAA(5)=2
Output(|LBB(5),L5(theta),"$"
Output(|LBB(5),L5(Z),"$"
Output(|LBB(5),L5(Y),"$"
Output(|LBB(5),L5(X),"$"
Output(|LBB(5),L5(W),"$"
If |LAAA(5)=3
Output(|LBB(5),L5(P),"$"
Output(|LBB(5),L5(W),"$"
Output(|LBB(5),L5(O),"$"
Output(|LBB(5),L5(U),"$"
Output(|LBB(5),L5(F),"$"
Output(|LBB(5),L5(R),"$"
Output(|LBB(5),L5(T),"$"
Output(|LBB(5),L5(I),"$"
Output(|LBB(5),L5(E),"$"
Output(|LBB(5),L5(H),"$"
Output(|LBB(5),L5(D),"$"
Output(|LBB(5),L5(A),"$"
If |LAAA(5)=4
Output(|LBB(5),L5(C),"$"
Output(|LBB(5),L5(U),"$"
Output(|LBB(5),L5(Y),"$"
Output(|LBB(5),L5(X),"$"
Output(|LBB(5),L5(Z),"$"
Output(|LBB(5),L5(D),"$"
Output(|LBB(5),L5(F),"$"
Output(|LBB(5),L5(P),"$"
Output(|LBB(5),L5(S),"$"
Output(|LBB(5),L5(theta),"$"
If |LAAA(6)=1
Output(|LBB(6),L6(B),"$"
Output(|LBB(6),L6(J),"$"
Output(|LBB(6),L6(K),"$"
Output(|LBB(6),L6(M),"$"
Output(|LBB(6),L6(N),"$"
Output(|LBB(6),L6(S),"$"
Output(|LBB(6),L6(Q),"$"
If |LAAA(6)=2
Output(|LBB(6),L6(theta),"$"
Output(|LBB(6),L6(Z),"$"
Output(|LBB(6),L6(Y),"$"
Output(|LBB(6),L6(X),"$"
Output(|LBB(6),L6(W),"$"
If |LAAA(6)=3
Output(|LBB(6),L6(P),"$"
Output(|LBB(6),L6(W),"$"
Output(|LBB(6),L6(O),"$"
Output(|LBB(6),L6(U),"$"
Output(|LBB(6),L6(F),"$"
Output(|LBB(6),L6(R),"$"
Output(|LBB(6),L6(T),"$"
Output(|LBB(6),L6(I),"$"
Output(|LBB(6),L6(E),"$"
Output(|LBB(6),L6(H),"$"
Output(|LBB(6),L6(D),"$"
Output(|LBB(6),L6(A),"$"
If |LAAA(6)=4
Output(|LBB(6),L6(C),"$"
Output(|LBB(6),L6(U),"$"
Output(|LBB(6),L6(Y),"$"
Output(|LBB(6),L6(X),"$"
Output(|LBB(6),L6(Z),"$"
Output(|LBB(6),L6(D),"$"
Output(|LBB(6),L6(F),"$"
Output(|LBB(6),L6(P),"$"
Output(|LBB(6),L6(S),"$"
Output(|LBB(6),L6(theta),"$"
If |LAAA(7)=1
Output(|LBB(7),|LA(B),"$"
Output(|LBB(7),|LA(J),"$"
Output(|LBB(7),|LA(K),"$"
Output(|LBB(7),|LA(M),"$"
Output(|LBB(7),|LA(N),"$"
Output(|LBB(7),|LA(S),"$"
Output(|LBB(7),|LA(Q),"$"
If |LAAA(7)=2
Output(|LBB(7),|LA(theta),"$"
Output(|LBB(7),|LA(Z),"$"
Output(|LBB(7),|LA(Y),"$"
Output(|LBB(7),|LA(X),"$"
Output(|LBB(7),|LA(W),"$"
If |LAAA(7)=3
Output(|LBB(7),|LA(P),"$"
Output(|LBB(7),|LA(W),"$"
Output(|LBB(7),|LA(O),"$"
Output(|LBB(7),|LA(U),"$"
Output(|LBB(7),|LA(F),"$"
Output(|LBB(7),|LA(R),"$"
Output(|LBB(7),|LA(T),"$"
Output(|LBB(7),|LA(I),"$"
Output(|LBB(7),|LA(E),"$"
Output(|LBB(7),|LA(H),"$"
Output(|LBB(7),|LA(D),"$"
Output(|LBB(7),|LA(A),"$"
If |LAAA(7)=4
Output(|LBB(7),|LA(C),"$"
Output(|LBB(7),|LA(U),"$"
Output(|LBB(7),|LA(Y),"$"
Output(|LBB(7),|LA(X),"$"
Output(|LBB(7),|LA(Z),"$"
Output(|LBB(7),|LA(D),"$"
Output(|LBB(7),|LA(F),"$"
Output(|LBB(7),|LA(P),"$"
Output(|LBB(7),|LA(S),"$"
Output(|LBB(7),|LA(theta),"$"
If |LAAA(8)=1
Output(|LBB(8),|LAA(B),"$"
Output(|LBB(8),|LAA(J),"$"
Output(|LBB(8),|LAA(K),"$"
Output(|LBB(8),|LAA(M),"$"
Output(|LBB(8),|LAA(N),"$"
Output(|LBB(8),|LAA(S),"$"
Output(|LBB(8),|LAA(Q),"$"
If |LAAA(8)=2
Output(|LBB(8),|LAA(theta),"$"
Output(|LBB(8),|LAA(Z),"$"
Output(|LBB(8),|LAA(Y),"$"
Output(|LBB(8),|LAA(X),"$"
Output(|LBB(8),|LAA(W),"$"
If |LAAA(8)=3
Output(|LBB(8),|LAA(P),"$"
Output(|LBB(8),|LAA(W),"$"
Output(|LBB(8),|LAA(O),"$"
Output(|LBB(8),|LAA(U),"$"
Output(|LBB(8),|LAA(F),"$"
Output(|LBB(8),|LAA(R),"$"
Output(|LBB(8),|LAA(T),"$"
Output(|LBB(8),|LAA(I),"$"
Output(|LBB(8),|LAA(E),"$"
Output(|LBB(8),|LAA(H),"$"
Output(|LBB(8),|LAA(D),"$"
Output(|LBB(8),|LAA(A),"$"
If |LAAA(8)=4
Output(|LBB(8),|LAA(C),"$"
Output(|LBB(8),|LAA(U),"$"
Output(|LBB(8),|LAA(Y),"$"
Output(|LBB(8),|LAA(X),"$"
Output(|LBB(8),|LAA(Z),"$"
Output(|LBB(8),|LAA(D),"$"
Output(|LBB(8),|LAA(F),"$"
Output(|LBB(8),|LAA(P),"$"
Output(|LBB(8),|LAA(S),"$"
Output(|LBB(8),|LAA(theta),"$"
1+|LBB(1)->|LBB(1)
1+|LBB(2)->|LBB(2)
1+|LBB(3)->|LBB(3)
1+|LBB(4)->|LBB(4)
1+|LBB(5)->|LBB(5)
1+|LBB(6)->|LBB(6)
1+|LBB(7)->|LBB(7)
1+|LBB(8)->|LBB(8)
End
Output(1,1,"Thanks4Playing"
Output(4,1,"()Press{}Enter[]"
Pause
ClrHome
Stop
alright so the code works perfectly until it gets to any part that involves the code Output(|LBB(1),L1(Y),"$" because some how the letter Y doesn't get a randInt Value between 1 and 16 and i have the code to give it a value here is that code randInt(1,16)->Y but for some reason after i run the program and it goes to that code for some reason it still has the value of 0 so i tried to do this code hoping it would work G->Y but that didn't work and i can't think of any other way to fix this does anyone have a solution to my problem and since the value of Y is 0 it will not work in the code Output(|LBB(1),L1(Y),"$" Because there is no L1(0) there is only L1(1) to L1(16).
Thanks in advanced for your time really thank you i'm only 14 actually just turned 14 its my birthday and i've always been into computers and codes so i got into this i fully understand it but every now and then i have errors like this any was thank you for your help!.
to KermMartian i'm using the SourceCoder3 and have been using it for a while now because it makes it a faster to program than by the calculator.
this is as optimised as I could make you're code, John. enjoy!
Code:
I cannot stress enough: For Loops!
Code:
;Original Code by John1234brown
;Optimisations by Luxen
SetUpEditor L1,L2,L3,L4,L5,L6,|LA,|LAA,|LAAA,|LAAAA,|LBB,|TMP
randIntNoRep(1,8)->|LBB
For(A,0,8
A->|LBB(A)
End
For(A,0,26
randInt(1,16)->|TMP(A)
End
randIntNoRep(1,16)->L1
randIntNoRep(1,16)->L2
randIntNoRep(1,16)->L3
randIntNoRep(1,16)->L4
randIntNoRep(1,16)->L5
randIntNoRep(1,16)->L6
randIntNoRep(1,16)->|LA
randIntNoRep(1,16)->|LAA
randIntNoRep(1,8)->|LAAA
For(A,0,8)
randInt(1,4)->|LAAA(A)
End
ClrHome
AxesOff
ClrDraw
Text(0,0,"=$$$$Instructions$$$$="
Text(6,0,"To stop at any time press"
Text(12,0,"clear button and it will"
Text(18,0,"ExtraIfI add wind control"
Text(24,0,"in u will press the left"
Text(30,0,"button to make the money"
Text(36,0,"go to the left and down"
Text(42,0,"same with right button"
Text(48,0,"the down button resets it"
Text(54,0,"<>-[]=Press^^'{}^^`Enter=[]-<>"
Pause
ClrDraw
ClrHome
DelVar L
Repeat L=45
getKey->L
For A,0,8
If |LBB(A)=9
1->|LBB(A)
End
;Wasn't sure what to do with below code, so I just left it be, besides update vars
If |LAAA(1)=1
Output(|LBB(1),L1(|tmp(2)),"$"
Output(|LBB(1),L1(|tmp(10)),"$"
Output(|LBB(1),L1(|tmp(11)),"$"
Output(|LBB(1),L1(|tmp(13),"$"
Output(|LBB(1),L1(|tmp(14)),"$"
Output(|LBB(1),L1(|tmp(19)),"$"
Output(|LBB(1),L1(|tmp(17)),"$"
;And so on. I bet there would be a better way to do all this, but nothing comes to mind.
...
...
...
...
;And, after that bunch of code being updated, we come to the End statement, which Happens to be fine, except you should use Return instead of Stop.
;I beleive that using Stop is iffy in MirageOS (could be wrong), and that a large amount of fools still use Mirage.
;In this program, Stop and Return should behave the same.
End
Output(1,1,"Thanks4Playing"
Output(4,1,"()Press{}Enter[]"
Pause
ClrHome
Return
I cannot stress enough: For Loops!
john1234brown: I believe that your problem is actually not the code itself. Whenever you ClrDraw, the X and Y variables are reset to 0. To avoid this issue, use a different variable.
i'm actually good at programming programs for the ti calculators but some reason i'm having trouble with my current program and i don't see why i'm having this error that's occurring i will post the details as well with a picture of whats going on.
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
» 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
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