Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Randomize()
- blnStartOneWord = True
- blnForceWordNumLetters = True
- Function NumWords(filename)
- Dim objFile, strLine
- Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objFile= objFSO.OpenTextFile(filename, 1)
- Do While Not objFile.AtEndOfStream
- strLine = objFile.readline
- 'WScript.Echo strLine
- intNumLines = intNumLines + 1
- Loop
- objFile.Close
- NumWords = intNumLines
- End Function
- Function GetWord(filename,word_id)
- Dim objFile, strLine
- Dim objFSO: Set objFSO = CreateObject("Scripting.FileSystemObject")
- Set objFile= objFSO.OpenTextFile(filename, 1)
- Do While Not objFile.AtEndOfStream
- intNumLines = intNumLines + 1
- strLine = objFile.readline
- If intNumLines = word_id Then
- GetWord = strLine
- Exit Function
- End If
- Loop
- objFile.Close
- End Function
- Function MakeWord(intNumLetters)
- If blnStartOneWord = True Then
- If blnForceWordNumLetters = True Then
- For x = 1 To intNumLetters
- intCharNum = Int((Rnd * 26) + 1)
- strLetter = chr(123 - intCharNum)
- intWordID = Int((Rnd * NumWords("words\" & strLetter & ".txt")) - 1)
- strWords = strWords & GetWord("words\" & strLetter & ".txt",intWordID) & " "
- Next
- End If
- End If
- intChoiceSayInfo = Int((Rnd * 3) - 1)
- If intChoiceSayInfo = -1 Then
- 'MsgBox "no"
- 'Exit Function
- MakeWord(intNumLetters + 1)
- ElseIf intChoiceSayInfo = 0 Then
- 'MsgBox "maybe"
- 'Exit Function
- MakeWord(intNumLetters + 1)
- ElseIf intChoiceSayInfo = 1 Then
- 'MsgBox "yes " & strWord
- MsgBox strWords
- End If
- End Function
- MakeWord(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement