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.

DarkBASIC Discussion / ScoreTable

Author
Message
Juventus
22
Years of Service
User Offline
Joined: 22nd Apr 2003
Location: Australia
Posted: 8th Jun 2003 10:20
I would like to implement a HighScores table that lists the top scores in descending order. Has anyone tried to do this? I would need to use a sorting algorithm of some type, any suggestions there?

Thanks.
"Yah-hah, evil spider woman! I have captured you by
the short rabbits and can now deliver you violently to
your gynecologist for a thorough extermination."
Juventus
22
Years of Service
User Offline
Joined: 22nd Apr 2003
Location: Australia
Posted: 8th Jun 2003 18:48
It's OK, I think I've worked this one out.

"Yah-hah, evil spider woman! I have captured you by
the short rabbits and can now deliver you violently to
your gynecologist for a thorough extermination."
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 8th Jun 2003 20:26
Pretty Easy, isn't it?

---Mattman
"Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done." Andy Rooney
Juventus
22
Years of Service
User Offline
Joined: 22nd Apr 2003
Location: Australia
Posted: 10th Jun 2003 17:07
Well it would be, but DB doesn't want to compare the saved score with the new. ie:

NewScore = 20

If NewScore > ScoreTable(10) `ScoreTable(10) being equal to 0

^In the above DB determines that NewScore [which = 20] is NOT bigger than ScoreTable(10) [which = 0]

So I tried:

If NewScore < ScoreTable(10) `ScoreTable(10) being equal to 0

This time DB determines that NewScore is NOT smaller either. Yes I tried = as well. DB thinks it not equal. If it's not bigger, smaller or equal, what is it?

I don't expect any help really. Just wanted to express some frustration.

http://www.geocities.com/jux_of_my_newt/
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 11th Jun 2003 00:25 Edited at: 11th Jun 2003 19:51
What is the "`ScoreTable(10) being equal to 0" for?

---Mattman
"Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done." Andy Rooney
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 11th Jun 2003 07:04
the : command denotes a new command being issued on the same line.

good



bad



Juventus
22
Years of Service
User Offline
Joined: 22nd Apr 2003
Location: Australia
Posted: 11th Jun 2003 10:25
I didn't acually use that notation in my code anyway, who the hell would? Just put it there to show others what the value literally is.
Sorry that it appears to have been confusing.
In code I ALWAYS use another line. Pity there was no help on the actual problem then...

http://www.geocities.com/jux_of_my_newt/
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 11th Jun 2003 12:18
Heh

You've said: "It's OK, I think I've worked this one out," so I'm not sure if you still need help.

This may or may not have anything to do with your problem. When you DIM an array, you enter the number of cells it will have, ie: 10. However, when you access an array's cells, you don't access cells labeled "1" through "10," but rather "0" through "9." Perhaps when you call a nonexistant cell entry, it goes to the next area in memory, and who knows what that may be!

Juventus
22
Years of Service
User Offline
Joined: 22nd Apr 2003
Location: Australia
Posted: 11th Jun 2003 12:25
Thanks, although I don't think it's that. I have the same comparison problem with any of the other values stored in the array too.
ie ScoreTable(9).
I'm just gonna try a complete rewrite. I've got nothing (sortof) to lose here.

http://www.geocities.com/jux_of_my_newt/
Hell IVIonkey
22
Years of Service
User Offline
Joined: 1st Apr 2003
Location: Outer Limits
Posted: 11th Jun 2003 12:42 Edited at: 11th Jun 2003 12:42
Are you sure the comparisons aren't working correctly?

Are you testing the results of the comparison by continuing your code, or are you putting an interrupt in to let you know exactly what happened?
I mean like:


Login to post a reply

Server time is: 2025-05-18 16:15:01
Your offset time is: 2025-05-18 16:15:01