This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. TI-Basic => TI-BASIC
Author Message
Awesome1


Advanced Member


Joined: 28 Jan 2004
Posts: 269

Posted: 15 Jun 2004 12:19:04 pm    Post subject:

A while back i made a pong program with the help of some people. Here's the link:
http://forums.unitedti.org/index.php?showtopic=1747

I would like to add a highscore part and store the high scored on the calculator. The only was i can think of is to store the seperate highscores into lists like dim(L1, dim(L2 etc... and have the names in seperate Str~ files. But that would take up more memory than needed, is there a highscore program or code that can store the highscores onto the calculator and keep the names and highscores stored and updateable(a new highscore by player)? I have searched and found a thread on what i was looking for but it was not exactly what i wanted... http://forums.unitedti.org/index.php?showt...3&hl=high+score
Back to top
Fr0sty


Member


Joined: 27 Nov 2003
Posts: 202

Posted: 16 Jun 2004 01:13:20 pm    Post subject:

Well you'd definitely not want a high scores with more than 10 names and stuff. Anyway, You have just enough strings (10) and you can make your own lists (LG1 LG2 etc).
To save space you can always limit the number of characters in a screen.

While Length(Str1)<1 or Length(Str1)>5
Input Str1
End

Lists you can just have them archive and then use SetupEditor to unarchive 'em.
Back to top
leofox
INF student


Super Elite (Last Title)


Joined: 11 Apr 2004
Posts: 3562

Posted: 16 Jun 2004 01:20:20 pm    Post subject:

i would suggest making a list with for example 20 elements (5 highscores with 3 initials each) and then representing letters by numbers. There was a routine to convert text to numbers and vice versa, but i can't remember how it was. This is an example of the list HIGH:


Code:
{150; first highscore
1; letter A
23; letter W
19; letter S; means awesome  :)
and so on

I think this will work, though i never tried...
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 19 Jun 2004 04:38:45 pm    Post subject:

To get a high score from that list:
Code:
1->S
"_->Str1
For(I,-2,0
Str1+sub("string of all possible symbols", LHIGH(4S+I),1 -> Str1
End
LHIGH(4S-3 -> X
LHIGH is the hi-score list, S is the number of the high score, it returns the initials in Str1 (there is however a space at the beginning, you might need to edit that out) and the score is X.
To enter a hi-score to space S:

Code:
X->LHIGH(4S-3
For(I,1,3
inString("string of all possible symbols",sub(Str1,I,1 -> LHIGH(4S+I-3
End

These might need to be optimized once you put them in your own code.
Back to top
Display posts from previous:   
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
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement