|
-
May 7th, 2003, 05:58 PM
#1
Thread Starter
Member
randomize a number in c#
how to randomize a number raging 1~100 in c#?
-
May 7th, 2003, 06:39 PM
#2
PowerPoster
Random randomNumber = new Random();
int rndNum = randomNumber.Next(1,100);
That works pretty well, I think it goes by time to get the next random number. There are also other things you can do passing in some values to the Random constructor and things to make it even more random....
-
May 7th, 2003, 09:13 PM
#3
Thread Starter
Member
thanks for help! i will try it out!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|