Random number generator c#

  • 336 Views
  • Last Post 17 September 2018
Stylus STYLUS posted this 07 September 2018

Random number generator 6/48

I create form and visual style

Need to create function like on video

Some help

random using c#

Order By: Standard | Newest | Votes
Stylus STYLUS posted this 07 September 2018

Example

 

Stylus STYLUS posted this 11 September 2018

Some help??

lucy posted this 17 September 2018

To random 6/48 you can write as the following

public string Random648()
{
    List<int> data = new List<int>();
    //Init data from 1-48
    for (int i = 1; i <= 48; i++)
        data.Add(i);
    Random rnd = new Random();
    string value = string.Empty;
    for (int v = 0; v < 6; v++)
    {
        //Random data, then delete the random value
        int x = data[rnd.Next(0, data.Count)];
        data.Remove(x);
        value += $" {x}";
    }
    return value;
}
Close