KurogamineNox 0 Posted September 22, 2010 What would I have to do to create a random word generator? Share this post Link to post Share on other sites
AdmiralAlkex 125 Posted September 22, 2010 Like this? Local $asWords[2] = ["Boat", "Car"] MsgBox(0, "Here's a word for you", $asWords[Random(0, UBound($asWords), 1)]) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Share this post Link to post Share on other sites
KurogamineNox 0 Posted September 22, 2010 That is one way, though your code seems to error at times. I was thinking of like having it generate a word and storing it in a variable for later uses. If possible able to make words without having to list words(If possible) Ill go with any suggestion. Share this post Link to post Share on other sites
maqleod 1 Posted September 23, 2010 There is no way you can get something to list words without some sort of list to verify they are actually words, otherwise you'll just get jumbles of letters returned. [u]You can download my projects at:[/u] Pulsar Software Share this post Link to post Share on other sites
KurogamineNox 0 Posted September 23, 2010 There is no way you can get something to list words without some sort of list to verify they are actually words, otherwise you'll just get jumbles of letters returned.That is what I was thinking lol, but creating a big list of words is time consuming. Well results are results, I just don't know why the guys code crashes at times. Share this post Link to post Share on other sites
maqleod 1 Posted September 23, 2010 (edited) It errors because he has a 2 value array and 0-ubound($aswords) is 3 values to random. Edited September 23, 2010 by maqleod [u]You can download my projects at:[/u] Pulsar Software Share this post Link to post Share on other sites
KurogamineNox 0 Posted September 23, 2010 Help fix it? Or other suggestions? Share this post Link to post Share on other sites
maqleod 1 Posted September 23, 2010 Local $asWords[2] = ["Boat", "Car"] MsgBox(0, "Here's a word for you", $asWords[Random(0, UBound($asWords) -1, 1)]) [u]You can download my projects at:[/u] Pulsar Software Share this post Link to post Share on other sites
smashly 12 Posted September 23, 2010 (edited) Hi, the net is a great place to get word lists, saves you having to write them out yourself.I used http://dictionary-thesaurus.com/Wordlists.html to get an Adjectives list.Here's what I mean give the script a second to get the word list.#Include <File.au3> Global $sFile = @ScriptDir & "\Adjectives(929).txt" Global $sFileSource = "http://dictionary-thesaurus.com/wordlists/Adjectives%28929%29.txt" Global $aWord_Adjectives, $iMsg If Not FileExists($sFile) Then InetGet ($sFileSource, $sFile) If FileExists($sFile) Then _FileReadToArray($sFile, $aWord_Adjectives) If Not @error Then Do $iMsg = MsgBox(65, "Random Adjective", StringUpper($aWord_Adjectives[Random(1, $aWord_Adjectives[0], 1)]) & @LF & @LF & "Click Ok for another word") Until $iMsg = 2 EndIf Else MsgBox(64, "Not Found", "Word file not found") EndIfCheers Edited September 23, 2010 by smashly Share this post Link to post Share on other sites
AlmarM 22 Posted September 23, 2010 Random words without storing them you say? This is like the closest I can get. Global $Pattern = "Xooxxo" MsgBox(0, "", "Your random word: " & _RandomWord($Pattern)) Func _RandomWord($sPattern) Local $aSplit = StringSplit($sPattern, "") Local $aXList = StringSplit("bcdfghjklmnpqrstvwxyz", "") Local $aOList = StringSplit("aeiou", "") Local $sReturn = "" For $i = 1 To $aSplit[0] If ($aSplit[$i] == "X") Then $sReturn &= StringUpper($aXList[Random(1, $aXList[0], 1)]) ElseIf ($aSplit[$i] == "x") Then $sReturn &= $aXList[Random(1, $aXList[0], 1)] ElseIf ($aSplit[$i] == "O") Then $sReturn &= StringUpper($aOList[Random(1, $aOList[0], 1)]) ElseIf ($aSplit[$i] == "o") Then $sReturn &= $aOList[Random(1, $aOList[0], 1)] EndIf Next Return $sReturn EndFunc MinesweeperA minesweeper game created in autoit, source available._Mouse_UDFAn UDF for registering functions to mouse events, made in pure autoit.2D Hitbox EditorA 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Share this post Link to post Share on other sites
Mison 1 Posted September 23, 2010 (edited) Maybe you can use this information to create something out of nothing.. The most used letters in the English language: Top 5 - "ETAIN" Top 6 - "ETAOIN" Top .. "ETAON RISHD LFCMU GYPWB VKXJQ Z" The most common letter pairs as "TH HE AN RE ER IN ON AT ND ST ES EN OF TE ED OR TI HI AS TO" The most common doubled letters as "LL EE SS OO TT FF RR NN PP CC" http://en.wikipedia.org/wiki/Letter_frequency http://letterfrequency.org/ Edited September 23, 2010 by Mison Hi ;) Share this post Link to post Share on other sites