-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoard.hpp
More file actions
34 lines (31 loc) · 1.14 KB
/
Copy pathBoard.hpp
File metadata and controls
34 lines (31 loc) · 1.14 KB
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
26
27
28
29
30
31
32
33
34
#ifndef BOARD_H
#define BOARD_H
#include <vector>
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
class Board{
public:
Board(); //6 bins, each holds at most 4 balls
Board(int numBins, int capacity); //numBins, each holds at most capacity
void display() const;
int add(int player); //given a player, return which bin the player is added to
int winInHorizontal(int bin);
int winInVertical(int bin);
int winInDiagonal(int bin);
int win(int bin); //column must be the most recent ball in that bin
// bool isFull() const; //checks if the grid is full (at capacity)
void play();
//Make public for the main file to be able to access it
int numBins; //number of bins / LENGTH
int capacity; //maximum number of shapes held in each bin / HEIGHT
vector<vector<int>> grid;
//COMMENT OUT PRIVATE FOR GRADESCOPE
// private:
// int numBins; //number of bins / LENGTH
// int capacity; //maximum number of shapes held in each bin / HEIGHT
// vector<vector<int>> grid;
};
void print(int numBins);
#endif