-
Notifications
You must be signed in to change notification settings - Fork 0
/
board.h
25 lines (20 loc) · 858 Bytes
/
board.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
////////////////////////////////////////////////////////////////////////////////
// Board Class fefinition //
// Game board data and actions //
////////////////////////////////////////////////////////////////////////////////
#ifndef BOARD_H
#define BOARD_H
class Board {
private:
// private attributes
int board[6][7]; //matrix that represents the game board
// prvate methods
void Draw(); //Draws the board on the screen
public:
// Public Methods
Board(); //Board constructor
bool Put(int column, int piece); //Adds a piece to the board
int Get(int column, int row); //Retrieves a piece from the board
bool Connected4(int piece); //Checks if there is 4 consecutive pieces
};
#endif /*BOARD_H*/