
-----------------------------------
xHoly-Divinity
Thu Jan 20, 2005 8:27 pm

Easy way to saving HIGH SCORE!!! (source code, chek it out)
-----------------------------------
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!


            var check : array 1 .. 1 of int
            %Assigns pathName to 'Highscore.txt'
            const pathName : string := "Highscore.txt"
            var f : int
            %Opens the file to check the old high score
            open : f, pathName, get
            get : f, check (1)
            %Closes the text file
            close : f
            %Checks to see if the new score is higher than the old score
            if score > check (1) then
                %If it is, it will open the file and save the new high score
                open : f, pathName, put
                put : f, score
                close : f
            end if
            %This procedure (same as above) opens 'Highscore.txt'
            var one : int
            var sss : array 1 .. 1 of int
            open : one, "Highscore.txt", get
            get : one, sss (1)
            put "                              HIGH SCORE: ", sss (1)


-----------------------------------
Andy
Thu Jan 20, 2005 8:29 pm


-----------------------------------
this belongs to source code, moved

-----------------------------------
Cervantes
Thu Jan 20, 2005 8:31 pm


-----------------------------------
[url=http://www.compsci.ca/v2/viewtopic.php?t=5340]psst :wink:

-----------------------------------
xHoly-Divinity
Thu Jan 20, 2005 8:34 pm


-----------------------------------
Cerevantes, that source code is 10x longer, and 10x harder to understand

-----------------------------------
Andy
Thu Jan 20, 2005 8:42 pm


-----------------------------------
yea and about 100 times better... at least read his code.. it contains alot more than just adding high scores

-----------------------------------
xHoly-Divinity
Thu Jan 20, 2005 8:46 pm


-----------------------------------
That's why everyone is complaining that it doesn't work and that they don't understand it :wink:

-----------------------------------
Andy
Thu Jan 20, 2005 8:51 pm


-----------------------------------
i have a question for you, have u even ran the code? the ppl who posted there didnt have a clue waht the program was for, would u like me to abuse your code then tell you it doesnt work? of course not, so take his code, run it, and then see how it works, why it works, then past judgement on his works

-----------------------------------
Shyfire
Fri Jan 21, 2005 2:27 pm


-----------------------------------
both u 2 stop fighting both codes work who cares whos is better

-----------------------------------
Andy
Fri Jan 21, 2005 3:54 pm


-----------------------------------
im guessing you never ran his code either

-----------------------------------
[Gandalf]
Fri Jan 21, 2005 4:27 pm


-----------------------------------
i have a question for you, have u even ran the code? the ppl who posted there didnt have a clue waht the program was for, would u like me to abuse your code then tell you it doesnt work? of course not, so take his code, run it, and then see how it works, why it works, then past judgement on his works

I take that to offence  :( 

naw, im OK, but I did get a high score system to work - the only problem : it doesn't have a "sorting" system.  Which I see that this code doesn't have - and also could include more than one score.  Anyway, they're both good in different ways, simplicity and wholeness - nobody should be attacked for trying to help out (I think :roll:  lol).

-----------------------------------
zomg
Fri Jan 21, 2005 6:04 pm


-----------------------------------
"] nobody should be attacked for trying to help out (I think :roll:  lol).

i agree... unless the person isnt helping out in anyway.  but this one here helps newb programmers to learn just the basic I/O which is good because it doesnt get all complex. because when things start get complex ppl just tend to leave it, especially if there noobs

-----------------------------------
MiX-MaztA-M8riX
Tue Jan 25, 2005 11:56 am


-----------------------------------
 ... because when things start get complex ppl just tend to leave it, especially if there noobs ... 

Maybe thats why half the 'N00bz0r5' or w/e you ppl call it these days, havent even ran the code  :wink:
