Hello everyone in Cemetech! I'm a new person, so therefore most of you might not take this seriously because I am a newbie (care to give me the rules around here? Tried searching couldn't find it).

Edit: Code is given, and rules still not found, but has been stated. There is a TOS that I read however.

However, I just started learning Ti-Basic, and I think it's the coolest thing ever to be able to create mini games on your calculator! However, I am a bit curious about something that happened while making a program, and this is quite peculiar.

(I will not post program code unless granted permission because it's 999 items in a list stored, which might be considered spam. Again, please send rules to me!)

The making of the program.

Anyway, this is what happened: I made 2 lists called ʟPI and ʟDIGIT. Nothing special right? Well I happened to want to learn to memorize about 314 digits of pi... And I'm glad to say that Ti-84 Plus CE lists can store 999 items! I took advantage of this. So this is what I did:

In ʟPI I added numbers that start off looking like this: {94,103,92,82}
In ʟDIGIT I added numbers that looked like this: {3,103,1,4}
(The program in short, will make 103 into a "." and it will look like: 3.14)

Essentially, you need to press the correct button representing the next number of pi. For example, let's say you have pressed 3.14159 in succession. You will need to press the number 2 next. If not, you will lose.

Credits to TheLastMillenial for explaining how to decipher keys on the calculator in one of his videos.

The issue
After I had reached about 100 keys (correctly) pressed or so, my calculator performance slows A LOT. And I don't know why. Can someone please explain why this is happening, and can you explain to me how to fix it?

When given permission by a person of high rank, I will post the code.



Code:

ClrHome
{3,103,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6,2,6,4,3,3,8,3,2,7,9,5,0,2,8,8,4,1,9,7,1,6,9,3,9,9,3,7,5,1,0,5,8,2,0,9,7,4,9,4,4,5,9,2,3,0,7,8,1,6,4,0,6,2,8,6,2,0,8,9,9,8,6,2,8,0,3,4,8,2,5,3,4,2,1,1,7,0,6,7,9,8,2,1,4,8,0,8,6,5,1,3,2,8,2,3,0,6,6,4,7,0,9,3,8,4,4,6,0,9,5,5,0,5,8,2,2,3,1,7,2,5,3,5,9,4,0,8,1,2,8,4,8,1,1,1,7,4,5,0,2,8,4,1,0,2,7,0,1,9,3,8,5,2,1,1,0,5,5,5,9,6,4,4,6,2,2,9,4,8,9,5,4,9,3,0,3,8,1,9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,1,2,9,0,2,1,9,6,0,8,6,4,0,3,4,4,1,8,1,5,9,8,1,3,6,2,9,7,7,4,7,7,1,3,0,9,9,6,0,5,1,8,7,0,7,2,1,1,3,4,9,9,9,9,9,9,8,3,7,2,9,7,8,0,4,9,9,5,1,0,5,9,7,3,1,7,3,2,8,1,6,0,9,6,3,1,8,5,9,5,0,2,4,4,5,9,4,5,5,3,4,6,9,0,8,3,0,2,6,4,2,5,2,2,3,0,8,2,5,3,3,4,4,6,8,5,0,3,5,2,6,1,9,3,1,1,8,8,1,7,1,0,1,0,0,0,3,1,3,7,8,3,8,7,5,2,8,8,6,5,8,7,5,3,3,2,0,8,3,8,1,4,2,0,6,1,7,1,7,7,6,6,9,1,4,7,3,0,3,5,9,8,2,5,3,4,9,0,4,2,8,7,5,5,4,6,8,7,3,1,1,5,9,5,6,2,8,6,3,8,8,2,3,5,3,7,8,7,5,9,3,7,5,1,9,5,7,7,8,1,8,5,7,7,8,0,5,3,2,1,7,1,2,2,6,8,0,6,6,1,3,0,0,1,9,2,7,8,7,6,6,1,1,1,9,5,9,0,9,2,1,6,4,2,0,1}→⌊DIGIT

{94,103,92,82,92,83,74,93,84,83,94,83,73,74,72,74,94,93,94,73,82,84,93,84,82,94,94,73,94,93,72,74,83,102,93,73,73,82,92,74,72,92,84,74,94,74,74,94,72,83,92,102,83,73,93,102,74,72,82,74,82,82,83,74,93,94,102,72,73,92,84,82,102,84,93,73,84,93,102,73,74,74,73,84,93,73,102,94,82,73,93,83,94,82,93,92,92,72,102,84,72,74,73,93,92,82,73,102,73,84,83,92,94,93,73,93,94,102,84,84,82,72,102,74,94,73,82,82,84,102,74,83,83,102,83,73,93,93,94,92,72,93,83,94,83,74,82,102,73,92,93,73,82,73,92,92,92,72,82,83,102,93,73,82,92,102,93,72,102,92,74,94,73,83,93,92,92,102,83,83,83,74,84,82,82,84,93,93,74,82,73,74,83,82,74,94,102,94,73,92,74,84,82,82,93,73,73,92,102,74,72,83,84,84,83,74,94,94,82,82,84,92,93,73,82,72,83,84,82,73,93,94,94,72,73,84,72,73,94,92,84,83,93,72,92,93,102,92,74,102,74,92,82,83,84,82,73,83,84,84,74,93,94,82,84,102,94,82,73,84,92,102,82,83,82,94,93,84,84,82,73,93,92,94,94,74,94,84,102,72,93,84,102,93,82,74,92,82,92,93,72,94,72,93,82,83,73,72,102,102,84,84,102,84,94,92,83,83,73,73,92,72,82,73,73,92,83,93,102,74,93,102,74,84,93,73,93,74,93,83,82,102,74,92,72,92,83,94,84,82,94,84,72,73,74,93,83,74,102,94,84,102,102,92,92,94,94,102,83,94,102,83,82,73,73,93,102,82,84,84,83,93,92,94,73,82,92,82,84,74,83,92,74,82,92,83,92,92,84,102,74,82,94,94,102,83,72,93,72,102,94,84,83,72,83,74,83,74,92,74,83,94,102,74,93,92,73,84,92,92,72,94,73,92,74,94,93,84,92,92,72,74,94,92,102,83,92,92,73,83,82,73,102,72,82,82,84,93,94,72,74,74,84,93,72,82,74,83,84,72,94,83,92,73,73,83,72,83,93,72,93,82,73,74,92,93,93,72,74,94,73,92,73,94,102,92,92,74,82,74,92,93,74,73,94,94,84,72,94,94,84,93,82,82,102,84,83,84,84,82,94,102,73,84,102,93,92,94,74,82,74,82,84,94,74,83,93,93,82,72,94,72,92,74,102,72,102,93,92,72,74,73,84,102,74,82,94,72,102,93,72,72,102,83,94,74,93,92,72,92,72,84,93,74,94,92,72,84,72,83,93,94,73,82,84,72,82,73,92,73,82,84,72,84,84,74,82,102,83,92,94,93,102,102,102,83,84,73,92,93,72,92,82,83,93,84,94,83,84,102,73,93,72,72,73,83,72,72,92,94,82,93,72,83,72,72,73,74,84,102,74,92,72,94,84,94,72,92,72,73,72,93,92,82,84,73,82,82,102,74,102,92,93,93,82,74,83,94,82,94,102,92,82,84,83,82,74,83,73,83,94,72,92,102,83,102,72,74,93,93,72,74,84,73,74,93,83,73,74,93,94,83,82,93,102,92,74,74,83,84,92,92,93,92,93,74,102,93,92,74,84,102,73,84,82,102,94,82,82,92,73,92,83,74,73,92,94,84,93,74,72,72,82,72,72,92,94,102,74,74,84,102,83,92,73,72,102,72,93,92,92,94,82,74,74,74,74,74,74,73,94,72,93,74,72,73,102,82,74,74,83,92,102,83,74,72,94,92,72,94,93,73,92,84,102,74,84,94,92,73,83,74,83,102,93,82,82,83,74,82,83,83,94,82,84,74,102,73,94,102,93,84,82,93,83,93,93,94,102,73,93,83,94,94,82,82,84,73,83,102,94,83,93,84,92,74,94,92,92,73,73,92,72,92,102,92,102,102,102,94,92,94,72,73,94,73,72,83,93,73,73,84,83,73,72,83,94,94,93,102,73,94,73,92,82,93,102,84,92,72,92,72,72,84,84,74,92,82,72,94,102,94,83,74,73,93,83,94,82,74,102,82,93,73,72,83,83,82,84,73,72,94,92,92,83,74,83,84,93,73,84,94,73,73,93,94,83,94,72,73,72,83,74,94,72,83,92,74,83,72,72,73,92,73,83,72,72,73,102,83,94,93,92,72,92,93,93,84,73,102,84,84,92,94,102,102,92,74,93,72,73,72,84,84,92,92,92,74,83,74,102,74,93,92,84,82,93,102,92}→⌊PI

0→I
1→G
" "→Str1

Disp "999"
Disp "Digits of π"
Disp "Type the first digit of π"

For(I,1,dim(⌊PI))

⌊PI(I)→X
0→K
While K=0
getKey→K

"WRONG
If K≠0 and K≠X
Then
ClrHome
Disp "Game over."
" "→Str2

For(H,I,I+20)
If ⌊DIGIT(H)≠103
Then
Str2+eval(⌊DIGIT(H))→Str2
Else
Str2+"."→Str2
End
End

sub(Str2,2,length(Str2)-1)→Str2
Disp "The next digit of π was:",Str2


Stop
End
End

"NEXT DIGIT OF PI
ClrHome
Disp "Type the next digit"
Disp "SCORE: "
Output(2,8,I)


"DISPLAYING NUMBERS
If ⌊DIGIT(I)=103
Str1+"."→Str1

If ⌊DIGIT(I)≠103
(Str1+eval(⌊DIGIT(I)))→Str1

If I>20
Then
sub(Str1,2,length(Str1)-1)→Str1
2→G
End
Output(6,G,Str1)
End
I didn’t try to figure out your problem because I didn’t want to get on my PC to load it to my calculator. But here’s a simple version you can look at. This is on my TI84+CE. Maybe later I’ll load your program on my calculator and try it. I keyed this in using my iPad.


Code:

{3,1,4,1,5,9,2,6,5,3,5}→ʟ2
0→A
Lbl Z
A+1→A
Input “NBR “,B
If B=ʟ2(A)
Goto Z
Disp “WRONG”
Disp ʟ2(A)
dave1707 wrote:
I didn’t try to figure out your problem because I didn’t want to get on my PC to load it to my calculator. But here’s a simple version you can look at. This is on my TI84+CE. Maybe later I’ll load your program on my calculator and try it. I keyed this in using my iPad.


Code:

{3,~1,1,4,1,5,9,2,6,5,3,5}→ʟ2
0→A
Lbl Z
A+1→A
Input “NBR “,B
If B=ʟ2(A)
Goto Z
Disp “WRONG”
Disp ʟ2(A)

This is fine, but I'd recommend avoiding Gotos all together and opting for a loop instead. Your code will throw a dim error when you reach the end of the list, which would ideally be handled properly. Also, you don't accept the ".", which could also be fixed.

Code:
{3,1,4,1,5,9,2,6,5,3,5}→ʟ2
1→A
Repeat expr(Str1)≠ʟ2(A) or A=dim(ʟ2
Input "NBR: ",Str1
If Str1=".
"~1→Str1
A+1→A
End
If A!=dim(ʟ2
Then
Disp "WRONG
Else
Disp "GG

If you want to do it without the input token, which requires the user to press enter after every character, which admittedly isn't the best, I would strongly recommend implementing a numpad reader to prevent having to store the list of keycodes, which is not necessary.
mr womp womp: I wasn’t trying to write anything worth while, just something to show another way that it could be done. Looking thru the original code, I didn’t understand the 2nd list of numbers or everything the program was trying to do. I also didn’t want to go thru all the trouble of getting on my PC ( takes forever to load ) and hook up the calculator and copy the code to it and then try to figure out the problem. I mostly write code on my iPad while I’m watching TV, but occasionally I’ll see something here that I’ll try on the calculator. If it’s a complicated program, I’ll write it first on my iPad and then convert it to run on the calculator.
Here's another version that can be used to memorize Pi. Just enter the digits without pressing Enter and it will tell you when you're wrong. I only have 100 digits of Pi loaded, but if you need more you can easily add them. If you already know the first 100, then just load the second 100 and go from there. Once loaded, just start keying 3.14159 etc . It will show you the count of your correct digits to the right of the decimal point. If you key a wrong digit, it will tell you the correct one. You then have to press ENTER to start over. This was written on/for a TI84+CE.


Code:

"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679"→Str1

{102,92,93,94,82,83,84,72,73,74,103}→L₁

Lbl Y:1→R:1→C:0→P
ClrHome
Output(5,5,"ENTER DIGITS OF PI"

Lbl Z:­~1→M:getKey→A

For(N,1,dim(L₁
If A=L₁(N):N-1→M
End

If M=~­1:Goto Z

P+1→P
If P=1:ClrHome

sub(Str1,P,1)→Str2

If P=2 and M=10:Then
Output(R,C,"."
C+1→C:Goto Z:End

If eval(M)=Str2:Then
Output(R,C,Str2
C+1→C
If C>26:Then
1→C:R+1→R:End
If P>2:Then
Output(9,22,P-2
Output(9,3,"CORRECT DIGITS > ."

End:Goto Z:End

Output(10,8,"PRESS ENTER"

If M=10:Then
Output(8,1,".":Else
Output(8,1,M:End
Output(8,3,"WAS WRONG, SHOULD BE"
Output(8,24,Str2

Pause :Goto Y
Found 2 errors in my above code. Apparently the negative sign didn’t get copied correctly when I copied the code from my calculator and pasted it above. I corrected the 2 places in the above code using the ~ sign which I assume is the correct way to show the negative key. Is dropping the negative sign a common occurrence when copying code from the calculator and pasting it here. Is it better to use 0-number instead of -number to avoid the problem.
  
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