cmpsc330hw4/board.h

29 lines
580 B
C
Raw Normal View History

2024-11-19 23:54:26 +00:00
#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