public static List <int> MakeSequenceUnder(NextSequenceElement generateNext, int first, int max, params int[] inputs) { List <int> results = new List <int>(); results.Add(first); while (generateNext(inputs).Item1 < max) { Tuple <int, int[]> temp = generateNext(inputs); results.Add(temp.Item1); inputs = temp.Item2; } return(results); }
public static List <int> MakeSequence(NextSequenceElement generateNext, int first, int length, params int[] inputs) { List <int> results = new List <int>(); results.Add(first); for (int i = 0; i < length; i++) { Tuple <int, int[]> temp = generateNext(inputs); results.Add(temp.Item1); inputs = temp.Item2; } return(results); }
public static List<int> MakeSequenceUnder(NextSequenceElement generateNext, int first, int max, params int[] inputs) { List<int> results = new List<int>(); results.Add(first); while (generateNext(inputs).Item1 < max) { Tuple<int, int[]> temp = generateNext(inputs); results.Add(temp.Item1); inputs = temp.Item2; } return results; }
public static List<int> MakeSequence(NextSequenceElement generateNext, int first, int length, params int[] inputs) { List<int> results = new List<int>(); results.Add(first); for (int i = 0; i < length; i++) { Tuple<int, int[]> temp = generateNext(inputs); results.Add(temp.Item1); inputs = temp.Item2; } return results; }