Skip to content

Instantly share code, notes, and snippets.

@DaniCCardenas
Created February 1, 2018 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DaniCCardenas/1f1e06698caf662b0390f34fbe1450ea to your computer and use it in GitHub Desktop.
Save DaniCCardenas/1f1e06698caf662b0390f34fbe1450ea to your computer and use it in GitHub Desktop.
static void EjemploRandom3()
{
for (int i = 0; i <= 10; i++)
{
var guid = Guid.NewGuid();
var justNumbers = new String(guid.ToString().Where(Char.IsDigit).ToArray());
var seed = int.Parse(justNumbers.Substring(0, 4));
var random = new Random(seed);
var value = random.Next(0, 5);
Console.WriteLine($"Iteración {i} - semilla {seed} - valor {value}");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment