jeudi 28 mars 2019

How do I make 3 random numbers in C# as a row of 3 in an array and assign each to 3 variables?

I'm trying to generate 3 random numbers and output it onto a label as an array with 3 in a row. I am just unsure about doing so. So far, I initialized my randomValue as

Random valueRandom = new Random();

private void Main()
    {
        for (int i = 1; i <= gameAmountInteger; i++)
            DoNextNumber(valueRandom);
    }


private void DoNextNumber(Random valueRandom)
    {
        int int1;

        int1 = valueRandom.Next(0, 1);

        displayLabel.Text = valueRandom.ToString();
    }

It should be (range of 0 - 10) 3, 5, 2




Aucun commentaire:

Enregistrer un commentaire