public static T[] WithRepeatedItem <T>(this SCG.IEnumerable <T> items, Func <T> item, int count, Random random) { var array = items.Concat(item.Repeat(count)).ToArray(); array.Shuffle(random); return(array); }
SCG.IEnumerable <IntermFResult.single_suggestion> rec_down(SCG.IEnumerable <string> pref) { if (payload != null) { yield return new IntermFResult.single_suggestion { steps = pref.ToArray(), val = this } } ; foreach (var kv in D.RangeAll()) { string name_edge = kv.Key; SuggestionTree <Pay> subtree = kv.Value; foreach (var sub_res in subtree.rec_down(pref.Concat(new [] { name_edge }).ToArray())) { yield return(sub_res); } } }