Пример #1
0
        public void PlayGame()
        {
            Home.GoToPage();

            string test = Home.cell0.Text;

            Home.cell1.SendKeys(test);
            //Initialise the values for the puzzle
            List <string> grid = new List <string>();
            {
                grid.Add("");
                grid.Add("");
                grid.Add("");
                grid.Add("");
                grid.Add("");
                grid.Add("");
                grid.Add("7");
                grid.Add("");
                grid.Add("");
            }

            List <int> ColTotal = new List <int>();
            {
                ColTotal.Add(10);
                ColTotal.Add(9);
                ColTotal.Add(8);
            }


            List <int> RowTotal = new List <int>();
            {
                RowTotal.Add(13);
                RowTotal.Add(7);
                RowTotal.Add(3);
            }


            List <string> RsubTotal = new List <string>();
            {
                RsubTotal.Add("");
                RsubTotal.Add("");
                RsubTotal.Add("");
            }

            List <string> CsubTotal = new List <string>();
            {
                CsubTotal.Add("");
                CsubTotal.Add("");
                CsubTotal.Add("");
            }


            //Define groups of squares 'subsets' that must contain numbers 1 to 9

            List <int> sqr1 = new List <int>(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 });


            //Fill in the blanks with initial values ("123456789")
            InitialiseSquares(grid);
            PrintTheGrid(grid, RsubTotal, CsubTotal);

            CalculateSubtotals(ColTotal, RowTotal, grid, CsubTotal, RsubTotal);
            PrintTheGrid(grid, RsubTotal, CsubTotal);

            FilterGrid(grid, sqr1);
            PrintTheGrid(grid, RsubTotal, CsubTotal);
        }//end main
Пример #2
0
 public PlayTest()
 {
     Home      = new Home();
     Utilities = new Utilities();
 }