XeReX
05-16-2003, 07:48 AM
I am new with visual basic. I am trying to make a game.
From a file with random words (txt) i want to pick first 3 letters words, then 4 letter words etc.
If the pc picked the first random 3 letter word, then jumble it and you have three guesses. if you are correct then go to the 4 letter word etc.
This is what i have started with:
Private Sub Command3_Click()
Dim FileNum As Integer
FileNum = FreeFile
Open App.Path & ("\words.txt") For Input As FileNum
Do While Not (EOF(FileNum))
i = i + 1
ReDim Preserve wordsArr(i)
Input #FileNum, wordsArr(i)
Loop
For i = 1 To UBound(wordsArr)
List1.AddItem wordsArr(i)
Next i
End Sub
so i can display all the words. As you see, i am very new to VB and my english is not the best yet.
But thanks for you help!
From a file with random words (txt) i want to pick first 3 letters words, then 4 letter words etc.
If the pc picked the first random 3 letter word, then jumble it and you have three guesses. if you are correct then go to the 4 letter word etc.
This is what i have started with:
Private Sub Command3_Click()
Dim FileNum As Integer
FileNum = FreeFile
Open App.Path & ("\words.txt") For Input As FileNum
Do While Not (EOF(FileNum))
i = i + 1
ReDim Preserve wordsArr(i)
Input #FileNum, wordsArr(i)
Loop
For i = 1 To UBound(wordsArr)
List1.AddItem wordsArr(i)
Next i
End Sub
so i can display all the words. As you see, i am very new to VB and my english is not the best yet.
But thanks for you help!