Esempio n. 1
0
        private static List <Result> findResults(List <List <int> > inputList)
        {
            List <Result> results = new List <Result>();

            // find all result combination
            for (int i = 0; i < inputList.Count; i++)
            {
                if (i == 0)
                {
                    PyramidUtils.generateFirstResults(inputList[i], results);
                }
                else
                {
                    List <Result> newResults = new List <Result>();
                    foreach (Result result in results)
                    {
                        List <Result> tempResults = PyramidUtils.findNextNumbersResults(inputList[i], result);
                        if (tempResults != null)
                        {
                            newResults.AddRange(tempResults);
                        }
                    }

                    results.Clear();

                    results.AddRange(newResults);
                }
            }

            return(results);
        }
Esempio n. 2
0
 public bool isLastPointEven()
 {
     return(PyramidUtils.isEven(path[path.Count - 1]));
 }