Exemplo n.º 1
0
 private void Complete(Table table)
 {
     for (int i = 1; i < Row; i++)
     {
         DeleteMethod(table, i);
     }
 }
Exemplo n.º 2
0
 private void DeleteMethod(Table table, int i)
 {
     for (int j = 0; j < Column; j++)
     {
         if (!table.Checked[i - 1, j])
             table.Click(i, j);
     }
 }
Exemplo n.º 3
0
 private bool BottomRowCheckComplete(Table table)
 {
     int Row = this.Row;
     for (int j = 0; j < Column; j++)
     {
         if (!table.Checked[Row - 1, j])
             return false;
     }
     return true;
 }
Exemplo n.º 4
0
        private void FirstRowTree(Table table, int j)
        {
            if (j < Column)
            {
                Table table1 = new Table(table);
                table1.Click(0, j);
                FirstRowTree(table, j + 1);
                FirstRowTree(table1, j + 1);

            }
            else if (j == Column)
            {
                Complete(table);
                if (BottomRowCheckComplete(table))
                {
                    Solutions.Add(table);
                }
            }
        }
Exemplo n.º 5
0
        public Table(Table Copy)
        {
            int Row = this.Row = Copy.Row;
            int Column = this.Column = Copy.Column;

            bool[,] Clicked = Copy.Clicked;
            bool[,] Checked = Copy.Checked;
            bool[,] newClicked = this.Clicked = new bool[Row, Column];
            bool[,] newChecked = this.Checked = new bool[Row, Column];

            for (int j = 0; j < Column; j++)
            {
                newClicked[0, j] = Clicked[0, j];
                newChecked[0, j] = Checked[0, j];
            }
            for (int j = 0; j < Column; j++)
            {
                newChecked[1, j] = Checked[1, j];
            }
        }