
-----------------------------------
DarkMastermind
Mon Jun 20, 2005 5:32 pm

Window.Open and opening a written file
-----------------------------------
I am trying to make a Pacman-type game, and at the end I would like to display a high-score table... The way I was planning on doing this was by writing to a file the user's score, then opening a new window and outputting the information stored in the file, which would probably be "highscores.txt" or whatever. I can't remember how I would take the user's name, score, and time to put into the file. So far, I have the very first line, I think, with variables already declared:
open: file, "highscores.txt",put
I'm not sure where to go after that... Someone please refresh my memory?

-----------------------------------
Cervantes
Mon Jun 20, 2005 6:16 pm


-----------------------------------
Instad of opening with the intension of putting stuff, open if for put.  Get all the data into an array, add the current user's score to the array (you should be using a flexible array), sort the array, then write the top 10 (or whatever) elements back.
For flexible arrays and file I/O, there are tutorials in the Turing Tutorials section.  For sorting, check the Turing source code forum for a topic by Zylum called "sorting procedures".
