How to use Rand()
How to use Rand()
How to use Random function (C#) when you need to select random item from two dimensional array?
MP
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to use Rand()
That`s quite easy. Generate a random number between your array range in the 2 dimensions
.e.g.
Best regards,
christian
Ranorex Supoort Team
.e.g.
// for Array[100][80] Random random = new Random(); int xPos = random.Next(100); int yPos = random.Next(80);and take the array content from your random position.
Best regards,
christian
Ranorex Supoort Team