Hey guys,
Can anyone help me with this, please? So I want to set up a game where a number of characters (up to 4) play a game. At the start of the game some dice are thrown and one score is divided by another and added to ten. I want to store the data in a file but I don't know how to reopen a file and put in new information. So I want to store some data, close the file and then be able to open it and add more without deleting the original content. My code is below. Please help!
Thanks, Sam :)
Code:
INPUT "Enter filename: " filename$
INPUT "Enter number of players: " plays%
FOR times%=1 TO plays%
filename$ = filename$ + ".txt"
filenum = OPENOUT(filename$)
INPUT "Enter character's name: " c$
strength1% = 10
skill1% = 10
strength2% = strength1%+(RND(12)/RND(4))
skill2% = skill1%+(RND(12)/RND(4))
PRINT ""
PRINT ""
PRINT c$ "'s strength is: "; strength2%
PRINT ""
PRINT c$ "'s skill is: "; skill2%
PRINT#filenum, c$ + "'s strength is: " + STR$(strength2%)
PRINT#filenum, c$ + "'s skill is: " + STR$(skill2%)
CLOSE#filenum
NEXT times%
END
CLOSE#filenum