Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// GameBoard.h
- #ifndef __GAMEBOARD_H__
- #define __GAMEBOARD_H__
- #include <string>
- #include <iostream>
- class GameBoard {
- std::string lines[23];
- int spaces[9];
- void printX(int);
- void printO(int);
- void printEmpty(int);
- void printHorizontalLine(int);
- void printVerticalLine(int);
- public:
- static const int X;
- static const int O;
- static const int ROW_HEIGHT;
- static const int ROW_WIDTH;
- GameBoard(){};
- void display();
- void setSpace(int, int);
- };
- #endif
- /// GameBoard.cpp
- #include "GameBoard.h"
- const int GameBoard::X = 1;
- const int GameBoard::O = 2;
- const int GameBoard::ROW_HEIGHT = 8;
- const int GameBoard::ROW_WIDTH = 29;
- void GameBoard::printX(int row)
- {
- // code
- }
- void GameBoard::printO(int row)
- {
- // code
- }
- void GameBoard::printEmpty(int row)
- {
- // code
- }
- void GameBoard::printHorizontalLine(int row)
- {
- // code
- }
- void GameBoard::printVerticalLine(int row)
- {
- // code
- }
- void GameBoard::display()
- {
- // code
- }
- void GameBoard::setSpace(int space, int XorO)
- {
- // code
- }
- /// Main.cpp
- #include <string>
- #include <iostream>
- #include "GameBoard.h"
- int main()
- {
- GameBoard board;
- board.display();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement