Example #1
0
        public void initializeBord()
        {
            line[] rows = { new line(), new line(), new line(), new line(), new line(), new line(), new line(), new line(), new line() };

            line[] cols = { new line(), new line(), new line(), new line(), new line(), new line(), new line(), new line(), new line() };

            box[] boxes = { new box(), new box(), new box(), new box(), new box(), new box(), new box(), new box(), new box() };

            cell[,] bord = new cell[9, 9];

            for (int i = 0; i < 9; i++)
            {
                for (int ii = 0; ii < 9; ii++)
                {

                    int index;

                    if (i < 3)
                    {
                        if (ii < 3)
                        {
                            index = 0;
                        }
                        else if (ii < 6)
                        {
                            index = 1;
                        }
                        else
                        {
                            index = 2;
                        }
                    }
                    else if (i < 6)
                    {
                        if (ii < 3)
                        {
                            index = 3;
                        }
                        else if (ii < 6)
                        {
                            index = 4;
                        }
                        else
                        {
                            index = 5;
                        }
                    }
                    else
                    {
                        if (ii < 3)
                        {
                            index = 6;
                        }
                        else if ( ii < 6)
                        {
                            index = 7;
                        }
                        else
                        {
                            index = 8;
                        }
                    }

                    bord[i, ii] = new cell(rows[i], cols[ii], boxes[index], 0);
                }
            }

            bord bordid = new bord(bord);
            this.board = bordid;
            this.fixedValues = new bool[9, 9];
        }
Example #2
0
 public bord(cell[,] bordid)
 {
     this.bordid = bordid;
     this.values = new int[9,9];
 }