结构的二维矢量

时间:2016-04-27 22:11:09

标签: c++

我正在制作扫雷游戏。 我有2个二维向量,一个是int类型:

vector< vector<int> > mineField;

其中填充了随机放置的地雷(地雷= -1)和一个类型单元格:

vector<vector<cell> > mineField;            //actual representation of game board 

struct cell{
     int state;                     //( 0 hidden, 1 revealed, 2 marked) 
     int value;                     //(-1 mine, 0 no surrounding, # > 0 number of surrounding mines)
     bool isMine;
};

在评估int矢量中的哪些单元没有地雷,并确定该单元周围有多少个地雷之后;在我确定了围绕它的多少个地雷后,如何使用单元格向量来更新每个单元格。 谢谢!

0 个答案:

没有答案