Exemplo n.º 1
0
        public void autoRandTestOnce()
        {
            string[]   board     = generateRandomBoard();
            ABoardGame ABGObj    = new ABoardGame();
            string     ABGResult = ABGObj.whoWins(board);

            displayBoard(board);
            Console.WriteLine("Autotest_ABoardGame.autoRandTestOnce: ABGResult = >" + ABGResult + "<");
            Console.WriteLine();
        }
Exemplo n.º 2
0
        public void autoSpecificTests()
        {
            ABoardGame ABGObj = new ABoardGame();

            string[]   board1 = { ".....A", "......", "..A...", "...B..", "......", "......" };
            string[]   board2 = { "AAAA", "A.BA", "A..A", "AAAA" };
            string[]   board3 = { "..", ".." };
            string[]   board4 = { "BBB..BAB...B.B", ".AAAAAAAAAAAA.", "AA.AA.AB..A.AB", "..........B.AB", ".A..BBAB.A.BAB", ".AB.B.......A.", ".A..A.AB.A..AB", ".ABAA.BA...BA.", "BAAAB.....ABA.", ".A....B..A..B.", "B...B....B..A.", "BA.B..A.ABA.A.", "BAAAA.AAAAA.A.", "B.B.B.BB.B...." };
            string[]   board5 = { "..A..AAA..AA", "ABABB..AAAAA", "ABBBBBBBBBA.", "AABBBABABBAA", "...BABABABBA", "B.BA..A.BBA.", "AA.A..B.AB.B", "..BA.B.AABAA", "..ABABBBABA.", ".ABB.BBBBBAA", "ABAAA.AA.A.A", "A..AAA.AAA.A" };
            string[]   board6 = { "B..ABAABBB", "B.........", "A..A.AA..B", "A.BBBAA..A", "B.AAAAB...", "A..BBBBB.A", "B..ABAABBA", "A......B.B", "B......A.A", "BA.AABBB.A" };
            string[][] boards = { board1, board2, board3, board4, board5, board6 };
            Console.WriteLine("Autotest_ABoardGame.autoSpecificTests: boards.Count() = >" + boards.Count() + "< ... boards.Length = >" + boards.Length + "<");

            for (int i = 0; i < boards.Count(); i++)
            {
                displayBoard(boards[i]);
                string ABGResult = ABGObj.whoWins(boards[i]);
                Console.WriteLine("Autotest_ABoardGame.autoSpecificTests: ABGResult = >" + ABGResult + "<"); Console.WriteLine("");
            }
        }