Ejemplo n.º 1
0
 public static RandomSequence Generate(int length, byte sbCount, IntRngFunc rng)
 {
     var seq = new RandomSequence(length, sbCount);
     for (int i = 0; i<length; i++)
         seq.data.Add(rng(sbCount));
     return seq;
 }
Ejemplo n.º 2
0
 public static RandomSequence Load(string filePath, byte sbCount)
 {
     var splitChars = new[] {'\t', '\r', '\n'};
     string text = File.ReadAllText(filePath);
     string[] splitText = text.Split(splitChars, StringSplitOptions.RemoveEmptyEntries);
     var seq = new RandomSequence(splitText.Length, sbCount);
     for (int i = 0; i<splitText.Length; i++)
         seq.data.Add(int.Parse(splitText[i]));
     return seq;
 }