Computer Science Canada

Need help keeping high scores

Author:  Tony_200004 [ Thu Dec 04, 2003 9:50 pm ]
Post subject:  Need help keeping high scores

Hey... i am making a blackjack game for my ISU... my teacher asked me to get a high score system involved in it... i have already got it so money is added just need to know how to save that file... also how do you make is so the program is a .exe.... and one last thing cant post the code because am not taking the chance of them thinking i plagurised... so please help me as best as you can without seeing my code.. thanks

Author:  poly [ Thu Dec 04, 2003 9:54 pm ]
Post subject: 

well to make program a .exe just goto RUN in menu than GENERATE STAND-ALONE PROGRAM

Author:  Andy [ Thu Dec 04, 2003 9:57 pm ]
Post subject: 

i'm assuming you already know arrays(read my tutorial on arrays if you dont), so this is the basic concept, at the beginning of the game, you load in the file, and at the end of the game you save it
code:
var fn : int %this is the file ID
open : fn, "scores.txt", get
for i : 1 .. 10
    get : fn, score (i)
end for

close : fn

open : fn, "scores.txt", put
for i : 1 .. 10
    put : fn, score (i)
end for
close:fn

Author:  nelson [ Thu Dec 04, 2003 10:08 pm ]
Post subject:  asdf

i submitted reversi , go check it out

i used two textfiles for highscore

one for name and one for score ^^

and use the codes the guy wrote above~


: