Sign in to follow this  
Followers 0
bf2forlife

Random word generator?

7 posts in this topic

So i know how to do an random number generator using Random function but how u can do it with words?

Share this post


Link to post
Share on other sites



Dim $aWords[10] = ["hi", "test", "hello", "hola", "america", "japan", "korea", "pizza", "spaghetti", "snail"]
MsgBox(0, $aWords[Random(0, 9, 1)], $aWords[Random(0, 9, 1])

Share this post


Link to post
Share on other sites

Dim $aWords[10] = ["hi", "test", "hello", "hola", "america", "japan", "korea", "pizza", "spaghetti", "snail"]
MsgBox(0, $aWords[Random(0, 9, 1)], $aWords[Random(0, 9, 1])
Can u put Send instead of MsgBox? Im pretty new to this :I

Share this post


Link to post
Share on other sites

Can u put Send instead of MsgBox? Im pretty new to this :I

I figured it out myself, thanks

Share this post


Link to post
Share on other sites

Dim $aWords[10] = ["hi", "test", "hello", "hola", "america", "japan", "korea", "pizza", "spaghetti", "snail"]
MsgBox(0, $aWords[Random(0, 9, 1)], $aWords[Random(0, 9, 1])
A better way to do this would be:

Dim $aWords[10] = ["hi", "test", "hello", "hola", "america", "japan", "korea", "pizza", "spaghetti", "snail"]
$random = Random(0, 9, 1)
MsgBox(0, $aWords[$random], $aWords[$random])

That way the randoms are going to be the same, in your example the randoms are likely to be 2 completely different numbers.

Share this post


Link to post
Share on other sites

A better way to do this would be:

Dim $aWords[10] = ["hi", "test", "hello", "hola", "america", "japan", "korea", "pizza", "spaghetti", "snail"]
$random = Random(0, 9, 1)
MsgBox(0, $aWords[$random], $aWords[$random])

That way the randoms are going to be the same, in your example the randoms are likely to be 2 completely different numbers.

I think that was on purpose.

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

A better way to do this would be:

Dim $aWords[10] = ["hi", "test", "hello", "hola", "america", "japan", "korea", "pizza", "spaghetti", "snail"]
$random = Random(0, 9, 1)
MsgBox(0, $aWords[$random], $aWords[$random])

That way the randoms are going to be the same, in your example the randoms are likely to be 2 completely different numbers.

That's the point. Edited by KentonBomb

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