Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Hi, a little help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TomatoFire




PostPosted: Wed Apr 07, 2004 8:21 pm   Post subject: Hi, a little help

Hi, I am new to Turing and found this site through the help tab in turing. Im in grade 10 and just started Turing last week.
Anyways I require a bit of assistance. I am starting my first game and was wondering if someone could help me make a high scores list. I want to make it so that theres a command to save a score to a text document.

Example:

put "Would you like to add your score to the high scores list?"
put "Press 1 to save score and 2 to play again"
getch (yesorno)
if yesorno = "1" then
add name, " " ,score to last line of scores.txt
end if
etc..

btw: I'm just doing this at home for fun
Sponsor
Sponsor
Sponsor
sponsor
jonos




PostPosted: Wed Apr 07, 2004 9:08 pm   Post subject: (No subject)

http://www.compsci.ca/v2/viewtopic.php?t=5

Take a look at that tutorial by Dan, its a good tutorial but if you have trouble, just post again.
Tony




PostPosted: Wed Apr 07, 2004 9:51 pm   Post subject: (No subject)

eh, its really easy if you keep just one score. You compare if new one is higher then one in file and if so replace.

Otherwise you'd have to use a sorting algorythm to sort the scores in order and find where to insert new one and shift all others.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
limited_skillz




PostPosted: Wed Apr 07, 2004 10:16 pm   Post subject: (No subject)

read up on record files as well, as they are pretty much made for something like this

actually no, if you want that sorted, it could be a ***** if you dont know what your doing

well i duno, youll need to learn record files next year anyway, just get a head start
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: