예제 #1
0
파일: TestHelper.cs 프로젝트: flyer87/C6
        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);
        }
예제 #2
0
        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);
                }
            }
        }