Computer Science Canada Save High Score!!! (simple and has full explanation) |
Author: | xHoly-Divinity [ Thu Jan 20, 2005 8:36 pm ] | ||
Post subject: | Save High Score!!! (simple and has full explanation) | ||
I've done some experimenting, and have finally figured out an efficient, non confusing way to save high score (or any other info). You must create a text document in the folder of where your program is located called Highscore.txt. When you create it, type in any number value just so that it has a value (you should type in 0 because technically the high score at this time is 0), then save the .txt file. Here's the code!
|
Author: | Tony [ Thu Jan 20, 2005 9:20 pm ] |
Post subject: | |
alright, that's good.. a bit confused about why you're using static arrays of size 1 though ![]() +20Bits for trying though. Try to modify the code a bit to make the file keep track of top 10 highscores and names... shouldn't be that hard ![]() |
Author: | xHoly-Divinity [ Wed Feb 23, 2005 6:28 pm ] |
Post subject: | |
Quote: Try to modify the code a bit to make the file keep track of top 10 highscores and names... shouldn't be that hard Hey tony, I'm running into a few problems with this. In order to save top 10 i would have to compare every single saved score with the score that was earned. Then I would have to place it in the appropriate placing requiring another couple of if statements. Any simpler way of doing this!? |
Author: | jamonathin [ Wed Feb 23, 2005 8:50 pm ] | ||||
Post subject: | |||||
I first got the idea from a previous post that briefly explained a open, put and get, so I just put everything together and got this . . You first need to start with a default base:
Now here's the actual "top10" part, it calculates the position of the newscore and what not.
Well I hope i copy and pasted everything correctly, and i hope it works for yas ![]() |
Author: | HyperFlexed [ Wed Feb 23, 2005 10:06 pm ] |
Post subject: | |
xHoly-Divinity wrote: Quote: Try to modify the code a bit to make the file keep track of top 10 highscores and names... shouldn't be that hard Hey tony, I'm running into a few problems with this. In order to save top 10 i would have to compare every single saved score with the score that was earned. Then I would have to place it in the appropriate placing requiring another couple of if statements. Any simpler way of doing this!? look up the bubble sort. If that fails, I will be posting the source to my final project soon and an example is in there. |
Author: | xHoly-Divinity [ Thu Feb 24, 2005 4:08 pm ] |
Post subject: | |
Thanks man ![]() |