bf2forlife Posted April 13, 2008 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?
NELyon Posted April 13, 2008 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])
bf2forlife Posted April 13, 2008 Author 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
bf2forlife Posted April 13, 2008 Author Posted April 13, 2008 Can u put Send instead of MsgBox? Im pretty new to this :II figured it out myself, thanks
LogicalAI Posted April 13, 2008 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.
monoceres Posted April 13, 2008 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!
NELyon Posted April 13, 2008 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
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