bf2forlife Posted April 13, 2008 Share Posted April 13, 2008 So i know how to do an random number generator using Random function but how u can do it with words? Link to comment Share on other sites More sharing options...
NELyon Posted April 13, 2008 Share Posted April 13, 2008 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]) Link to comment Share on other sites More sharing options...
bf2forlife Posted April 13, 2008 Author Share Posted April 13, 2008 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 Link to comment Share on other sites More sharing options...
bf2forlife Posted April 13, 2008 Author Share Posted April 13, 2008 Can u put Send instead of MsgBox? Im pretty new to this :II figured it out myself, thanks Link to comment Share on other sites More sharing options...
LogicalAI Posted April 13, 2008 Share Posted April 13, 2008 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 More sharing options...
monoceres Posted April 13, 2008 Share Posted April 13, 2008 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 More sharing options...
NELyon Posted April 13, 2008 Share Posted April 13, 2008 (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 April 13, 2008 by KentonBomb Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now