Sign in to follow this  
Followers 0
onlineth

How to Generate a Random English Word

4 posts in this topic

Hi, I am wondering if it is possible to generate a random word and input it to a variable like $randomword. Is it possible to get the word from a text file like this one-- (word's text file attachment). Thank you so much your help and support!!!

Word's.txt


online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Share this post


Link to post
Share on other sites

try:

$aWords = StringRegExp(FileRead("some.txt"),"(\w+)",3)
$sRandom = $aWords[Random(0,UBound($aWords),1)]
ConsoleWrite($sRandom & @CRLF)
1 person likes this

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

This one does the same:

$File = FileReadToArray("Word's.txt")
$Random = $File[Random(0, UBound($File) - 1, 1)]

MsgBox(64, "Hey", "Here's a random word: " & $Random)
1 person likes this

Share this post


Link to post
Share on other sites

Your Awesome, thank you jdelaney and also thank you Unc3nZureD!!! :thumbsup:


online.png?theme=dark profile for Tom on Stack Exchange, a network of free, community-driven Q&A sites 

scientia potentia est

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0