⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 grid.h

📁 本程序给出了SSD5实验课中Optional Exercise3的参考程序 内附有详细的注释 下载后请仔细参照源代码进行分析 切莫完全搬照
💻 H
字号:
#ifndef GRID_H
#define GRID_H

#include <string>
#include <vector>

using namespace std;

/*
 * IMPORTANT NOTE:
 *
 * For this assignment, you might need to add state to the 
 * class and/or augment existing methods, and/or create private helper 
 * methods, but you should not delare new public methods
 */

const bool INFECTED = true;
const bool NOT_INFECTED = false;

class grid;

class grid {

  private:
    int rows;
    int cols;
	int num;
    vector<bool> *area;
	vector<bool>* flag_area;

    int indexof (int row, int col) const;
    bool infected(int row, int col) const;
	void caculate(int row,int col);


  public:
    grid (string file);
    ~grid ();

    int count (int row, int col);

    friend ostream &operator<<(ostream &stream, const grid& ob);

};

#endif 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -