public static IEnumerable <char[]> GetWordListFractalsWithMaskedFractals(IEnumerable <string> wordList, char[] fractalList, int maxDepth) { var fractalbases = AlphaFractalBases; foreach (var word in wordList) { var wordPermuations = word.Select(x => fractalbases[x]).ToList(); var jaggedSingle = new EnumerableJaggedArray <char>(wordPermuations.ToArray()); foreach (var jagged in jaggedSingle) { var seriesIterator = new SeriesIteratorOfChar(jagged, fractalList, maxDepth); foreach (var iter in seriesIterator) { yield return(iter); } } } }
public static void RunBaseDigitTests() { var root = "aaaaaaaa".ToCharArray(); var iSet = "0123456789".ToCharArray(); var it = new SeriesIteratorOfChar(root, iSet, 4); var sw = Stopwatch.StartNew(); int lastDepth = 0; ulong count = 0; foreach (var item in it) { count++; if (item.Length != lastDepth) { lastDepth = item.Length; Console.WriteLine($"Depth {lastDepth}: {count} items in {sw.Elapsed}"); sw = Stopwatch.StartNew(); } } }