Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Igglepud
15
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 12th Sep 2010 02:02


For some reason this isn't detecting my Y=1 line required to activate the display of the high score. Y should equal 1 ten times before it moves on, so I am stumped. Any ideas?

Igglepud
15
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 12th Sep 2010 06:33

OK, fixed that part, but now it is printing all 0's and no names.

Igglepud
15
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 12th Sep 2010 07:57

Well, it works, but it's ugly...

Igglepud
15
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 12th Sep 2010 10:27


OK, it was working until I tried writing files. Now the scores work, but the names are all blank space.

Igglepud
15
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 12th Sep 2010 10:35
NVM...it helps to use the right variable name.

bergice
19
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 12th Sep 2010 18:49
Next time use the edit button.

9cdfb439c7876e703e307864c9167a15
Igglepud
15
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 12th Sep 2010 21:08 Edited at: 12th Sep 2010 21:12
Wow...I finally get a post, and THAT'S what I get...friggin' genius.

(edit) Next time post something helpful.

bergice
19
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 12th Sep 2010 23:07 Edited at: 12th Sep 2010 23:10
I wasn't being rude, you seem to have fixed your problem so there's not really anything helpful to post here except for what i just posted. People here usually cant stand people who are rude or don't edit their posts. I can see you already have had people complaining at you for this so change your tactics mate.

9cdfb439c7876e703e307864c9167a15
Igglepud
15
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 13th Sep 2010 01:04
I didn't edit it because I thought seeing the procession in my code would be helpful. Sorry that I misinterpreted your message.

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Sep 2010 11:21 Edited at: 13th Sep 2010 11:24
I saw your message yesterday but was too sick to reply. In the latest version of your code I see that you use two different files to store the scores and two different arrays. You can put both the names and the scores into one array and save/load into one file.



The above is a multi-dimensional array that stores 10 player names and 10 player scores. All arrays have a zero element too so for 10 names you only need to dimensionalize it to 9. Score$(0,0) = the first players name, Score$(0,1) = the first players score, Score$(1,0) = the second players name, Score$(1,1) = the second players score and so on till Score$(9,0) = the tenth players name and Score$(9,1) = the tenth players score.

If you're wondering how you can compare a number to a string and vice versa you use the STR$() command to convert a number to a string and the VAL() command to convert a string to a number.



To save/load the file you do exactly what you had but just make it use one file instead. As long as you load the file exactly how you wrote it, it shouldn't be a problem.

Saving:


Loading:


There is a couple of commands you may have overlooked that can make file saving/loading easier. The SAVE ARRAY and LOAD ARRAY commands can do it all for you and save you some grief.

Saving:


Loading:


Also you don't have to use GOTO to leave the FOR/NEXT loop you can use EXIT to leave any kind of loop. Lets keep away from GOTO.



In the above code snip the FOR/NEXT loop would count up to 2000 if it wasn't for a check to see if t=15 and EXIT moves it out of the FOR/NEXT loop.

Here's my version of a high score list (with both ways):


Igglepud
15
Years of Service
User Offline
Joined: 14th Aug 2010
Location:
Posted: 14th Sep 2010 04:44
Thanks!

Login to post a reply

Server time is: 2026-07-22 12:41:10
Your offset time is: 2026-07-22 12:41:10