Ejemplo n.º 1
0
void test_count_unknown_squares() {
    int board[MAX_SIZE][MAX_SIZE];

    // test case 1
    string test_board_1[] = {"O-OX",
                             "OO--",
                             "X---",
                             "-O--"};
    int size_1 = 4;
    read_board_from_string(board, test_board_1, size_1);
    cout << count_unknown_squares(board, size_1) << endl;

     // test case 2
    string test_board_2[] = {"-OX---",
                             "OO--X-",
                             "X-----",
                             "-O--OO",
                             "X-----",
                             "------"};

         int size_2 = 6;
    read_board_from_string(board, test_board_2, size_2);
    cout << count_unknown_squares(board, size_2) << endl;                        


    // add more tests here
}
Ejemplo n.º 2
0
void test_count_unknown_squares() {
    cout << "Begin testing count unknown squares" << endl;
    
    int board[MAX_SIZE][MAX_SIZE];

    // test case 1
    string test_board_1[] = {"O-OX",
                             "OO--",
                             "X---",
                             "-O--"};
    int size_1 = 4;
    read_board_from_string(board, test_board_1, size_1);
    cout << count_unknown_squares(board, size_1) << endl;

    // test case 2
    string test_board_2[] = {"----",
                             "OOO-",
                             "-XX-",
                             "--O-"};
    int size_2 = 4;
    read_board_from_string(board, test_board_2, size_2);
    cout << count_unknown_squares(board, size_2) << endl;
    
    // test case 3
    string test_board_3[] = {"X-XX",
                             "OO-O",
                             "-X-X",
                             "O-O-"};
    int size_3 = 4;
    read_board_from_string(board, test_board_3, size_3);
    cout << count_unknown_squares(board, size_3) << endl;
    
    cout << "End testing count unknown squares" << endl;
}