jca Posted March 21, 2005 Author Posted March 21, 2005 Hi! I have to generate two numbers. One between 1 to 9 (1,2,3,4,5,6,7,8,9) and one between 1 to 26 (1,2,...,25,26). I tried the random function, but I only know how to generate from 1 to 100 or 1000... Anyone have a formula?? Thank you! jca
jca Posted March 21, 2005 Posted March 21, 2005 Hi! I have to generate two numbers. One between 1 to 9 (1,2,3,4,5,6,7,8,9) and one between 1 to 26 (1,2,...,25,26). I tried the random function, but I only know how to generate from 1 to 100 or 1000... Anyone have a formula?? Thank you! jca
BrentHedden Posted March 21, 2005 Posted March 21, 2005 If all you want are integers from 1 to 9, here is a simple calc - Int( (Random* 9) + 1 ) To get it to 26, just replace the 9 with 26 in the calculation. The +1 is necessary so that the ceiling number will be included.
BrentHedden Posted March 21, 2005 Posted March 21, 2005 If all you want are integers from 1 to 9, here is a simple calc - Int( (Random* 9) + 1 ) To get it to 26, just replace the 9 with 26 in the calculation. The +1 is necessary so that the ceiling number will be included.
jca Posted March 21, 2005 Author Posted March 21, 2005 thank you for your help... I had setup a much more complex script. that was looping until the number was between 1 and 26 hehe thank you!
jca Posted March 21, 2005 Author Posted March 21, 2005 thank you for your help... I had setup a much more complex script. that was looping until the number was between 1 and 26 hehe thank you!
Recommended Posts
This topic is 7190 days old. Please don't post here. Open a new topic instead.
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