1234567891011121314151617181920212223242526272829303132333435363738394041424344
* Arooj Mohammed C++ boardClass */ //board.h-calculates and displays the cost of laying sod #include <iostream> using std::cout; using std::endl; using std::cin; //declaration section class ConnectFour { public: ConnectFour(); void board(char); private: char place[6][7]; }; //implementation section ConnectFour::ConnectFour() { } //end of default constructor void board(char p) { place = p; cout<<" 1 2 3 4 5 6 7\n"; for(int a = 0; a<= 5; a++) { for(int b =0; b <= 6; b++) cout<<char(218)<<char(196)<<char(191)<<" "; cout<<'\n'; for(int b =0; b <= 6; b++) cout<<char(179)<<p[a][b]<<char(179)<<" "; cout<<'\n'; for(int b =0; b <= 6; b++) cout<<char(192)<<char(196)<<char(217)<<" "; cout<<'\n'; } } //end of SetDimensions method
/* Arooj Mohammed C++ boardClass */ //board.h-calculates and displays the cost of laying sod #include <iostream> using std::cout; using std::endl; using std::cin; //declaration section class ConnectFour { public: ConnectFour(); void Board(char); private: char place[6][7]; }; //implementation section ConnectFour::ConnectFour() { } //end of default constructor void ConnectFour::Board(char p) { place = p; cout<<" 1 2 3 4 5 6 7\n"; for(int a = 0; a<= 5; a++) { for(int b =0; b <= 6; b++) cout<<char(218)<<char(196)<<char(191)<<" "; cout<<'\n'; for(int b =0; b <= 6; b++) cout<<char(179)<<p[a][b]<<char(179)<<" "; cout<<'\n'; for(int b =0; b <= 6; b++) cout<<char(192)<<char(196)<<char(217)<<" "; cout<<'\n'; } } //end of SetDimensions method
std::memcpy(place, p, sizeof(place));