Exemplo n.º 1
0
        public int findColDown(kakuroSquare square)
        {
            int length = 0;
            int col    = square.getCol();
            int row    = square.getRow();

            while (true)
            {
                row++;
                Debug.WriteLine("FindDown col is " + col + " row @" + row);
                if (row <= squareCol.ElementAt(col).Count() - 1)
                {
                    Debug.WriteLine("row (" + row + ") is smaller than " + squareCol.ElementAt(col).Count());
                    kakuroSquare nextsqaure = squareCol.ElementAt(col).ElementAt(row);
                    if (nextsqaure.getMode() == 0)
                    {
                        length++;
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            return(length);
        }
Exemplo n.º 2
0
        public int findRowAcross(kakuroSquare square)
        {
            Debug.WriteLine("finding Across length");
            int length = 0;
            int col    = square.getCol();
            int row    = square.getRow();

            while (true)
            {
                col++;
                Debug.WriteLine("FindAcross row is " + row + " col @" + col);
                if (col <= squareCol.Count() - 1)
                {
                    Debug.WriteLine("col (" + col + ") is smaller than " + squareCol.Count());
                    kakuroSquare nextsqaure = squareCol.ElementAt(col).ElementAt(row);
                    if (nextsqaure.getMode() == 0)
                    {
                        length++;
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }
            return(length);
        }