Computer Science Canada help puting high scores in |
Author: | roosterfest123 [ Mon Jun 20, 2011 3:07 pm ] | ||
Post subject: | help puting high scores in | ||
hi im trying to put highscores in my program but cant figure out how, plz help
|
Author: | ProgrammingFun [ Mon Jun 20, 2011 3:17 pm ] |
Post subject: | RE:help puting high scores in |
What have you done to solve the problem? Do you want the highscores to save so that they can be seen the next time the program is run too? Have you tried creating a page to display the information? |
Author: | roosterfest123 [ Mon Jun 20, 2011 3:26 pm ] |
Post subject: | RE:help puting high scores in |
iv tried putting in an input file and putting the information to it but it didn't work so i basically rage quit |
Author: | roosterfest123 [ Mon Jun 20, 2011 3:30 pm ] |
Post subject: | RE:help puting high scores in |
so yes but i guess i did it wrong |
Author: | ProgrammingFun [ Mon Jun 20, 2011 3:32 pm ] | ||
Post subject: | Re: RE:help puting high scores in | ||
roosterfest123 @ Mon Jun 20, 2011 3:26 pm wrote: iv tried putting in an input file and putting the information to it but it didn't work so i basically rage quit
Not the best way to go about programming lol Can you describe/code what you did so we can see what didn't work? Were you getting an error or did it just not function properly? You would have to follow the following order:
EDIT: Please don't double post, just use the EDIT button |
Author: | roosterfest123 [ Mon Jun 20, 2011 3:48 pm ] |
Post subject: | RE:help puting high scores in |
iv tried what u said before and it didn't work |
Author: | ProgrammingFun [ Mon Jun 20, 2011 3:58 pm ] |
Post subject: | Re: RE:help puting high scores in |
ProgrammingFun @ Mon Jun 20, 2011 3:32 pm wrote: Can you describe/code what you did so we can see what didn't work?
Please give the code that didn't work... |
Author: | roosterfest123 [ Mon Jun 20, 2011 4:11 pm ] |
Post subject: | RE:help puting high scores in |
lol i deleted the code and raged quit. so its long gone but what i did was open: inputfile,"highscore.txt" - makes new file put inputfile, count put inputfile, name close (input file) then i opened the file and got the information then put in the program |
Author: | Tony [ Mon Jun 20, 2011 4:27 pm ] |
Post subject: | RE:help puting high scores in |
Ok. That works for the first play. On the second play, how would you figure out if the new score is better than what's in the file? |
Author: | roosterfest123 [ Mon Jun 20, 2011 4:42 pm ] |
Post subject: | RE:help puting high scores in |
well i would sort it right but the thing is when i run the program it doesnt even enter the info into the .txt file it makes a different one and keeps it empty |
Author: | roosterfest123 [ Mon Jun 20, 2011 4:46 pm ] |
Post subject: | RE:help puting high scores in |
open : inputFile, "highscore.txt", put put inputFile, count put inputFile, name close (inputFile) |
Author: | RandomLetters [ Mon Jun 20, 2011 5:15 pm ] |
Post subject: | Re: RE:help puting high scores in |
ProgrammingFun @ Mon Jun 20, 2011 3:32 pm wrote: roosterfest123 @ Mon Jun 20, 2011 3:26 pm wrote: iv tried putting in an input file and putting the information to it but it didn't work so i basically rage quit
Not the best way to go about programming lol What are you talking about? I do it all the time, and my programs turn out half complete. open : inputFile, "highscore.txt", put put inputFile, count put inputFile, name close (inputFile) That's not the right syntax for reading files. open |
Author: | crossley7 [ Mon Jun 20, 2011 8:51 pm ] | ||
Post subject: | Re: help puting high scores in | ||
it is put : inputFile, (insert variable here) which will put that variable into the file. Here is an example of the relevant code from one of my games that i made last year in spare time (I tend to make a lot of crappy games incorporating random features... this one had highscores). It should show you how to do your own highscores
|