-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrid.h
More file actions
94 lines (74 loc) · 3 KB
/
Copy pathGrid.h
File metadata and controls
94 lines (74 loc) · 3 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// ----------------------------------------------------------------------------
//
// Grid class
// Header
//
// This program will allow for the Grid class to be implemented in order to play ape
// egboard problem game//
// ----------------------------------------------------------------------------
//
// Generating using Edward Aryee Class Generator
// Author:
// Date:
// Modified:
//
// ----------------------------------------------------------------------------
#ifndef _Grid_
#define _Grid_
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <ctime>
#include <iomanip>
#include <vector>
#include <cstdlib>
#include <assert.h>
#include <sstream>
using namespace std;
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
class Grid
{
public:
// ------------------------------------------------------
// ----- Constructors -----------------------------------
// ------------------------------------------------------
Grid();
Grid(const unsigned int& rows, const unsigned int& columns);
Grid(const vector< vector<bool> >& inputGrid);
// ------------------------------------------------------
// ----- Destructor -------------------------------------
// ------------------------------------------------------
~Grid();
// ------------------------------------------------------
// ----- Inspectors -------------------------------------
// ------------------------------------------------------
//Note for vector types, the inspectors will need to be corrected
bool getElement(const unsigned int& i, const unsigned int& j) const;
// ------------------------------------------------------
// ----- Mutators ---------------------------------------
// ------------------------------------------------------
//Note for vector types, the mutators will need to be corrected
void fromFile(const string &fileName);
bool setElement(const unsigned int& i, const unsigned int& j, bool& value);
bool floodFill(const unsigned int& row, const unsigned int& column);
bool animatedFill(const unsigned int& row, const unsigned int& column, const double& delay);
// ------------------------------------------------------
// ----- Facilitators -----------------------------------
// ------------------------------------------------------
void output(ostream& out);
// ----------------------------------------------------------
// ----------------------------------------------------------
private:
vector< vector<bool> > grid_;
};
#endif
// ------------------------------------------------------
// ----- SubPrograms -----------------------------------
// ------------------------------------------------------
void delay(double seconds);
// ------------------------------------------------------
// ----- Operators --------------------------------------
// ------------------------------------------------------
ostream& operator<< (ostream& out,Grid& inputGrid);