I've made a game, and I would like to make a high scores list. I think it has something to do with lists, but I can't figure out how to add a single value to the list, and then delete the lowest. So, I know to use the SortD( command to sort them, any help?
Say you wanted to maintain a list of 10 high scores in ʟHS. The following code would be a simple way to add a new high score, sort the list, and then remove the lowest high score:


Code:
S→ʟHS(11)
SortD(ʟHS
10→dim(ʟHS
Ohhh, that's easy enough. And would I also just have it display the list, like:

Code:
S→ʟHS(11)
SortD(ʟHS→ʟHS
10→dim(ʟHS
Disp ʟHS

Thanks!
  
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