Random number generator c#

  • 68 Views
  • Last Post 3 days ago
Stylus STYLUS posted this 2 weeks ago

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 2 weeks ago

Example

 

Stylus STYLUS posted this 2 weeks ago

Some help??

lucy posted this 3 days ago

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