Sign in to follow this  
Followers 0
KurogamineNox

Random word generator?

11 posts in this topic

What would I have to do to create a random word generator?

Share this post


Link to post
Share on other sites



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

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

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

#6 ·  Posted (edited)

It errors because he has a 2 value array and 0-ubound($aswords) is 3 values to random.

Edited by maqleod

[u]You can download my projects at:[/u] Pulsar Software

Share this post


Link to post
Share on other sites

Help fix it? Or other suggestions?

Share this post


Link to post
Share on other sites

#9 ·  Posted (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")
EndIf

Cheers

Edited by smashly

Share this post


Link to post
Share on other sites

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

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites

#11 ·  Posted (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 by Mison

Hi ;)

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