void test2(){ printf("test %d\n\n", Test++); vector<string> s; s.push_back("ooooo"); s.push_back("xxxx."); FallingSand fs; vector<string> ans = fs.simulate(s); for (int i = 0; i < ans.size(); ++i) { cout << ans[i] << endl;; } }
int main( int argc, char* argv[] ) { { string boardARRAY[] = {"ooooo", "..x..", "....x", ".....", "....o"}; vector <string> board( boardARRAY, boardARRAY+ARRSIZE(boardARRAY) ); string retrunValueARRAY[] = {"..o..", "..x.o", "....x", ".....", "oo.oo" }; vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); FallingSand theObject; eq(0, theObject.simulate(board),retrunValue); } { string boardARRAY[] = {"..o..", "..x.o", "....x", ".....", "oo.oo" }; vector <string> board( boardARRAY, boardARRAY+ARRSIZE(boardARRAY) ); string retrunValueARRAY[] = {"..o..", "..x.o", "....x", ".....", "oo.oo" }; vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); FallingSand theObject; eq(1, theObject.simulate(board),retrunValue); } { string boardARRAY[] = {"ooooxooo.ooxo.oxoxoooox.....x.oo"}; vector <string> board( boardARRAY, boardARRAY+ARRSIZE(boardARRAY) ); string retrunValueARRAY[] = {"ooooxooo.ooxo.oxoxoooox.....x.oo" }; vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); FallingSand theObject; eq(2, theObject.simulate(board),retrunValue); } { string boardARRAY[] = {"o", ".", "o", ".", "o", ".", "."}; vector <string> board( boardARRAY, boardARRAY+ARRSIZE(boardARRAY) ); string retrunValueARRAY[] = {".", ".", ".", ".", "o", "o", "o" }; vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); FallingSand theObject; eq(3, theObject.simulate(board),retrunValue); } { string boardARRAY[] = {"oxxxxooo", "xooooxxx", "..xx.ooo", "oooox.o.", "..x....."}; vector <string> board( boardARRAY, boardARRAY+ARRSIZE(boardARRAY) ); string retrunValueARRAY[] = {"oxxxxooo", "x.oo.xxx", "..xxo...", ".oo.x.o.", "ooxo.ooo" }; vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); FallingSand theObject; eq(4, theObject.simulate(board),retrunValue); } { string boardARRAY[] = {"..o..o..o..o..o..o..o..o..o..o..o", "o..o..o..o..o..o..o..o..o..o..o..", ".o..o..o..o..o..o..o..o..o..o..o.", "...xxx...xxx...xxxxxxxxx...xxx...", "...xxx...xxx...xxxxxxxxx...xxx...", "...xxx...xxx......xxx......xxx...", "...xxxxxxxxx......xxx......xxx...", "...xxxxxxxxx......xxx......xxx...", "...xxxxxxxxx......xxx......xxx...", "...xxx...xxx......xxx............", "...xxx...xxx...xxxxxxxxx...xxx...", "...xxx...xxx...xxxxxxxxx...xxx...", "..o..o..o..o..o..o..o..o..o..o..o", "o..o..o..o..o..o..o..o..o..o..o..", ".o..o..o..o..o..o..o..o..o..o..o."}; vector <string> board( boardARRAY, boardARRAY+ARRSIZE(boardARRAY) ); string retrunValueARRAY[] = {".................................", ".................................", "...ooo...ooo...ooooooooo...ooo...", "...xxx...xxx...xxxxxxxxx...xxx...", "...xxx...xxx...xxxxxxxxx...xxx...", "...xxxoooxxx......xxx......xxx...", "...xxxxxxxxx......xxx......xxx...", "...xxxxxxxxx......xxx......xxx...", "...xxxxxxxxx......xxx......xxx...", "...xxx...xxx......xxx............", "...xxx...xxx...xxxxxxxxx...xxx...", "...xxx...xxx...xxxxxxxxx...xxx...", ".................................", "ooo.........ooo.........ooo...ooo", "ooooooooooooooooooooooooooooooooo" }; vector <string> retrunValue( retrunValueARRAY, retrunValueARRAY+ARRSIZE(retrunValueARRAY) ); FallingSand theObject; eq(5, theObject.simulate(board),retrunValue); } return 0; }