Sign in to follow this  
Followers 0
gerbilbunny

Random word generator

3 posts in this topic

Hi,

I'm completely new to programming and have only made various small programs so far. What i was wondering was if someone could help me by giving me some guidance on an example for my next program.

I want to create a program that selects a random word from a list in a .txt file or similar and then enters it into a box (set co-ordinates) and then hits enter. But i want this to happen at random intervals which can be set by the user.

Thanks in advance.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Take a look in the Help file.

Random function

;Flip of coin
If Random() < 0.5 Then  ; Returns a value between 0 and 1.
    $msg = "Heads. 50% Win"
Else
    $msg = "Tails. 50% Loss"
Endif
MsgBox(0,"Coin toss", $msg )

;Roll of a die
msgBox(0, "Roll of die", "You rolled a " & Random(1, 6, 1) )oÝ÷ ÙvƯj[&jËZÖ«uú+«b'â殶­sbb33c·f"Òæ&VBgV÷C´3¢b3#µFV×b3#¶×fÆRæægV÷C²ÂgV÷C·6V7Föã"gV÷C²ÂgV÷C¶¶WgV÷C²ÂgV÷C´æ÷Df÷VæBgV÷C²¤×6t&÷CbÂgV÷Cµ&W7VÇBgV÷C²Âb33c·f"
Edited by walle

Share this post


Link to post
Share on other sites

While 1
Dim $Wordlist[6] = ["Tom","Sam", "Joey", "Dave", "Mike", "Paul"]

$i = Random(0,5,1)
Msgbox(0,"",$Wordlist[$i])
WEnd

Good luck!

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