0

:confused: I have to modify a hangman game to open a sequential file, read thru the file and count the no. of words, generate a random no. from the file and read the word from the file corresponding to the random no. and use it in the game, as well as display the no. of the word being used from the file. I know i need to use the objStreamReader in the sub filenewmenuitem_click, but i cant figure out how to get the words to link to the game. Can someone help me??????

5
Contributors
4
Replies
5
Views
13 Years
Discussion Span
Last Post by 3250245
0

to get words to link to the game just write a function that calls for example a text file, then in ure game code, do w/e string name u have, say word, and the name of the function u wrote(getword) ... word = getword("something.txt")

put the something.txt into ure bin folder

0

If you define the 'words' as string * max length or something where the word has a maximum length you can make it a public type and then the file problem becomes a case of reading / writing 'records' (the word public type) and getting the number of records from a file - which is well documented and extremely simple :) try a google search!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.