I have function which randomizes numbers:
public int losuj()
{
Random losowanie = new Random();
int los = losowanie.Next(0, 9);
return los;
}
I want to fill array with numbers generated by losuj
function, so I wrote:
for (int i = 0; i < 9; i++)
for (int j = 0; j < 9; j++)
planszaTab[i, j] = losuj();
Instead of array with random numbers all I get is array fill with the same number ex. 3. Each time I run program I get different number in which array is filled.
What I do wrong?