cmpsc330hw4/board.h
2024-11-19 18:54:26 -05:00

29 lines
580 B
C++

#ifndef BOARD_H
#define BOARD_H
class Board {
public:
Board(int rows, int cols);
~Board();
char get(int row, int col) const;
void set(int row, int col, char value);
bool isLineValid(int row, int col) const;
void placeLine(int row, int col, char player);
int checkAndMarkBox(int row, int col, char player);
bool isFull() const;
void printBoard() const;
int getRows() const;
int getCols() const;
private:
int rows, cols; // Number of boxes (not dots)
char** board; // Dynamically allocated 2D array
};
#endif // BOARD_H