Jump to content

Random word generator?


Recommended Posts

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.

Link to comment
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!

Link to comment
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.

That's the point. Edited by KentonBomb
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...