Project 3: Connect 4
Version 4
1-2-3-4 in a row
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
src
Board.h
1
#ifndef BOARD_H
2
#define BOARD_H
3
4
#include <iostream>
5
#include <string>
6
#include <iomanip>
7
8
using
std::string;
9
using
std::ostream;
10
using
std::endl;
11
12
const
int
rows = 6;
13
const
int
cols = 7;
14
const
int
diags = 24;
21
class
Board
22
{
23
private
:
27
string
board
[rows][cols];
31
int
checkerCount
;
35
bool
checkRow
(
int
);
39
bool
checkCol
(
int
col );
43
bool
checkDiag
(
int
dia );
//there are 18 locations where you can make a diagonal. This number represents one of them. I have numbered them from the top left starting with 0
44
public
:
49
Board
();
50
55
bool
win
();
60
bool
draw
();
69
bool
dropChecker
(
string
checker,
int
column );
74
bool
gameOver
();
79
void
displayBoard
( ostream& out );
83
void
resetBoard
();
84
};
85
86
#endif
Generated on Wed Mar 26 2014 19:56:01 for Project 3: Connect 4 by
1.8.2