double test4() { string t0[] = {"BWBBWBB", "WWBWWBW", "BBBBBBW", "WBBBBWB", "BBWWWWB", "WWWWWWW", "BBWWBBB"}; vector <string> p0(t0, t0+sizeof(t0)/sizeof(string)); AlienAndGame * obj = new AlienAndGame(); clock_t start = clock(); int my_answer = obj->getNumber(p0); clock_t end = clock(); delete obj; cout <<"Time: " <<(double)(end-start)/CLOCKS_PER_SEC <<" seconds" <<endl; int p1 = 9; cout <<"Desired answer: " <<endl; cout <<"\t" << p1 <<endl; cout <<"Your answer: " <<endl; cout <<"\t" << my_answer <<endl; if (p1 != my_answer) { cout <<"DOESN'T MATCH!!!!" <<endl <<endl; return -1; } else { cout <<"Match :-)" <<endl <<endl; return (double)(end-start)/CLOCKS_PER_SEC; } }
// BEGIN CUT HERE void main( int argc, char* argv[] ) { { string boardARRAY[] = {"BB", "WW"}; vector <string> board( boardARRAY, boardARRAY+ARRSIZE(boardARRAY) ); AlienAndGame theObject; eq(0, theObject.getNumber(board),4); } { string boardARRAY[] = {"W"}; vector <string> board( boardARRAY, boardARRAY+ARRSIZE(boardARRAY) ); AlienAndGame theObject; eq(1, theObject.getNumber(board),1); } { string boardARRAY[] = {"WBBB", "WBBB", "WWWW"}; vector <string> board( boardARRAY, boardARRAY+ARRSIZE(boardARRAY) ); AlienAndGame theObject; eq(2, theObject.getNumber(board),9); } { string boardARRAY[] = {"W", "B", "W", "W", "W"}; vector <string> board( boardARRAY, boardARRAY+ARRSIZE(boardARRAY) ); AlienAndGame theObject; eq(3, theObject.getNumber(board),1); } { string boardARRAY[] = {"BWBBWBB", "WWBWWBW", "BBBBBBW", "WBBBBWB", "BBWWWWB", "WWWWWWW", "BBWWBBB"}; vector <string> board( boardARRAY, boardARRAY+ARRSIZE(boardARRAY) ); AlienAndGame theObject; eq(4, theObject.getNumber(board),9); } }